@Nonnull @Override public <K, T0, T1, T1_OUT> JoinClause<? extends K, ? super JetEvent<T0>, ? super T1, ? extends T1_OUT> adaptJoinClause( @Nonnull JoinClause<? extends K, ? super T0, ? super T1, ? extends T1_OUT> joinClause ) { return JoinClause.<K, JetEvent<T0>, T1>onKeys(adaptKeyFn(joinClause.leftKeyFn()), joinClause.rightKeyFn()) .projecting(joinClause.rightProjectFn()); }
/** * Returns a copy of this join clause, but with the right-hand projection * function replaced with the supplied one. */ public <T1_NEW_OUT> JoinClause<K, T0, T1, T1_NEW_OUT> projecting( DistributedFunction<? super T1, ? extends T1_NEW_OUT> rightProjectFn ) { return new JoinClause<>(this.leftKeyFn, this.rightKeyFn, rightProjectFn); }
JoinClause.onKeys(constantKey(), constantKey()), (tfVal, logDocCountVal) -> toInvertedIndexEntry( logDocCountVal, tfVal.getKey(), tfVal.getValue().entrySet()))
JoinClause<?, ?, ?, ?> clause = this.clauses.get(collectorOrdinal - 1); DistributedFunction<Object, Object> getKeyFn = (DistributedFunction<Object, Object>) clause.rightKeyFn(); DistributedFunction<Object, Object> projectFn = (DistributedFunction<Object, Object>) clause.rightProjectFn(); Vertex collector = p.dag.newVertex(collectorName + collectorOrdinal, () -> new HashJoinCollectP(getKeyFn, projectFn));
prodEntries, joinMapEntries(Trade::productId), brokEntries, joinMapEntries(Trade::brokerId), Tuple3::tuple3 ).drainTo(Sinks.logger());
/** * A shorthand factory for the common case of hash-joining with a stream of * map entries. The right key extractor is {@code Map.Entry::getKey} and the * right-hand projection function is {@code Map.Entry::getValue}. * * @param leftKeyFn the function to extract the key from the primary stream * @param <K> the type of the key * @param <T0> the type of the primary stream * @param <T1_OUT> the type of the enriching stream's entry value */ public static <K, T0, T1_OUT> JoinClause<K, T0, Entry<K, T1_OUT>, T1_OUT> joinMapEntries( DistributedFunction<? super T0, ? extends K> leftKeyFn ) { return new JoinClause<>(leftKeyFn, Entry::getKey, Entry::getValue); }
/** * 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. */ public static <K, T0, T1> JoinClause<K, T0, T1, T1> onKeys( DistributedFunction<? super T0, ? extends K> leftKeyFn, DistributedFunction<? super T1, ? extends K> rightKeyFn ) { return new JoinClause<>(leftKeyFn, rightKeyFn, DistributedFunction.identity()); }