Search in sources :

Example 31 with FunctionEx

use of com.hazelcast.function.FunctionEx in project hazelcast by hazelcast.

the class ComputeStageImplBase method attachMapUsingPartitionedServiceAsync.

@Nonnull
@SuppressWarnings({ "unchecked", "rawtypes" })
<S, K, R, RET> RET attachMapUsingPartitionedServiceAsync(@Nonnull ServiceFactory<?, S> serviceFactory, int maxConcurrentOps, boolean preserveOrder, @Nonnull FunctionEx<? super T, ? extends K> partitionKeyFn, @Nonnull BiFunctionEx<? super S, ? super T, ? extends CompletableFuture<R>> mapAsyncFn) {
    checkSerializable(mapAsyncFn, "mapAsyncFn");
    checkSerializable(partitionKeyFn, "partitionKeyFn");
    serviceFactory = moveAttachedFilesToPipeline(serviceFactory);
    BiFunctionEx<? super S, ? super T, ? extends CompletableFuture<Traverser<R>>> flatMapAsyncFn = (s, t) -> mapAsyncFn.apply(s, t).thenApply(Traversers::singleton);
    BiFunctionEx adaptedFlatMapFn = fnAdapter.adaptFlatMapUsingServiceAsyncFn(flatMapAsyncFn);
    FunctionEx adaptedPartitionKeyFn = fnAdapter.adaptKeyFn(partitionKeyFn);
    PartitionedProcessorTransform processorTransform = flatMapUsingServiceAsyncPartitionedTransform(transform, "map", serviceFactory, maxConcurrentOps, preserveOrder, adaptedFlatMapFn, adaptedPartitionKeyFn);
    return attach(processorTransform, fnAdapter);
}
Also used : Traverser(com.hazelcast.jet.Traverser) PartitionedProcessorTransform.partitionedCustomProcessorTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform.partitionedCustomProcessorTransform) PartitionedProcessorTransform.flatMapUsingServiceAsyncBatchedPartitionedTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform.flatMapUsingServiceAsyncBatchedPartitionedTransform) ProcessorTransform.flatMapUsingServiceTransform(com.hazelcast.jet.impl.pipeline.transform.ProcessorTransform.flatMapUsingServiceTransform) ProcessorTransform.mapUsingServiceTransform(com.hazelcast.jet.impl.pipeline.transform.ProcessorTransform.mapUsingServiceTransform) Collections.singletonList(java.util.Collections.singletonList) BiFunctionEx(com.hazelcast.function.BiFunctionEx) JoinClause(com.hazelcast.jet.pipeline.JoinClause) Traversers.traverseIterable(com.hazelcast.jet.Traversers.traverseIterable) Arrays.asList(java.util.Arrays.asList) ProcessorTransform.flatMapUsingServiceAsyncTransform(com.hazelcast.jet.impl.pipeline.transform.ProcessorTransform.flatMapUsingServiceAsyncTransform) Preconditions.checkTrue(com.hazelcast.internal.util.Preconditions.checkTrue) PredicateEx(com.hazelcast.function.PredicateEx) GlobalMapStatefulTransform(com.hazelcast.jet.impl.pipeline.transform.GlobalMapStatefulTransform) PeekTransform(com.hazelcast.jet.impl.pipeline.transform.PeekTransform) GeneralStage(com.hazelcast.jet.pipeline.GeneralStage) FunctionEx(com.hazelcast.function.FunctionEx) PartitionedProcessorTransform.flatMapUsingServiceAsyncPartitionedTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform.flatMapUsingServiceAsyncPartitionedTransform) Collections.emptyList(java.util.Collections.emptyList) SupplierEx(com.hazelcast.function.SupplierEx) List(java.util.List) JetEvent.jetEvent(com.hazelcast.jet.impl.JetEvent.jetEvent) ProcessorTransform(com.hazelcast.jet.impl.pipeline.transform.ProcessorTransform) MergeTransform(com.hazelcast.jet.impl.pipeline.transform.MergeTransform) PartitionedProcessorTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform) Sink(com.hazelcast.jet.pipeline.Sink) MapStatefulTransform(com.hazelcast.jet.impl.pipeline.transform.MapStatefulTransform) ComparatorEx(com.hazelcast.function.ComparatorEx) Util.checkSerializable(com.hazelcast.jet.impl.util.Util.checkSerializable) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) JetException(com.hazelcast.jet.JetException) BatchStage(com.hazelcast.jet.pipeline.BatchStage) GlobalFlatMapStatefulTransform(com.hazelcast.jet.impl.pipeline.transform.GlobalFlatMapStatefulTransform) SinkTransform(com.hazelcast.jet.impl.pipeline.transform.SinkTransform) ProcessorTransform.filterUsingServiceTransform(com.hazelcast.jet.impl.pipeline.transform.ProcessorTransform.filterUsingServiceTransform) PartitionedProcessorTransform.flatMapUsingServicePartitionedTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform.flatMapUsingServicePartitionedTransform) DEFAULT_IDLE_TIMEOUT(com.hazelcast.jet.core.EventTimePolicy.DEFAULT_IDLE_TIMEOUT) MapTransform(com.hazelcast.jet.impl.pipeline.transform.MapTransform) TimestampTransform(com.hazelcast.jet.impl.pipeline.transform.TimestampTransform) ServiceFactory(com.hazelcast.jet.pipeline.ServiceFactory) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) BiPredicateEx(com.hazelcast.function.BiPredicateEx) FlatMapStatefulTransform(com.hazelcast.jet.impl.pipeline.transform.FlatMapStatefulTransform) StreamStage(com.hazelcast.jet.pipeline.StreamStage) ProcessorTransform.flatMapUsingServiceAsyncBatchedTransform(com.hazelcast.jet.impl.pipeline.transform.ProcessorTransform.flatMapUsingServiceAsyncBatchedTransform) Util.toList(com.hazelcast.jet.impl.util.Util.toList) ProcessorMetaSupplier(com.hazelcast.jet.core.ProcessorMetaSupplier) PartitionedProcessorTransform.filterUsingServicePartitionedTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform.filterUsingServicePartitionedTransform) WatermarkPolicy.limitingLag(com.hazelcast.jet.core.WatermarkPolicy.limitingLag) Traversers(com.hazelcast.jet.Traversers) ProcessorTransform.customProcessorTransform(com.hazelcast.jet.impl.pipeline.transform.ProcessorTransform.customProcessorTransform) AbstractTransform(com.hazelcast.jet.impl.pipeline.transform.AbstractTransform) Transform(com.hazelcast.jet.impl.pipeline.transform.Transform) PartitionedProcessorTransform.mapUsingServicePartitionedTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform.mapUsingServicePartitionedTransform) SinkStage(com.hazelcast.jet.pipeline.SinkStage) ToLongFunctionEx(com.hazelcast.function.ToLongFunctionEx) HashJoinTransform(com.hazelcast.jet.impl.pipeline.transform.HashJoinTransform) SortTransform(com.hazelcast.jet.impl.pipeline.transform.SortTransform) EventTimePolicy.eventTimePolicy(com.hazelcast.jet.core.EventTimePolicy.eventTimePolicy) FlatMapTransform(com.hazelcast.jet.impl.pipeline.transform.FlatMapTransform) TriFunction(com.hazelcast.jet.function.TriFunction) Traverser(com.hazelcast.jet.Traverser) PartitionedProcessorTransform(com.hazelcast.jet.impl.pipeline.transform.PartitionedProcessorTransform) BiFunctionEx(com.hazelcast.function.BiFunctionEx) FunctionEx(com.hazelcast.function.FunctionEx) ToLongFunctionEx(com.hazelcast.function.ToLongFunctionEx) Traversers(com.hazelcast.jet.Traversers) BiFunctionEx(com.hazelcast.function.BiFunctionEx) Nonnull(javax.annotation.Nonnull)

