/** {@inheritDoc} */ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof GridBiTuple)) return false; GridBiTuple<?, ?> t = (GridBiTuple<?, ?>)o; // Both nulls or equals. return F.eq(val1, t.val1) && F.eq(val2, t.val2); }
/** * Default constructor. * * @param name - Name of cache data structure. */ public GridCacheInternalKeyImpl(String name) { assert !F.isEmpty(name); this.name = name; }
/** * Gets metrics map. * * @return Metrics map. */ public Map<UUID, GridNodeMetrics> metrics() { return F.viewReadOnly(metrics, new C1<byte[], GridNodeMetrics>() { @Override public GridNodeMetrics apply(byte[] metricsBytes) { return GridDiscoveryMetricsHelper.deserialize(metricsBytes, 0); } }); }
@Override public GridBiTuple<V, GridCacheVersion> apply(V v) { return F.t(v, ver); } }));
/** * * @param nodes Set of nodes. * @return Primary node. */ public static GridNode primary(Iterable<? extends GridNode> nodes) { GridNode n = F.first(nodes); assert n != null; return n; }
@Override protected GridBiTuple<GridCacheContext, String> initialValue() { return F.t2(); } };
/** * @param val Value to check. * @return Predicate array that checks for value. */ @SuppressWarnings({"unchecked"}) public GridPredicate<GridCacheEntry<K, V>>[] equalsPeekArray(V val) { assert val != null; return new GridPredicate[]{F.cacheContainsPeek(val)}; }
/** * Checks whether or not this event is an internal event. * <p> * Internal event types are always recordable for notification purposes * but may not be sent down to SPI level for storage and subsequent querying. * * @param type Event type. * @return {@code true} if this is an internal event. */ private boolean isInternalEvent(int type) { return F.contains(EVTS_DISCOVERY_ALL, type); }
/** {@inheritDoc} */ @Override public void stopAll(boolean cancel) { G.stopAll(cancel); }
/** * @param c Cache entry collection. * @param trans Transformer. * @param filter Filter. */ public GridCacheIterator(Iterable<? extends GridCacheEntry<K, V>> c, GridClosure<GridCacheEntry<K, V>, T> trans, GridPredicate<GridCacheEntry<K, V>>[] filter) { it = F.iterator0(c, false, filter); this.trans = trans; }
/** * @param flags Flags. * @return String information about cause flags. */ private static String message(Collection<GridCacheFlag> flags) { return "Cache projection flag violation (if flag is LOCAL, make sure to use peek(..) " + "instead of get(..) methods)" + (F.isEmpty(flags) ? "." : " [flags=" + flags + ']'); } }
/** * @return Collection of active endpoints. */ public Collection<GridIpcServerEndpoint> endpoints() { return F.viewReadOnly(srvrs, new C1<GridGgfsServer, GridIpcServerEndpoint>() { @Override public GridIpcServerEndpoint apply(GridGgfsServer e) { return e.getIpcServerEndpoint(); } }); }
@Override protected GridBiTuple<GridCacheContext, String> initialValue() { return F.t2(); } };
/** {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof GridSecurityCredentials)) return false; GridSecurityCredentials that = (GridSecurityCredentials)o; return F.eq(login, that.login) && F.eq(password, that.password) && F.eq(userObj, that.userObj); }
/** * Constructor. * * @param futVers Future versions. */ public GridDhtAtomicDeferredUpdateResponse(Collection<GridCacheVersion> futVers) { assert !F.isEmpty(futVers); this.futVers = futVers; }
/** {@inheritDoc} */ @Override public boolean containsKey(Object key) { return k1 != null && F.eq(key, k1); }
/** {@inheritDoc} */ @Override public boolean equals(Object obj) { return obj != null && obj instanceof GridDrStateTransferDescriptor && F.eq(id, (((GridDrStateTransferDescriptor) obj).id)); }
/** * @param cacheName Cache name. * @return {@code True} if this is Hadoop system cache. */ public static boolean isHadoopSystemCache(String cacheName) { return F.eq(cacheName, SYS_CACHE_HADOOP_MR); }