org.apache.flink.optimizer.dag.WorksetIterationNode.SingleRootJoiner Java Examples

The following examples show how to use org.apache.flink.optimizer.dag.WorksetIterationNode.SingleRootJoiner. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BulkIterationNode.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the nextPartialSolution for this BulkIterationNode.
 *
 * @param nextPartialSolution The nextPartialSolution to set.
 */
public void setNextPartialSolution(OptimizerNode nextPartialSolution, OptimizerNode terminationCriterion) {
	
	// check if the root of the step function has the same parallelism as the iteration
	// or if the step function has any operator at all
	if (nextPartialSolution.getParallelism() != getParallelism() ||
		nextPartialSolution == partialSolution || nextPartialSolution instanceof BinaryUnionNode)
	{
		// add a no-op to the root to express the re-partitioning
		NoOpNode noop = new NoOpNode();
		noop.setParallelism(getParallelism());

		DagConnection noOpConn = new DagConnection(nextPartialSolution, noop, ExecutionMode.PIPELINED);
		noop.setIncomingConnection(noOpConn);
		nextPartialSolution.addOutgoingConnection(noOpConn);
		
		nextPartialSolution = noop;
	}
	
	this.nextPartialSolution = nextPartialSolution;
	this.terminationCriterion = terminationCriterion;
	
	if (terminationCriterion == null) {
		this.singleRoot = nextPartialSolution;
		this.rootConnection = new DagConnection(nextPartialSolution, ExecutionMode.PIPELINED);
	}
	else {
		// we have a termination criterion
		SingleRootJoiner singleRootJoiner = new SingleRootJoiner();
		this.rootConnection = new DagConnection(nextPartialSolution, singleRootJoiner, ExecutionMode.PIPELINED);
		this.terminationCriterionRootConnection = new DagConnection(terminationCriterion, singleRootJoiner,
																	ExecutionMode.PIPELINED);

		singleRootJoiner.setInputs(this.rootConnection, this.terminationCriterionRootConnection);
		
		this.singleRoot = singleRootJoiner;
		
		// add connection to terminationCriterion for interesting properties visitor
		terminationCriterion.addOutgoingConnection(terminationCriterionRootConnection);
	
	}
	
	nextPartialSolution.addOutgoingConnection(rootConnection);
}
 
Example #2
Source File: BulkIterationNode.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the nextPartialSolution for this BulkIterationNode.
 *
 * @param nextPartialSolution The nextPartialSolution to set.
 */
public void setNextPartialSolution(OptimizerNode nextPartialSolution, OptimizerNode terminationCriterion) {
	
	// check if the root of the step function has the same parallelism as the iteration
	// or if the step function has any operator at all
	if (nextPartialSolution.getParallelism() != getParallelism() ||
		nextPartialSolution == partialSolution || nextPartialSolution instanceof BinaryUnionNode)
	{
		// add a no-op to the root to express the re-partitioning
		NoOpNode noop = new NoOpNode();
		noop.setParallelism(getParallelism());

		DagConnection noOpConn = new DagConnection(nextPartialSolution, noop, ExecutionMode.PIPELINED);
		noop.setIncomingConnection(noOpConn);
		nextPartialSolution.addOutgoingConnection(noOpConn);
		
		nextPartialSolution = noop;
	}
	
	this.nextPartialSolution = nextPartialSolution;
	this.terminationCriterion = terminationCriterion;
	
	if (terminationCriterion == null) {
		this.singleRoot = nextPartialSolution;
		this.rootConnection = new DagConnection(nextPartialSolution, ExecutionMode.PIPELINED);
	}
	else {
		// we have a termination criterion
		SingleRootJoiner singleRootJoiner = new SingleRootJoiner();
		this.rootConnection = new DagConnection(nextPartialSolution, singleRootJoiner, ExecutionMode.PIPELINED);
		this.terminationCriterionRootConnection = new DagConnection(terminationCriterion, singleRootJoiner,
																	ExecutionMode.PIPELINED);

		singleRootJoiner.setInputs(this.rootConnection, this.terminationCriterionRootConnection);
		
		this.singleRoot = singleRootJoiner;
		
		// add connection to terminationCriterion for interesting properties visitor
		terminationCriterion.addOutgoingConnection(terminationCriterionRootConnection);
	
	}
	
	nextPartialSolution.addOutgoingConnection(rootConnection);
}
 
Example #3
Source File: BulkIterationNode.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the nextPartialSolution for this BulkIterationNode.
 *
 * @param nextPartialSolution The nextPartialSolution to set.
 */
public void setNextPartialSolution(OptimizerNode nextPartialSolution, OptimizerNode terminationCriterion) {
	
	// check if the root of the step function has the same parallelism as the iteration
	// or if the step function has any operator at all
	if (nextPartialSolution.getParallelism() != getParallelism() ||
		nextPartialSolution == partialSolution || nextPartialSolution instanceof BinaryUnionNode)
	{
		// add a no-op to the root to express the re-partitioning
		NoOpNode noop = new NoOpNode();
		noop.setParallelism(getParallelism());

		DagConnection noOpConn = new DagConnection(nextPartialSolution, noop, ExecutionMode.PIPELINED);
		noop.setIncomingConnection(noOpConn);
		nextPartialSolution.addOutgoingConnection(noOpConn);
		
		nextPartialSolution = noop;
	}
	
	this.nextPartialSolution = nextPartialSolution;
	this.terminationCriterion = terminationCriterion;
	
	if (terminationCriterion == null) {
		this.singleRoot = nextPartialSolution;
		this.rootConnection = new DagConnection(nextPartialSolution, ExecutionMode.PIPELINED);
	}
	else {
		// we have a termination criterion
		SingleRootJoiner singleRootJoiner = new SingleRootJoiner();
		this.rootConnection = new DagConnection(nextPartialSolution, singleRootJoiner, ExecutionMode.PIPELINED);
		this.terminationCriterionRootConnection = new DagConnection(terminationCriterion, singleRootJoiner,
																	ExecutionMode.PIPELINED);

		singleRootJoiner.setInputs(this.rootConnection, this.terminationCriterionRootConnection);
		
		this.singleRoot = singleRootJoiner;
		
		// add connection to terminationCriterion for interesting properties visitor
		terminationCriterion.addOutgoingConnection(terminationCriterionRootConnection);
	
	}
	
	nextPartialSolution.addOutgoingConnection(rootConnection);
}