Example 32 with FunctionEx

use of com.hazelcast.function.FunctionEx in project hazelcast by hazelcast.

the class ComputeStageImplBase method attachFlatMapUsingPartitionedService.

@Nonnull
@SuppressWarnings({ "unchecked", "rawtypes" })
<S, K, R, RET> RET attachFlatMapUsingPartitionedService(@Nonnull ServiceFactory<?, S> serviceFactory, @Nonnull FunctionEx<? super T, ? extends K> partitionKeyFn, @Nonnull BiFunctionEx<? super S, ? super T, ? extends Traverser<R>> flatMapFn) {
    checkSerializable(flatMapFn, "flatMapFn");
    checkSerializable(partitionKeyFn, "partitionKeyFn");
    serviceFactory = moveAttachedFilesToPipeline(serviceFactory);
    BiFunctionEx adaptedFlatMapFn = fnAdapter.adaptFlatMapUsingServiceFn(flatMapFn);
    FunctionEx adaptedPartitionKeyFn = fnAdapter.adaptKeyFn(partitionKeyFn);
    return (RET) attach(flatMapUsingServicePartitionedTransform(transform, serviceFactory, adaptedFlatMapFn, adaptedPartitionKeyFn), fnAdapter);
}
Also used : BiFunctionEx(com.hazelcast.function.BiFunctionEx) FunctionEx(com.hazelcast.function.FunctionEx) ToLongFunctionEx(com.hazelcast.function.ToLongFunctionEx) BiFunctionEx(com.hazelcast.function.BiFunctionEx) Nonnull(javax.annotation.Nonnull)

