private PartialJoinFunction<Object, Object, Object, Object> createRightJoinFn(JoinOperatorSpec joinOpSpec) {
    return new PartialJoinFunction<Object, Object, Object, Object>() {
      private final JoinFunction joinFn = joinOpSpec.getJoinFn();
      private KeyValueStore<Object, TimestampedValue<Object>> rightStreamState;

      @Override
      public Object apply(Object m, Object om) {
        return joinFn.apply(om, m);
      }

      @Override
      public Object getKey(Object message) {
        return joinFn.getSecondKey(message);
      }

      @Override
      public void init(Context context) {
        String rightStoreName = joinOpSpec.getRightOpId();
        rightStreamState =
            (KeyValueStore<Object, TimestampedValue<Object>>) context.getTaskContext().getStore(rightStoreName);

        // user-defined joinFn should only be initialized once,
        // so we do it only in left partial join function and not here again.
      }

      @Override
      public KeyValueStore<Object, TimestampedValue<Object>> getState() {
        return rightStreamState;
      }
    };
  }
Creates a new {@link OperatorImpl} instance for the provided {@link OperatorSpec}.

@param prevOperatorSpec the original {@link OperatorSpec} that produces output for {@code operatorSpec} from {@link OperatorSpecGraph}
@param operatorSpec  the original {@link OperatorSpec} from {@link OperatorSpecGraph}
@param context  the {@link Context} required to instantiate operators
@return  the {@link OperatorImpl} implementation instance
samza-core/src/main/java/org/apache/samza/operators/impl/OperatorImplGraph.java