Modifier and Type | Method and Description |
---|---|
<K,A,E1,R> ComputeStage<Map.Entry<K,R>> |
coGroup(DistributedFunction<? super E,? extends K> thisKeyFn,
ComputeStage<E1> stage1,
DistributedFunction<? super E1,? extends K> key1Fn,
AggregateOperation2<? super E,? super E1,A,R> aggrOp)
Attaches to this and the supplied stage a stage that co-groups their items
by a common key and applies the supplied aggregate operation to co-grouped
items.
|
<K,A,E1,E2,R> |
coGroup(DistributedFunction<? super E,? extends K> thisKeyFn,
ComputeStage<E1> stage1,
DistributedFunction<? super E1,? extends K> key1Fn,
ComputeStage<E2> stage2,
DistributedFunction<? super E2,? extends K> key2Fn,
AggregateOperation3<? super E,? super E1,? super E2,A,R> aggrOp)
Attaches to this and the supplied stages a stage that co-groups their items
by a common key and applies the supplied aggregate operation to co-grouped
items.
|
default <K> CoGroupBuilder<K,E> |
coGroupBuilder(DistributedFunction<? super E,K> thisKeyFn)
Returns a fluent API builder object to construct a co-group operation
with any number of contributing stages.
|
<R> ComputeStage<R> |
customTransform(String stageName,
DistributedSupplier<Processor> procSupplier)
Attaches to this stage a stage with a custom transform based on the
provided supplier of Core API
Processor s. |
SinkStage |
drainTo(Sink<? super E> sink)
Attaches to this stage a sink stage, one that accepts data but doesn't
emit any.
|
ComputeStage<E> |
filter(DistributedPredicate<E> filterFn)
Attaches to this stage a filtering stage, one which applies the provided
predicate function to each input item to decide whether to pass the item
to the output or to discard it.
|
<R> ComputeStage<R> |
flatMap(DistributedFunction<? super E,Traverser<? extends R>> flatMapFn)
Attaches to this stage a flat-mapping stage, one which applies the
supplied function to each input item independently and emits all items
from the
Traverser it returns as the output items. |
<K,A,R> ComputeStage<Map.Entry<K,R>> |
groupBy(DistributedFunction<? super E,? extends K> keyFn,
AggregateOperation1<? super E,A,R> aggrOp)
Attaches to this stage a group-by-key stage, one which will group all
received items by the key returned from the provided key-extracting
function.
|
<K1,E1_IN,E1,K2,E2_IN,E2> |
hashJoin(ComputeStage<E1_IN> stage1,
JoinClause<K1,E,E1_IN,E1> joinClause1,
ComputeStage<E2_IN> stage2,
JoinClause<K2,E,E2_IN,E2> joinClause2)
Attaches to this and the two supplied stages a hash-joining stage and
returns it.
|
<K,E1_IN,E1> |
hashJoin(ComputeStage<E1_IN> stage1,
JoinClause<K,E,E1_IN,E1> joinClause)
Attaches to both this and the supplied stage a hash-joining stage and
returns it.
|
default HashJoinBuilder<E> |
hashJoinBuilder()
Returns a fluent API builder object to construct a hash join operation
with any number of contributing stages.
|
<R> ComputeStage<R> |
map(DistributedFunction<? super E,? extends R> mapFn)
Attaches to this stage a mapping stage, one which applies the supplied
function to each input item independently and emits the function's
result as the output item.
|
default ComputeStage<E> |
peek()
Adds a peeking layer to this compute stage which logs its output.
|
default ComputeStage<E> |
peek(DistributedFunction<? super E,String> toStringFn)
Adds a peeking layer to this compute stage which logs its output.
|
ComputeStage<E> |
peek(DistributedPredicate<? super E> shouldLogFn,
DistributedFunction<? super E,String> toStringFn)
Adds a peeking layer to this compute stage which logs its output.
|
getPipeline
<R> ComputeStage<R> map(DistributedFunction<? super E,? extends R> mapFn)
R
- the result type of the mapping functionmapFn
- the mapping functionComputeStage<E> filter(DistributedPredicate<E> filterFn)
filterFn
- the filter predicate function<R> ComputeStage<R> flatMap(DistributedFunction<? super E,Traverser<? extends R>> flatMapFn)
Traverser
it returns as the output items. Returns the
newly attached stage.R
- the type of items in the result's traversersflatMapFn
- the flatmapping function, whose result type is Jet's Traverser
<K,A,R> ComputeStage<Map.Entry<K,R>> groupBy(DistributedFunction<? super E,? extends K> keyFn, AggregateOperation1<? super E,A,R> aggrOp)
K
- the type of keyA
- the type of the accumulatorR
- the type of the aggregation resultkeyFn
- the function that extracts the grouping key from an itemaggrOp
- the aggregate operation to perform<K,E1_IN,E1> ComputeStage<Tuple2<E,E1>> hashJoin(ComputeStage<E1_IN> stage1, JoinClause<K,E,E1_IN,E1> joinClause)
package Javadoc
for a detailed description of the hash-join transform.K
- the type of the join keyE1_IN
- the type of stage1
itemsE1
- the result type of projection on stage1
itemsstage1
- the stage to hash-join with this onejoinClause
- specifies how to join the two streams<K1,E1_IN,E1,K2,E2_IN,E2> ComputeStage<Tuple3<E,E1,E2>> hashJoin(ComputeStage<E1_IN> stage1, JoinClause<K1,E,E1_IN,E1> joinClause1, ComputeStage<E2_IN> stage2, JoinClause<K2,E,E2_IN,E2> joinClause2)
package
Javadoc
for a detailed description of the hash-join transform.K1
- the type of key for stage1
E1_IN
- the type of stage1
itemsE1
- the result type of projection of stage1
itemsK2
- the type of key for stage2
E2_IN
- the type of stage2
itemsE2
- the result type of projection of stage2
itemsstage1
- the first stage to joinjoinClause1
- specifies how to join with stage1
stage2
- the second stage to joinjoinClause2
- specifices how to join with stage2
default HashJoinBuilder<E> hashJoinBuilder()
stage.hashJoin(...)
calls should be preferred because they offer
more static type safety.<K,A,E1,R> ComputeStage<Map.Entry<K,R>> coGroup(DistributedFunction<? super E,? extends K> thisKeyFn, ComputeStage<E1> stage1, DistributedFunction<? super E1,? extends K> key1Fn, AggregateOperation2<? super E,? super E1,A,R> aggrOp)
K
- the type of the grouping keyA
- the type of the accumulatorE1
- the type of stage1
itemsR
- the result type of the aggregate operationthisKeyFn
- a function that extracts the grouping key from this stage's itemsstage1
- the stage to co-group with this onekey1Fn
- a function that extracts the grouping key from stage1
itemsaggrOp
- the aggregate operation to perform on co-grouped items<K,A,E1,E2,R> ComputeStage<Map.Entry<K,R>> coGroup(DistributedFunction<? super E,? extends K> thisKeyFn, ComputeStage<E1> stage1, DistributedFunction<? super E1,? extends K> key1Fn, ComputeStage<E2> stage2, DistributedFunction<? super E2,? extends K> key2Fn, AggregateOperation3<? super E,? super E1,? super E2,A,R> aggrOp)
K
- the type of the grouping keyA
- the type of the accumulatorE1
- the type of stage1
itemsE2
- the type of stage1
itemsR
- the result type of the aggregate operationthisKeyFn
- a function that extracts the grouping key from this stage's itemsstage1
- the first stage to co-group with this onekey1Fn
- a function that extracts the grouping key from stage1
itemsstage2
- the second stage to co-group with this onekey2Fn
- a function that extracts the grouping key from stage2
itemsaggrOp
- the aggregate operation to perform on co-grouped itemsdefault <K> CoGroupBuilder<K,E> coGroupBuilder(DistributedFunction<? super E,K> thisKeyFn)
stage.coGroup(...)
calls should be preferred because they offer more
static type safety.K
- the type of the grouping keythisKeyFn
- a function that extracts the grouping key from this stage's itemsComputeStage<E> peek(@Nonnull DistributedPredicate<? super E> shouldLogFn, @Nonnull DistributedFunction<? super E,String> toStringFn)
shouldLogFn
predicate to see whether to log the item
toStringFn
to get a string
representation of the item
com.hazelcast.jet.impl.processor.PeekWrappedP.<vertexName>#<processorIndex>
shouldLogFn
- a function to filter the logged items. You can use alwaysTrue()
as a pass-through filter when you don't need any
filtering.toStringFn
- a function that returns a string representation of the itempeek(DistributedFunction)
,
peek()
default ComputeStage<E> peek(@Nonnull DistributedFunction<? super E,String> toStringFn)
toStringFn
to get a string representation of the item
com.hazelcast.jet.impl.processor.PeekWrappedP.<vertexName>#<processorIndex>
toStringFn
- a function that returns a string representation of the itempeek(DistributedPredicate, DistributedFunction)
,
peek()
default ComputeStage<E> peek()
toString()
method at the INFO level to the log category com.hazelcast.jet.impl.processor.PeekWrappedP.<vertexName>#<processorIndex>
.
The stage logs each item on whichever cluster member it happens to
receive it. Its primary purpose is for development use, when running Jet
on a local machine.SinkStage drainTo(Sink<? super E> sink)
<R> ComputeStage<R> customTransform(String stageName, DistributedSupplier<Processor> procSupplier)
Processor
s. To be compatible with
the rest of the pipeline, the processor must expect a single inbound
edge and arbitrarily many outbound edges, and it must push the same data
to all outbound edges.
Note that the returned stage's type parameter is inferred from the call site and not propagated from the processor that will produce the result, so there is no actual type safety provided.
R
- the type of the output itemsstageName
- a human-readable name for the custom stageprocSupplier
- the supplier of processorsCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.