Example 33 with FunctionEx

use of com.hazelcast.function.FunctionEx in project hazelcast by hazelcast.

the class Planner method fuseFlatMapTransforms.

@SuppressWarnings("rawtypes")
private static Transform fuseFlatMapTransforms(List<Transform> chain) {
    assert chain.size() > 1 : "chain.size()=" + chain.size();
    assert chain.get(0).upstream().size() == 1;
    int lastFlatMap = 0;
    FunctionEx<Object, Traverser> flatMapFn = null;
    for (int i = 0; i < chain.size(); i++) {
        if (chain.get(i) instanceof FlatMapTransform) {
            FunctionEx<Object, Traverser> function = ((FlatMapTransform) chain.get(i)).flatMapFn();
            FunctionEx<Object, Object> inputMapFn = mergeMapFunctions(chain.subList(lastFlatMap, i));
            if (inputMapFn != null) {
                flatMapFn = flatMapFn == null ? (Object t) -> {
                    Object mappedValue = inputMapFn.apply(t);
                    return mappedValue != null ? function.apply(mappedValue) : Traversers.empty();
                } : flatMapFn.andThen(r -> r.map(inputMapFn).flatMap(function));
            } else {
                flatMapFn = flatMapFn == null ? function::apply : flatMapFn.andThen(r -> r.flatMap(function));
            }
            lastFlatMap = i + 1;
        }
    }
    FunctionEx trailingMapFn = mergeMapFunctions(chain.subList(lastFlatMap, chain.size()));
    String name = chain.stream().map(Transform::name).collect(Collectors.joining(", ", "fused(", ")"));
    Transform fused;
    if (flatMapFn == null) {
        fused = new MapTransform(name, chain.get(0).upstream().get(0), trailingMapFn);
    } else {
        if (trailingMapFn != null) {
            flatMapFn = flatMapFn.andThen(t -> t.map(trailingMapFn));
        }
        fused = new FlatMapTransform(name, chain.get(0).upstream().get(0), flatMapFn);
    }
    // if the first stage of the chain is rebalanced, then we set
    // the rebalance flag of the created fused stage. Only consider
    // the case when first element of the chain is rebalanced
    // because there isn't any other case. If any stage in the
    // middle includes rebalance, then those stages are not fused
    // by findFusableChain().
    fused.setRebalanceInput(0, chain.get(0).shouldRebalanceInput(0));
    return fused;
}
Also used : Traverser(com.hazelcast.jet.Traverser) LoggingUtil(com.hazelcast.jet.impl.util.LoggingUtil) Processor(com.hazelcast.jet.core.Processor) HashMap(java.util.HashMap) ObjIntConsumer(java.util.function.ObjIntConsumer) EventTimePolicy(com.hazelcast.jet.core.EventTimePolicy) ArrayList(java.util.ArrayList) SinkTransform(com.hazelcast.jet.impl.pipeline.transform.SinkTransform) TopologicalSorter.checkTopologicalSort(com.hazelcast.jet.impl.TopologicalSorter.checkTopologicalSort) ILogger(com.hazelcast.logging.ILogger) Map(java.util.Map) MapTransform(com.hazelcast.jet.impl.pipeline.transform.MapTransform) TimestampTransform(com.hazelcast.jet.impl.pipeline.transform.TimestampTransform) Edge.from(com.hazelcast.jet.core.Edge.from) DAG(com.hazelcast.jet.core.DAG) Edge(com.hazelcast.jet.core.Edge) Nonnull(javax.annotation.Nonnull) ProcessorSupplier(com.hazelcast.jet.core.ProcessorSupplier) FunctionEx(com.hazelcast.function.FunctionEx) Logger(com.hazelcast.logging.Logger) Util.toList(com.hazelcast.jet.impl.util.Util.toList) ProcessorMetaSupplier(com.hazelcast.jet.core.ProcessorMetaSupplier) Traversers(com.hazelcast.jet.Traversers) Collectors(java.util.stream.Collectors) SupplierEx(com.hazelcast.function.SupplierEx) Transform(com.hazelcast.jet.impl.pipeline.transform.Transform) Consumer(java.util.function.Consumer) Vertex(com.hazelcast.jet.core.Vertex) Util(com.hazelcast.jet.impl.util.Util) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) Entry(java.util.Map.Entry) StreamSourceTransform(com.hazelcast.jet.impl.pipeline.transform.StreamSourceTransform) EventTimePolicy.eventTimePolicy(com.hazelcast.jet.core.EventTimePolicy.eventTimePolicy) FlatMapTransform(com.hazelcast.jet.impl.pipeline.transform.FlatMapTransform) Context(com.hazelcast.jet.impl.pipeline.PipelineImpl.Context) Traverser(com.hazelcast.jet.Traverser) FunctionEx(com.hazelcast.function.FunctionEx) MapTransform(com.hazelcast.jet.impl.pipeline.transform.MapTransform) FlatMapTransform(com.hazelcast.jet.impl.pipeline.transform.FlatMapTransform) SinkTransform(com.hazelcast.jet.impl.pipeline.transform.SinkTransform) MapTransform(com.hazelcast.jet.impl.pipeline.transform.MapTransform) TimestampTransform(com.hazelcast.jet.impl.pipeline.transform.TimestampTransform) Transform(com.hazelcast.jet.impl.pipeline.transform.Transform) StreamSourceTransform(com.hazelcast.jet.impl.pipeline.transform.StreamSourceTransform) FlatMapTransform(com.hazelcast.jet.impl.pipeline.transform.FlatMapTransform) FlatMapTransform(com.hazelcast.jet.impl.pipeline.transform.FlatMapTransform)

