Search in sources :

Example 1 with PartialJoinFunction

use of org.apache.samza.operators.functions.PartialJoinFunction in project samza by apache.

the class OperatorImplGraph method getOrCreatePartialJoinOpImpls.

private PartialJoinOperatorImpl getOrCreatePartialJoinOpImpls(JoinOperatorSpec joinOpSpec, boolean isLeft, Clock clock) {
    // get the per task pair of PartialJoinOperatorImpl for the corresponding {@code joinOpSpec}
    KV<PartialJoinOperatorImpl, PartialJoinOperatorImpl> partialJoinOpImpls = joinOpImpls.computeIfAbsent(joinOpSpec.getOpId(), joinOpId -> {
        PartialJoinFunction leftJoinFn = createLeftJoinFn(joinOpSpec);
        PartialJoinFunction rightJoinFn = createRightJoinFn(joinOpSpec);
        return new KV(new PartialJoinOperatorImpl(joinOpSpec, true, leftJoinFn, rightJoinFn, clock), new PartialJoinOperatorImpl(joinOpSpec, false, rightJoinFn, leftJoinFn, clock));
    });
    if (isLeft) {
        // we got here from the left side of the join
        return partialJoinOpImpls.getKey();
    } else {
        // we got here from the right side of the join
        return partialJoinOpImpls.getValue();
    }
}
Also used : PartialJoinFunction(org.apache.samza.operators.functions.PartialJoinFunction) KV(org.apache.samza.operators.KV)

Aggregations

KV (org.apache.samza.operators.KV)1 PartialJoinFunction (org.apache.samza.operators.functions.PartialJoinFunction)1