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
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:
- Jet 3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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> 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> Returns the right-hand key extractor function.FunctionEx<? super T1,
? extends T1_OUT> Returns the right-hand projection function.
-
Method Details
-
onKeys
public static <K,T0, JoinClause<K,T1> T0, onKeysT1, T1> (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.The given functions must be stateless and cooperative.
-
joinMapEntries
public static <K,T0, JoinClause<K,T1_OUT> T0, joinMapEntriesMap.Entry<K, T1_OUT>, T1_OUT> (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. It must be stateless and cooperative.
-
projecting
public <T1_NEW_OUT> JoinClause<K,T0, projectingT1, T1_NEW_OUT> (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.The given function must be stateless and cooperative.
-
leftKeyFn
Returns the left-hand key extractor function. -
rightKeyFn
Returns the right-hand key extractor function. -
rightProjectFn
Returns the right-hand projection function.
-