Search in sources :

Example 6 with IList

use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.

the class WatermarkMaxRetention_IntegrationTest method doTest.

private void doTest(DAG dag) {
    IList list = instance.getList(SINK_NAME);
    instance.newJob(dag, new JobConfig().setMaxWatermarkRetainMillis(3000));
    assertTrueAllTheTime(() -> assertEquals(list.toString(), 0, list.size()), 1);
    assertTrueEventually(() -> {
        assertEquals(1, list.size());
        assertEquals("wm(1)", list.get(0));
    }, 4);
}
Also used : JobConfig(com.hazelcast.jet.config.JobConfig) IList(com.hazelcast.core.IList)

Example 7 with IList

use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.

the class LimitTest method intermediateOperation_sourceCache.

@Test
public void intermediateOperation_sourceCache() {
    int limit = 10;
    IList list = streamCache().map(Entry::getValue).limit(limit).collect(DistributedCollectors.toIList(randomString()));
    assertEquals(limit, list.size());
}
Also used : Entry(java.util.Map.Entry) IList(com.hazelcast.core.IList) Test(org.junit.Test)

Example 8 with IList

use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.

the class LimitTest method sourceCache.

@Test
public void sourceCache() {
    int limit = 10;
    IList list = streamCache().limit(limit).collect(DistributedCollectors.toIList(randomString()));
    assertEquals(limit, list.size());
}
Also used : IList(com.hazelcast.core.IList) Test(org.junit.Test)

Example 9 with IList

use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.

the class ReadHdfsPTest method testReadHdfs.

@Test
public void testReadHdfs() {
    DAG dag = new DAG();
    Vertex source = dag.newVertex("source", readHdfsP(jobConf, mapperType.mapper)).localParallelism(4);
    Vertex sink = dag.newVertex("sink", writeListP("sink")).localParallelism(1);
    dag.edge(between(source, sink));
    Future<Void> future = instance.newJob(dag).getFuture();
    assertCompletesEventually(future);
    IList list = instance.getList("sink");
    assertEquals(expectedSinkSize(), list.size());
    assertTrue(list.get(0).toString().contains("value"));
}
Also used : Vertex(com.hazelcast.jet.core.Vertex) DAG(com.hazelcast.jet.core.DAG) IList(com.hazelcast.core.IList) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 10 with IList

use of com.hazelcast.core.IList in project hazelcast-jet by hazelcast.

the class SkipTest method sourceCache.

@Test
public void sourceCache() {
    int skip = 10;
    IList list = streamCache().skip(skip).collect(DistributedCollectors.toIList(randomString()));
    assertEquals(COUNT - skip, list.size());
}
Also used : IList(com.hazelcast.core.IList) Test(org.junit.Test)

Aggregations

IList (com.hazelcast.core.IList)12 Test (org.junit.Test)10 Entry (java.util.Map.Entry)6 JetInstance (com.hazelcast.jet.JetInstance)2 JetConfig (com.hazelcast.jet.config.JetConfig)2 Pipeline (com.hazelcast.jet.pipeline.Pipeline)2 Sinks (com.hazelcast.jet.pipeline.Sinks)2 Sources (com.hazelcast.jet.pipeline.Sources)2 ParallelTest (com.hazelcast.test.annotation.ParallelTest)2 EventJournalCacheEvent (com.hazelcast.cache.journal.EventJournalCacheEvent)1 ClientConfig (com.hazelcast.client.config.ClientConfig)1 EventJournalConfig (com.hazelcast.config.EventJournalConfig)1 IMap (com.hazelcast.core.IMap)1 IListJet (com.hazelcast.jet.IListJet)1 Jet (com.hazelcast.jet.Jet)1 Util.entry (com.hazelcast.jet.Util.entry)1 AggregateOperation (com.hazelcast.jet.aggregate.AggregateOperation)1 AggregateOperations.toSet (com.hazelcast.jet.aggregate.AggregateOperations.toSet)1 AggregateOperations.toThreeBags (com.hazelcast.jet.aggregate.AggregateOperations.toThreeBags)1 AggregateOperations.toTwoBags (com.hazelcast.jet.aggregate.AggregateOperations.toTwoBags)1