use of org.apache.flink.streaming.api.graph.StreamConfig.NetworkInputConfig in project flink by apache.
the class StreamTaskMailboxTestHarnessBuilder method initializeInputs.
protected void initializeInputs(StreamMockEnvironment streamMockEnvironment) {
inputGates = new StreamTestSingleInputGate[inputChannelsPerGate.size()];
List<StreamEdge> inPhysicalEdges = new LinkedList<>();
StreamNode mainNode = new StreamNode(StreamConfigChainer.MAIN_NODE_ID, null, null, (StreamOperator<?>) null, null, null);
for (int i = 0; i < inputs.size(); i++) {
if ((inputs.get(i) instanceof NetworkInputConfig)) {
NetworkInputConfig networkInput = (NetworkInputConfig) inputs.get(i);
initializeNetworkInput(networkInput, mainNode, streamMockEnvironment, inPhysicalEdges);
} else if ((inputs.get(i) instanceof StreamTaskMailboxTestHarnessBuilder.SourceInputConfigPlaceHolder)) {
SourceInputConfigPlaceHolder sourceInput = (SourceInputConfigPlaceHolder) inputs.get(i);
inputs.set(i, initializeSourceInput(i, sourceInput, mainNode));
} else {
throw new UnsupportedOperationException("Unknown input type " + inputs.get(i));
}
}
streamConfig.setInPhysicalEdges(inPhysicalEdges);
streamConfig.setNumberOfNetworkInputs(inputGates.length);
streamConfig.setInputs(inputs.toArray(new InputConfig[inputs.size()]));
}
use of org.apache.flink.streaming.api.graph.StreamConfig.NetworkInputConfig in project flink by apache.
the class StreamTaskMailboxTestHarnessBuilder method addInput.
public StreamTaskMailboxTestHarnessBuilder<OUT> addInput(TypeInformation<?> inputType, int inputChannels, @Nullable KeySelector<?, ?> keySelector) {
streamConfig.setStatePartitioner(inputs.size(), keySelector);
inputs.add(new NetworkInputConfig(inputType.createSerializer(executionConfig), inputChannelsPerGate.size()));
inputChannelsPerGate.add(inputChannels);
return this;
}
Aggregations