Source:
OperatorImpl createOperatorImpl(OperatorSpec prevOperatorSpec, OperatorSpec operatorSpec, Config config, TaskContext context) { if (operatorSpec instanceof InputOperatorSpec) { return new InputOperatorImpl((InputOperatorSpec) operatorSpec); } else if (operatorSpec instanceof StreamOperatorSpec) { return new StreamOperatorImpl((StreamOperatorSpec) operatorSpec); } else if (operatorSpec instanceof SinkOperatorSpec) { return new SinkOperatorImpl((SinkOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof OutputOperatorSpec) { String streamId = ((OutputOperatorSpec) operatorSpec).getOutputStream().getStreamId(); SystemStream systemStream = util.toSystemStream(streamId); return new OutputOperatorImpl((OutputOperatorSpec) operatorSpec, systemStream); } else if (operatorSpec instanceof PartitionByOperatorSpec) { String streamId = ((PartitionByOperatorSpec) operatorSpec).getOutputStream().getStreamId(); SystemStream systemStream = util.toSystemStream(streamId); return new PartitionByOperatorImpl((PartitionByOperatorSpec) operatorSpec, systemStream, context); } else if (operatorSpec instanceof WindowOperatorSpec) { return new WindowOperatorImpl((WindowOperatorSpec) operatorSpec, clock); } else if (operatorSpec instanceof JoinOperatorSpec) { return getOrCreatePartialJoinOpImpls((JoinOperatorSpec) operatorSpec, prevOperatorSpec.equals(((JoinOperatorSpec) operatorSpec).getLeftInputOpSpec()), config, context, clock); } else if (operatorSpec instanceof StreamTableJoinOperatorSpec) { return new StreamTableJoinOperatorImpl((StreamTableJoinOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof SendToTableOperatorSpec) { return new SendToTableOperatorImpl((SendToTableOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof BroadcastOperatorSpec) { String streamId = ((BroadcastOperatorSpec) operatorSpec).getOutputStream().getStreamId(); SystemStream systemStream = util.toSystemStream(streamId); return new BroadcastOperatorImpl((BroadcastOperatorSpec) operatorSpec, systemStream, context); } throw new IllegalArgumentException( String.format("Unsupported OperatorSpec: %s", operatorSpec.getClass().getName())); }

Target:
OperatorImpl createOperatorImpl(OperatorSpec prevOperatorSpec, OperatorSpec operatorSpec, Config config, TaskContext context) { StreamConfig streamConfig = new StreamConfig(config); if (operatorSpec instanceof InputOperatorSpec) { return new InputOperatorImpl((InputOperatorSpec) operatorSpec); } else if (operatorSpec instanceof StreamOperatorSpec) { return new StreamOperatorImpl((StreamOperatorSpec) operatorSpec); } else if (operatorSpec instanceof SinkOperatorSpec) { return new SinkOperatorImpl((SinkOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof OutputOperatorSpec) { String streamId = ((OutputOperatorSpec) operatorSpec).getOutputStream().getStreamId(); SystemStream systemStream = streamConfig.streamIdToSystemStream(streamId); return new OutputOperatorImpl((OutputOperatorSpec) operatorSpec, systemStream); } else if (operatorSpec instanceof PartitionByOperatorSpec) { String streamId = ((PartitionByOperatorSpec) operatorSpec).getOutputStream().getStreamId(); SystemStream systemStream = streamConfig.streamIdToSystemStream(streamId); return new PartitionByOperatorImpl((PartitionByOperatorSpec) operatorSpec, systemStream, context); } else if (operatorSpec instanceof WindowOperatorSpec) { return new WindowOperatorImpl((WindowOperatorSpec) operatorSpec, clock); } else if (operatorSpec instanceof JoinOperatorSpec) { return getOrCreatePartialJoinOpImpls((JoinOperatorSpec) operatorSpec, prevOperatorSpec.equals(((JoinOperatorSpec) operatorSpec).getLeftInputOpSpec()), config, context, clock); } else if (operatorSpec instanceof StreamTableJoinOperatorSpec) { return new StreamTableJoinOperatorImpl((StreamTableJoinOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof SendToTableOperatorSpec) { return new SendToTableOperatorImpl((SendToTableOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof BroadcastOperatorSpec) { String streamId = ((BroadcastOperatorSpec) operatorSpec).getOutputStream().getStreamId(); SystemStream systemStream = streamConfig.streamIdToSystemStream(streamId); return new BroadcastOperatorImpl((BroadcastOperatorSpec) operatorSpec, systemStream, context); } throw new IllegalArgumentException( String.format("Unsupported OperatorSpec: %s", operatorSpec.getClass().getName())); }