Search in sources :

Example 11 with IList

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

the class SkipTest method intermediateOperation_sourceCache.

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

Example 12 with IList

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

the class ImdgConnectors method s14.

static void s14() {
    JetInstance jet = Jet.newJetInstance();
    // tag::s14[]
    IList<Integer> inputList = jet.getList("inputList");
    for (int i = 0; i < 10; i++) {
        inputList.add(i);
    }
    Pipeline p = Pipeline.create();
    p.drawFrom(Sources.<Integer>list("inputList")).map(i -> "item" + i).drainTo(Sinks.list("resultList"));
    jet.newJob(p).join();
    IList<String> resultList = jet.getList("resultList");
    System.out.println("Results: " + new ArrayList<>(resultList));
// end::s14[]
}
Also used : EventJournalCacheEvent(com.hazelcast.cache.journal.EventJournalCacheEvent) JetConfig(com.hazelcast.jet.config.JetConfig) StreamStage(com.hazelcast.jet.pipeline.StreamStage) Person(datamodel.Person) JetInstance(com.hazelcast.jet.JetInstance) DistributedFunctions(com.hazelcast.jet.function.DistributedFunctions) Pipeline(com.hazelcast.jet.pipeline.Pipeline) Sinks(com.hazelcast.jet.pipeline.Sinks) IListJet(com.hazelcast.jet.IListJet) EntryBackupProcessor(com.hazelcast.map.EntryBackupProcessor) ArrayList(java.util.ArrayList) BatchStage(com.hazelcast.jet.pipeline.BatchStage) Sources(com.hazelcast.jet.pipeline.Sources) EntryProcessor(com.hazelcast.map.EntryProcessor) Entry(java.util.Map.Entry) START_FROM_CURRENT(com.hazelcast.jet.pipeline.JournalInitialPosition.START_FROM_CURRENT) ClientConfig(com.hazelcast.client.config.ClientConfig) IList(com.hazelcast.core.IList) Jet(com.hazelcast.jet.Jet) DistributedFunction(com.hazelcast.jet.function.DistributedFunction) EventJournalMapEvent(com.hazelcast.map.journal.EventJournalMapEvent) JetInstance(com.hazelcast.jet.JetInstance) ArrayList(java.util.ArrayList) Pipeline(com.hazelcast.jet.pipeline.Pipeline)

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