use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.
the class WindowGroupTransform_IntegrationTest method testSliding_groupingFirst_withNonStreamingSource.
@Test
public void testSliding_groupingFirst_withNonStreamingSource() {
IList<Entry<Long, String>> list = instance.getList("source");
list.add(entry(0L, "foo"));
list.add(entry(1L, "bar"));
list.add(entry(2L, "baz"));
list.add(entry(3L, "booze"));
Pipeline p = Pipeline.create();
p.drawFrom(Sources.<Entry<Long, String>>list("source")).addTimestamps(Entry::getKey, 0).groupingKey(entry -> entry.getValue().charAt(0)).window(WindowDefinition.tumbling(2)).aggregate(toSet()).drainTo(Sinks.list("sink"));
instance.newJob(p).join();
assertTrueEventually(() -> {
assertEquals(set(new TimestampedEntry<>(2, 'f', set(entry(0L, "foo"))), new TimestampedEntry<>(2, 'b', set(entry(1L, "bar"))), new TimestampedEntry<>(4, 'b', set(entry(2L, "baz"), entry(3L, "booze")))), new HashSet<>(instance.getHazelcastInstance().getList("sink")));
}, 5);
}
use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.
the class SkipTest method sourceMap.
@Test
public void sourceMap() {
int skip = 10;
IList list = streamMap().skip(skip).collect(DistributedCollectors.toIList(randomString()));
assertEquals(COUNT - skip, list.size());
}
use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.
the class SkipTest method intermediateOperation_sourceMap.
@Test
public void intermediateOperation_sourceMap() {
int skip = 10;
IList list = streamMap().map(Entry::getValue).skip(skip).collect(DistributedCollectors.toIList(randomString()));
assertEquals(COUNT - skip, list.size());
}
use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.
the class LimitTest method intermediateOperation_sourceMap.
@Test
public void intermediateOperation_sourceMap() {
int limit = 10;
IList list = streamMap().map(Entry::getValue).limit(limit).collect(DistributedCollectors.toIList(randomString()));
assertEquals(limit, list.size());
}
use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.
the class LimitTest method sourceMap.
@Test
public void sourceMap() {
int limit = 10;
IList list = streamMap().limit(limit).collect(DistributedCollectors.toIList(randomString()));
assertEquals(limit, list.size());
}
Aggregations