Package com.hazelcast.jet.pipeline
Class JoinClause<K,T0,T1,T1_OUT>
java.lang.Object
com.hazelcast.jet.pipeline.JoinClause<K,T0,T1,T1_OUT>
- Type Parameters:
K
- the type of the join keyT0
- the type of the left-hand stream itemT1
- the type of the right-hand stream itemT1_OUT
- the result type of the right-hand projection function
- All Implemented Interfaces:
Serializable
public final class JoinClause<K,T0,T1,T1_OUT> extends Object implements Serializable
Specifies how to join an enriching stream to the primary stream in a
hash-join
operation. It holds three
primitives:
- left-hand key extractor: extracts the join key from the primary stream
- right-hand key extractor: extracts the join key from the enriching stream
- right-hand projection function: maps the enriching stream item to the item that will be in the result of the join operation.
Sources.map(java.lang.String)
.
The enriching stream consists of map entries, but the result should
contain just the values. In this case the projection function should be
Entry::getValue
. There is direct support for this case with the
method joinMapEntries(FunctionEx)
.- Since:
- 3.0
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description static <K, T0, T1_OUT>
JoinClause<K,T0,Map.Entry<K,T1_OUT>,T1_OUT>joinMapEntries(FunctionEx<? super T0,? extends K> leftKeyFn)
A shorthand factory for the common case of hash-joining with a stream of map entries.FunctionEx<? super T0,? extends K>
leftKeyFn()
Returns the left-hand key extractor function.static <K, T0, T1> JoinClause<K,T0,T1,T1>
onKeys(FunctionEx<? super T0,? extends K> leftKeyFn, FunctionEx<? super T1,? extends K> rightKeyFn)
Constructs and returns a join clause with the supplied left-hand and right-hand key extractor functions, and with an identity right-hand projection function.<T1_NEW_OUT>
JoinClause<K,T0,T1,T1_NEW_OUT>projecting(FunctionEx<? super T1,? extends T1_NEW_OUT> rightProjectFn)
Returns a copy of this join clause, but with the right-hand projection function replaced with the supplied one.FunctionEx<? super T1,? extends K>
rightKeyFn()
Returns the right-hand key extractor function.FunctionEx<? super T1,? extends T1_OUT>
rightProjectFn()
Returns the right-hand projection function.
-
Method Details
-
onKeys
public static <K, T0, T1> JoinClause<K,T0,T1,T1> onKeys(FunctionEx<? super T0,? extends K> leftKeyFn, FunctionEx<? super T1,? extends K> rightKeyFn)Constructs and returns a join clause with the supplied left-hand and right-hand key extractor functions, and with an identity right-hand projection function. -
joinMapEntries
public static <K, T0, T1_OUT> JoinClause<K,T0,Map.Entry<K,T1_OUT>,T1_OUT> joinMapEntries(FunctionEx<? super T0,? extends K> leftKeyFn)A shorthand factory for the common case of hash-joining with a stream of map entries. The right key extractor isMap.Entry::getKey
and the right-hand projection function isMap.Entry::getValue
.- Type Parameters:
K
- the type of the keyT0
- the type of the primary streamT1_OUT
- the type of the enriching stream's entry value- Parameters:
leftKeyFn
- the function to extract the key from the primary stream
-
projecting
public <T1_NEW_OUT> JoinClause<K,T0,T1,T1_NEW_OUT> projecting(FunctionEx<? super T1,? extends T1_NEW_OUT> rightProjectFn)Returns a copy of this join clause, but with the right-hand projection function replaced with the supplied one. -
leftKeyFn
Returns the left-hand key extractor function. -
rightKeyFn
Returns the right-hand key extractor function. -
rightProjectFn
Returns the right-hand projection function.
-