use of org.apache.flink.streaming.api.graph.StreamConfig.SourceInputConfig in project flink by apache.
the class StreamTaskMailboxTestHarnessBuilder method initializeSourceInput.
private SourceInputConfig initializeSourceInput(int inputId, SourceInputConfigPlaceHolder sourceInput, StreamNode mainNode) {
Map<Integer, StreamConfig> transitiveChainedTaskConfigs = streamConfig.getTransitiveChainedTaskConfigs(getClass().getClassLoader());
Integer maxNodeId = transitiveChainedTaskConfigs.isEmpty() ? StreamConfigChainer.MAIN_NODE_ID : Collections.max(transitiveChainedTaskConfigs.keySet());
List<StreamEdge> outEdgesInOrder = new LinkedList<>();
StreamEdge sourceToMainEdge = new StreamEdge(new StreamNode(maxNodeId + inputId + 1337, null, null, (StreamOperator<?>) null, null, null), mainNode, 0, new ForwardPartitioner<>(), null);
outEdgesInOrder.add(sourceToMainEdge);
StreamConfig sourceConfig = new StreamConfig(new Configuration());
sourceConfig.setTimeCharacteristic(streamConfig.getTimeCharacteristic());
sourceConfig.setOutEdgesInOrder(outEdgesInOrder);
sourceConfig.setChainedOutputs(outEdgesInOrder);
sourceConfig.setTypeSerializerOut(sourceInput.getSourceSerializer());
sourceConfig.setOperatorID(sourceInput.getOperatorId());
sourceConfig.setStreamOperatorFactory(sourceInput.getSourceOperatorFactory());
transitiveChainedTaskConfigs.put(sourceToMainEdge.getSourceId(), sourceConfig);
streamConfig.setTransitiveChainedTaskConfigs(transitiveChainedTaskConfigs);
return new SourceInputConfig(sourceToMainEdge);
}
Aggregations