use of com.hazelcast.jet.pipeline.JournalInitialPosition.START_FROM_OLDEST in project hazelcast-jet by hazelcast.
the class HazelcastRemoteConnectorTest method when_streamRemoteMap_withPredicateAndProjection.
@Test
public void when_streamRemoteMap_withPredicateAndProjection() {
DAG dag = new DAG();
Vertex source = dag.newVertex(SOURCE_NAME, SourceProcessors.<Integer, Integer, Integer>streamRemoteMapP(SOURCE_NAME, clientConfig, event -> event.getKey() != 0, EventJournalMapEvent::getKey, START_FROM_OLDEST, wmGenParams(i -> i, limitingLag(0), noThrottling(), 10_000)));
Vertex sink = dag.newVertex(SINK_NAME, writeListP(SINK_NAME));
dag.edge(between(source, sink));
Job job = jet.newJob(dag);
populateMap(hz.getMap(SOURCE_NAME));
assertSizeEventually(ITEM_COUNT - 1, jet.getList(SINK_NAME));
assertFalse(jet.getList(SINK_NAME).contains(0));
assertTrue(jet.getList(SINK_NAME).contains(1));
job.cancel();
}
use of com.hazelcast.jet.pipeline.JournalInitialPosition.START_FROM_OLDEST in project hazelcast-jet by hazelcast.
the class HazelcastRemoteConnectorTest method when_streamRemoteCache_withPredicateAndProjection.
@Test
public void when_streamRemoteCache_withPredicateAndProjection() {
DAG dag = new DAG();
Vertex source = dag.newVertex(SOURCE_NAME, SourceProcessors.<Integer, Integer, Integer>streamRemoteCacheP(SOURCE_NAME, clientConfig, event -> !event.getKey().equals(0), EventJournalCacheEvent::getKey, START_FROM_OLDEST, wmGenParams(i -> i, limitingLag(0), noThrottling(), 10_000)));
Vertex sink = dag.newVertex(SINK_NAME, writeListP(SINK_NAME));
dag.edge(between(source, sink));
Job job = jet.newJob(dag);
populateCache(hz.getCacheManager().getCache(SOURCE_NAME));
assertSizeEventually(ITEM_COUNT - 1, jet.getList(SINK_NAME));
assertFalse(jet.getList(SINK_NAME).contains(0));
assertTrue(jet.getList(SINK_NAME).contains(1));
job.cancel();
}
use of com.hazelcast.jet.pipeline.JournalInitialPosition.START_FROM_OLDEST in project hazelcast-jet by hazelcast.
the class StreamEventJournalPTest method setUp.
@Before
public void setUp() {
JetConfig config = new JetConfig();
EventJournalConfig journalConfig = new EventJournalConfig().setMapName("*").setCapacity(JOURNAL_CAPACITY).setEnabled(true);
config.getHazelcastConfig().setProperty(PARTITION_COUNT.getName(), String.valueOf(NUM_PARTITIONS));
config.getHazelcastConfig().addEventJournalConfig(journalConfig);
instance = this.createJetMember(config);
map = (MapProxyImpl<String, Integer>) instance.getHazelcastInstance().<String, Integer>getMap("test");
List<Integer> allPartitions = IntStream.range(0, NUM_PARTITIONS).boxed().collect(toList());
supplier = () -> new StreamEventJournalP<>(map, allPartitions, e -> true, EventJournalMapEvent::getNewValue, START_FROM_OLDEST, false, wmGenParams(Integer::intValue, limitingLag(0), suppressAll(), -1));
key0 = generateKeyForPartition(instance.getHazelcastInstance(), 0);
key1 = generateKeyForPartition(instance.getHazelcastInstance(), 1);
}
Aggregations