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 key
    `T0` - the type of the left-hand stream item
    `T1` - the type of the right-hand stream item
    `T1_OUT` - the result type of the right-hand projection function

      public final class JoinClause<K,T0,T1,T1_OUT>
      extends Object

  Specifies how to join an enriching stream to the primary stream in a `hash-join` operation. It holds three primitives:
  1. left-hand key extractor: extracts the join key from the primary stream
  2. right-hand key extractor: extracts the join key from the enriching stream
  3. right-hand projection function: maps the enriching stream item to the item that will be in the result of the join operation.
  The primary use case for the projection function is enrichment from a map source, such as `Sources.map(java.lang.String)`. The enriching stream consists of map entries, but the result should contain just the vaules. In this case the projection function should be `Entry::getValue`. There is direct support for this case with the method `joinMapEntries(DistributedFunction)`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <K,T0,T1_OUT> JoinClause<K,T0,Map.Entry<K,T1_OUT>,T1_OUT>` | `joinMapEntries(DistributedFunction<? super T0,? extends K> leftKeyFn)` A shorthand factory for the common case of hash-joining with a stream of map entries.
    `DistributedFunction<? super T0,? extends K>` | `leftKeyFn()` Returns the left-hand key extractor function.
    `static <K,T0,T1> JoinClause<K,T0,T1,T1>` | `onKeys(DistributedFunction<? super T0,? extends K> leftKeyFn, DistributedFunction<? 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(DistributedFunction<? 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.
    `DistributedFunction<? super T1,? extends K>` | `rightKeyFn()` Returns the right-hand key extractor function.
    `DistributedFunction<? super T1,? extends T1_OUT>` | `rightProjectFn()` Returns the right-hand projection function.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### onKeys

          public static <K,T0,T1> JoinClause<K,T0,T1,T1> onKeys(DistributedFunction<? super T0,? extends K> leftKeyFn,
                                                                DistributedFunction<? 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(DistributedFunction<? 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 is `Map.Entry::getKey` and the right-hand projection function is `Map.Entry::getValue`.
      Type Parameters:
        `K` - the type of the key
        `T0` - the type of the primary stream
        `T1_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(DistributedFunction<? 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

          public DistributedFunction<? super T0,? extends K> leftKeyFn()

      Returns the left-hand key extractor function.

    - #### rightKeyFn

          public DistributedFunction<? super T1,? extends K> rightKeyFn()

      Returns the right-hand key extractor function.

    - #### rightProjectFn

          public DistributedFunction<? super T1,? extends T1_OUT> rightProjectFn()

      Returns the right-hand projection function.

Copyright © 2018. All rights reserved.