Example 34 with FunctionEx

use of com.hazelcast.function.FunctionEx in project hazelcast by hazelcast.

the class HashJoinTransform method addToDag.

// ---------           ----------           ----------
// | primary |         | joined-1 |         | joined-2 |
// ---------           ----------           ----------
// |                   |                     |
// |              distributed          distributed
// |               broadcast            broadcast
// |                   v                     v
// |             -------------         -------------
// |            | collector-1 |       | collector-2 |
// |            | localPara=1 |       | localPara=1 |
// |             -------------         -------------
// |                   |                     |
// |                 local                 local
// local             broadcast             broadcast
// unicast           prioritized           prioritized
// ordinal 0           ordinal 1             ordinal 2
// \                   |                     |
// ----------------\  |   /----------------/
// v  v  v
// --------
// | joiner |
// --------
@Override
@SuppressWarnings("unchecked")
public void addToDag(Planner p, Context context) {
    determineLocalParallelism(LOCAL_PARALLELISM_USE_DEFAULT, context, p.isPreserveOrder());
    PlannerVertex primary = p.xform2vertex.get(this.upstream().get(0));
    List keyFns = toList(this.clauses, JoinClause::leftKeyFn);
    List<Tag> tags = this.tags;
    BiFunctionEx mapToOutputBiFn = this.mapToOutputBiFn;
    TriFunction mapToOutputTriFn = this.mapToOutputTriFn;
    // must be extracted to variable, probably because of serialization bug
    BiFunctionEx<List<Tag>, Object[], ItemsByTag> tupleToItems = tupleToItemsByTag(whereNullsNotAllowed);
    Vertex joiner = p.addVertex(this, name() + "-joiner", determinedLocalParallelism(), () -> new HashJoinP<>(keyFns, tags, mapToOutputBiFn, mapToOutputTriFn, tupleToItems)).v;
    Edge edgeToJoiner = from(primary.v, primary.nextAvailableOrdinal()).to(joiner, 0);
    if (p.isPreserveOrder()) {
        edgeToJoiner.isolated();
    } else {
        applyRebalancing(edgeToJoiner, this);
    }
    p.dag.edge(edgeToJoiner);
    String collectorName = name() + "-collector";
    int collectorOrdinal = 1;
    for (Transform fromTransform : tailList(this.upstream())) {
        PlannerVertex fromPv = p.xform2vertex.get(fromTransform);
        JoinClause<?, ?, ?, ?> clause = this.clauses.get(collectorOrdinal - 1);
        FunctionEx<Object, Object> getKeyFn = (FunctionEx<Object, Object>) clause.rightKeyFn();
        FunctionEx<Object, Object> projectFn = (FunctionEx<Object, Object>) clause.rightProjectFn();
        Vertex collector = p.dag.newVertex(collectorName + collectorOrdinal, () -> new HashJoinCollectP(getKeyFn, projectFn));
        collector.localParallelism(1);
        p.dag.edge(from(fromPv.v, fromPv.nextAvailableOrdinal()).to(collector, 0).distributed().broadcast());
        p.dag.edge(from(collector, 0).to(joiner, collectorOrdinal).broadcast().priority(-1));
        collectorOrdinal++;
    }
}
Also used : Vertex(com.hazelcast.jet.core.Vertex) PlannerVertex(com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex) HashJoinCollectP(com.hazelcast.jet.impl.processor.HashJoinCollectP) HashJoinP(com.hazelcast.jet.impl.processor.HashJoinP) ItemsByTag(com.hazelcast.jet.datamodel.ItemsByTag) PlannerVertex(com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex) FunctionEx(com.hazelcast.function.FunctionEx) BiFunctionEx(com.hazelcast.function.BiFunctionEx) TriFunction(com.hazelcast.jet.function.TriFunction) Util.toList(com.hazelcast.jet.impl.util.Util.toList) List(java.util.List) Planner.tailList(com.hazelcast.jet.impl.pipeline.Planner.tailList) Tag(com.hazelcast.jet.datamodel.Tag) ItemsByTag(com.hazelcast.jet.datamodel.ItemsByTag) JoinClause(com.hazelcast.jet.pipeline.JoinClause) Edge(com.hazelcast.jet.core.Edge) BiFunctionEx(com.hazelcast.function.BiFunctionEx)

