Search in sources :

Example 11 with Tuple2.tuple2

use of com.hazelcast.jet.datamodel.Tuple2.tuple2 in project hazelcast-jet-reference-manual by hazelcast.

the class BuildComputation method s2.

static void s2() {
    // tag::s2[]
    Pipeline p = Pipeline.create();
    StreamStage<Trade> trades = p.drawFrom(Sources.mapJournal("trades", mapPutEvents(), mapEventNewValue(), START_FROM_CURRENT));
    BatchStage<Entry<Integer, Product>> products = p.drawFrom(Sources.<Integer, Product>map("products"));
    StreamStage<Tuple2<Trade, Product>> joined = trades.hashJoin(products, joinMapEntries(Trade::productId), Tuple2::tuple2);
// end::s2[]
}
Also used : Trade(datamodel.Trade) Entry(java.util.Map.Entry) Tuple2(com.hazelcast.jet.datamodel.Tuple2) Pipeline(com.hazelcast.jet.pipeline.Pipeline)

Aggregations

Tuple2 (com.hazelcast.jet.datamodel.Tuple2)10 Tuple2.tuple2 (com.hazelcast.jet.datamodel.Tuple2.tuple2)7 List (java.util.List)7 Entry (java.util.Map.Entry)7 DAG (com.hazelcast.jet.core.DAG)6 Map (java.util.Map)6 Function (java.util.function.Function)6 JetException (com.hazelcast.jet.JetException)5 Edge (com.hazelcast.jet.core.Edge)5 ItemsByTag (com.hazelcast.jet.datamodel.ItemsByTag)5 ArrayList (java.util.ArrayList)5 Collections.singletonList (java.util.Collections.singletonList)5 Nonnull (javax.annotation.Nonnull)5 LongAccumulator (com.hazelcast.jet.accumulator.LongAccumulator)4 AggregateOperation1 (com.hazelcast.jet.aggregate.AggregateOperation1)4 AggregateOperations.coAggregateOperationBuilder (com.hazelcast.jet.aggregate.AggregateOperations.coAggregateOperationBuilder)4 CoAggregateOperationBuilder (com.hazelcast.jet.aggregate.CoAggregateOperationBuilder)4 Tag (com.hazelcast.jet.datamodel.Tag)4 Tuple3 (com.hazelcast.jet.datamodel.Tuple3)4 Tuple3.tuple3 (com.hazelcast.jet.datamodel.Tuple3.tuple3)4