/** * Users of the test harness can call this utility method to setup the stream config * if there will only be a single operator to be tested. The method will setup the * outgoing network connection for the operator. * * <p>For more advanced test cases such as testing chains of multiple operators with the harness, * please manually configure the stream config. */ public void setupOutputForSingletonOperatorChain() { Preconditions.checkState(!setupCalled, "This harness was already setup."); setupCalled = true; streamConfig.setChainStart(); streamConfig.setBufferTimeout(0); streamConfig.setTimeCharacteristic(TimeCharacteristic.EventTime); streamConfig.setOutputSelectors(Collections.<OutputSelector<?>>emptyList()); streamConfig.setNumberOfOutputs(1); streamConfig.setTypeSerializerOut(outputSerializer); streamConfig.setVertexID(0); streamConfig.setOperatorID(new OperatorID(4711L, 123L)); StreamOperator<OUT> dummyOperator = new AbstractStreamOperator<OUT>() { private static final long serialVersionUID = 1L; }; List<StreamEdge> outEdgesInOrder = new LinkedList<StreamEdge>(); StreamNode sourceVertexDummy = new StreamNode(null, 0, "group", null, dummyOperator, "source dummy", new LinkedList<OutputSelector<?>>(), SourceStreamTask.class); StreamNode targetVertexDummy = new StreamNode(null, 1, "group", null, dummyOperator, "target dummy", new LinkedList<OutputSelector<?>>(), SourceStreamTask.class); outEdgesInOrder.add(new StreamEdge(sourceVertexDummy, targetVertexDummy, 0, new LinkedList<String>(), new BroadcastPartitioner<Object>(), null /* output tag */)); streamConfig.setOutEdgesInOrder(outEdgesInOrder); streamConfig.setNonChainedOutputs(outEdgesInOrder); }
public void finish() { List<StreamEdge> outEdgesInOrder = new LinkedList<StreamEdge>(); outEdgesInOrder.add( new StreamEdge( new StreamNode(null, chainIndex, null, null, null, null, null, null), new StreamNode(null, chainIndex , null, null, null, null, null, null), 0, Collections.<String>emptyList(), new BroadcastPartitioner<Object>(), null)); tailConfig.setBufferTimeout(0); tailConfig.setChainEnd(); tailConfig.setOutputSelectors(Collections.emptyList()); tailConfig.setNumberOfOutputs(1); tailConfig.setOutEdgesInOrder(outEdgesInOrder); tailConfig.setNonChainedOutputs(outEdgesInOrder); headConfig.setTransitiveChainedTaskConfigs(chainedConfigs); headConfig.setOutEdgesInOrder(outEdgesInOrder); } }
config.setNonChainedOutputs(nonChainableOutputs); config.setChainedOutputs(chainableOutputs);
config.setNonChainedOutputs(nonChainableOutputs); config.setChainedOutputs(chainableOutputs);
config.setNonChainedOutputs(nonChainableOutputs); config.setChainedOutputs(chainableOutputs);
config.setNonChainedOutputs(nonChainableOutputs); config.setChainedOutputs(chainableOutputs);