Example 35 with FunctionEx

use of com.hazelcast.function.FunctionEx in project hazelcast by hazelcast.

the class CoAggregateOperationBuilder method build.

/**
 * Builds and returns the multi-input {@link AggregateOperation}. It will
 * call the supplied {@code exportFinishFn} to transform the {@link ItemsByTag}
 * it creates to the result type it emits as the actual result.
 *
 * @param exportFinishFn function to convert {@link ItemsByTag} to the
 *     target result type. It must be stateless and {@linkplain
 *     Processor#isCooperative() cooperative}.
 */
@Nonnull
@SuppressWarnings({ "unchecked", "ConstantConditions" })
public <R> AggregateOperation<Object[], R> build(@Nonnull FunctionEx<? super ItemsByTag, ? extends R> exportFinishFn) {
    checkSerializable(exportFinishFn, "exportFinishFn");
    Tag[] tags = opsByTag.keySet().stream().sorted().toArray(Tag[]::new);
    for (int i = 0; i < tags.length; i++) {
        Preconditions.checkTrue(tags[i].index() == i, "Registered tags' indices are " + stream(tags).map(Tag::index).collect(toList()) + ", but should be " + range(0, tags.length).boxed().collect(toList()));
    }
    // Variable `sorted` extracted due to type inference failure
    Stream<Entry<Tag, AggregateOperation1>> sorted = opsByTag.entrySet().stream().sorted(comparing(Entry::getKey));
    List<AggregateOperation1> ops = sorted.map(Entry::getValue).collect(toList());
    BiConsumerEx[] combineFns = ops.stream().map(AggregateOperation::combineFn).toArray(BiConsumerEx[]::new);
    BiConsumerEx[] deductFns = ops.stream().map(AggregateOperation::deductFn).toArray(BiConsumerEx[]::new);
    FunctionEx[] exportFns = ops.stream().map(AggregateOperation::exportFn).toArray(FunctionEx[]::new);
    FunctionEx[] finishFns = ops.stream().map(AggregateOperation::finishFn).toArray(FunctionEx[]::new);
    AggregateOperationBuilder.VarArity<Object[], Void> b = AggregateOperation.withCreate(() -> ops.stream().map(op -> op.createFn().get()).toArray()).varArity();
    opsByTag.forEach((tag, op) -> {
        int index = tag.index();
        b.andAccumulate(tag, (acc, item) -> op.accumulateFn().accept(acc[index], item));
    });
    return b.andCombine(stream(combineFns).anyMatch(Objects::isNull) ? null : (acc1, acc2) -> {
        for (int i = 0; i < combineFns.length; i++) {
            combineFns[i].accept(acc1[i], acc2[i]);
        }
    }).andDeduct(stream(deductFns).anyMatch(Objects::isNull) ? null : (acc1, acc2) -> {
        for (int i = 0; i < deductFns.length; i++) {
            deductFns[i].accept(acc1[i], acc2[i]);
        }
    }).<R>andExport(acc -> {
        ItemsByTag result = new ItemsByTag();
        for (int i = 0; i < exportFns.length; i++) {
            result.put(tags[i], exportFns[i].apply(acc[i]));
        }
        return exportFinishFn.apply(result);
    }).andFinish(acc -> {
        ItemsByTag result = new ItemsByTag();
        for (int i = 0; i < finishFns.length; i++) {
            result.put(tags[i], finishFns[i].apply(acc[i]));
        }
        return exportFinishFn.apply(result);
    });
}
Also used : FunctionEx(com.hazelcast.function.FunctionEx) Preconditions(com.hazelcast.internal.util.Preconditions) IntStream.range(java.util.stream.IntStream.range) SerializationUtil.checkSerializable(com.hazelcast.internal.serialization.impl.SerializationUtil.checkSerializable) Tag(com.hazelcast.jet.datamodel.Tag) BiConsumerEx(com.hazelcast.function.BiConsumerEx) Processor(com.hazelcast.jet.core.Processor) HashMap(java.util.HashMap) Objects(java.util.Objects) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) Stream(java.util.stream.Stream) StageWithKeyAndWindow(com.hazelcast.jet.pipeline.StageWithKeyAndWindow) Map(java.util.Map) FunctionEx.identity(com.hazelcast.function.FunctionEx.identity) ItemsByTag(com.hazelcast.jet.datamodel.ItemsByTag) Entry(java.util.Map.Entry) Comparator.comparing(java.util.Comparator.comparing) Nonnull(javax.annotation.Nonnull) Arrays.stream(java.util.Arrays.stream) ItemsByTag(com.hazelcast.jet.datamodel.ItemsByTag) Entry(java.util.Map.Entry) BiConsumerEx(com.hazelcast.function.BiConsumerEx) FunctionEx(com.hazelcast.function.FunctionEx) Objects(java.util.Objects) Tag(com.hazelcast.jet.datamodel.Tag) ItemsByTag(com.hazelcast.jet.datamodel.ItemsByTag) Nonnull(javax.annotation.Nonnull)

Aggregations

FunctionEx (com.hazelcast.function.FunctionEx)44 List (java.util.List)30 Nonnull (javax.annotation.Nonnull)20 DAG (com.hazelcast.jet.core.DAG)18 Test (org.junit.Test)18 Collections.singletonList (java.util.Collections.singletonList)15 Assert.assertEquals (org.junit.Assert.assertEquals)15 Edge (com.hazelcast.jet.core.Edge)14 BiFunctionEx (com.hazelcast.function.BiFunctionEx)13 Function (java.util.function.Function)13 LongAccumulator (com.hazelcast.jet.accumulator.LongAccumulator)12 ArrayList (java.util.ArrayList)12 ToLongFunctionEx (com.hazelcast.function.ToLongFunctionEx)11 Vertex (com.hazelcast.jet.core.Vertex)11 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)11 Entry (java.util.Map.Entry)11 Assert.assertTrue (org.junit.Assert.assertTrue)11 JetException (com.hazelcast.jet.JetException)10 AggregateOperation1 (com.hazelcast.jet.aggregate.AggregateOperation1)10 QuickTest (com.hazelcast.test.annotation.QuickTest)10