/** {@inheritDoc} */ @Override public void onDiscoveryDataReceived(UUID nodeId, UUID rmtNodeId, Serializable data) { Map<String, Serializable> discData = (Map<String, Serializable>) data; if (discData != null) { for (Map.Entry<String, Serializable> e : discData.entrySet()) { PluginProvider provider = plugins.get(e.getKey()); if (provider != null) provider.receiveDiscoveryData(nodeId, e.getValue()); else U.warn(log, "Received discovery data for unknown plugin: " + e.getKey()); } } }
/** {@inheritDoc} */ @Nullable @Override public Serializable collectDiscoveryData(UUID nodeId) { HashMap<String, Serializable> discData = null; for (Map.Entry<String, PluginProvider> e : plugins.entrySet()) { Serializable data = e.getValue().provideDiscoveryData(nodeId); if (data != null) { if (discData == null) discData = new HashMap<>(); discData.put(e.getKey(), data); } } return discData; }
/** {@inheritDoc} */ @Override public void testClear() throws Exception { IgniteCache<String, Integer> nearCache = jcache(); IgniteCache<String, Integer> primary = fullCache(); Collection<String> keys = primaryKeysForCache(primary, 3); Map<String, Integer> vals = new HashMap<>(); int i = 0; for (String key : keys) { nearCache.put(key, i); vals.put(key, i); i++; } i = 0; for (String key : keys) assertEquals((Integer) i++, nearCache.localPeek(key, CachePeekMode.ONHEAP)); nearCache.clear(); for (String key : keys) assertNull(nearCache.localPeek(key, CachePeekMode.ONHEAP)); for (Map.Entry<String, Integer> entry : vals.entrySet()) nearCache.put(entry.getKey(), entry.getValue()); i = 0; for (String key : keys) assertEquals((Integer) i++, nearCache.localPeek(key, CachePeekMode.ONHEAP)); }