use of com.hazelcast.jet.core.processor.SinkProcessors.writeMapP in project hazelcast by hazelcast.
the class HazelcastConnectorTest method test_writeMapWithNearCache.
@Test
public void test_writeMapWithNearCache() {
List<Integer> items = range(0, ENTRY_COUNT).boxed().collect(toList());
sinkName = "nearCache-" + randomName();
DAG dag = new DAG();
Vertex src = dag.newVertex("src", () -> new TestProcessors.ListSource(items)).localParallelism(1);
Vertex sink = dag.newVertex("sink", SinkProcessors.writeMapP(sinkName, i -> i, i -> i));
dag.edge(between(src, sink));
instance().getJet().newJob(dag).join();
IMap<Object, Object> sinkMap = instance().getMap(sinkName);
assertInstanceOf(NearCachedMapProxyImpl.class, sinkMap);
assertEquals(ENTRY_COUNT, sinkMap.size());
}
Aggregations