@Override public CloseableIteratorSet<Entry<K, V>> entrySet() { return delegate.entrySet(); }
@Override public CloseableIteratorSet<Entry<K, V>> entrySet(IntSet segments) { return delegate.entrySet(segments); }
public void loadProtobufSchema(RemoteCache<String, String> metadataCache) { metadataCache.entrySet() .stream() .filter(entry -> !entry.getKey().equals(SCHEMA_PROTO)) .forEach((entry) -> { int index = entry.getKey().lastIndexOf('.'); String protoTypeName = entry.getKey().substring(0, index); String proto = entry.getValue(); try { marshaller.registerSchema(protoTypeName, proto, KObject.class); } catch (IOException e) { throw new InfinispanException("Can't add protobuf schema <" + protoTypeName + "> to cache", e); } }); }
public void loadProtobufSchema(RemoteCache<String, String> metadataCache) { metadataCache.entrySet() .stream() .filter(entry -> !entry.getKey().equals(addCachePrefix(SCHEMA_PROTO))) .forEach((entry) -> { int index = entry.getKey().lastIndexOf('.'); String protoTypeName = entry.getKey().substring(0, index); String proto = entry.getValue(); try { marshaller.registerSchema(protoTypeName, proto, KObject.class); } catch (IOException e) { throw new InfinispanException("Can't add protobuf schema <" + protoTypeName + "> to cache", e); } }); }
@Test public void testEntrySet() { remoteCache.put("k1", "v1"); remoteCache.put("k2", "v2"); remoteCache.put("k3", "v3"); Set<Map.Entry<String, String>> expectedEntrySet = new HashSet<>(); expectedEntrySet.add(new AbstractMap.SimpleEntry<>("k1", "v1")); expectedEntrySet.add(new AbstractMap.SimpleEntry<>("k2", "v2")); expectedEntrySet.add(new AbstractMap.SimpleEntry<>("k3", "v3")); assertEquals(expectedEntrySet, remoteCache.entrySet()); }