Java Code Examples for org.apache.flink.optimizer.dag.OptimizerNode#UnclosedBranchDescriptor

The following examples show how to use org.apache.flink.optimizer.dag.OptimizerNode#UnclosedBranchDescriptor . 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: BulkIterationPlanNode.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private void mergeBranchPlanMaps() {
	for (OptimizerNode.UnclosedBranchDescriptor desc: template.getOpenBranches()) {
		OptimizerNode brancher = desc.getBranchingNode();

		if (branchPlan == null) {
			branchPlan = new HashMap<OptimizerNode, PlanNode>(6);
		}
		
		if (!branchPlan.containsKey(brancher)) {
			PlanNode selectedCandidate = null;

			if (rootOfStepFunction.branchPlan != null) {
				selectedCandidate = rootOfStepFunction.branchPlan.get(brancher);
			}

			if (selectedCandidate == null) {
				throw new CompilerException(
						"Candidates for a node with open branches are missing information about the selected candidate ");
			}

			this.branchPlan.put(brancher, selectedCandidate);
		}
	}
}
 
Example 2
Source File: BulkIterationPlanNode.java    From flink with Apache License 2.0 6 votes vote down vote up
private void mergeBranchPlanMaps() {
	for (OptimizerNode.UnclosedBranchDescriptor desc: template.getOpenBranches()) {
		OptimizerNode brancher = desc.getBranchingNode();

		if (branchPlan == null) {
			branchPlan = new HashMap<OptimizerNode, PlanNode>(6);
		}
		
		if (!branchPlan.containsKey(brancher)) {
			PlanNode selectedCandidate = null;

			if (rootOfStepFunction.branchPlan != null) {
				selectedCandidate = rootOfStepFunction.branchPlan.get(brancher);
			}

			if (selectedCandidate == null) {
				throw new CompilerException(
						"Candidates for a node with open branches are missing information about the selected candidate ");
			}

			this.branchPlan.put(brancher, selectedCandidate);
		}
	}
}
 
Example 3
Source File: BulkIterationPlanNode.java    From flink with Apache License 2.0 6 votes vote down vote up
private void mergeBranchPlanMaps() {
	for (OptimizerNode.UnclosedBranchDescriptor desc: template.getOpenBranches()) {
		OptimizerNode brancher = desc.getBranchingNode();

		if (branchPlan == null) {
			branchPlan = new HashMap<OptimizerNode, PlanNode>(6);
		}
		
		if (!branchPlan.containsKey(brancher)) {
			PlanNode selectedCandidate = null;

			if (rootOfStepFunction.branchPlan != null) {
				selectedCandidate = rootOfStepFunction.branchPlan.get(brancher);
			}

			if (selectedCandidate == null) {
				throw new CompilerException(
						"Candidates for a node with open branches are missing information about the selected candidate ");
			}

			this.branchPlan.put(brancher, selectedCandidate);
		}
	}
}
 
Example 4
Source File: WorksetIterationPlanNode.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
protected void mergeBranchPlanMaps() {
	Map<OptimizerNode, PlanNode> branchPlan1 = input1.getSource().branchPlan;
	Map<OptimizerNode, PlanNode> branchPlan2 = input2.getSource().branchPlan;

	// merge the branchPlan maps according the template's uncloseBranchesStack
	if (this.template.hasUnclosedBranches()) {
		if (this.branchPlan == null) {
			this.branchPlan = new HashMap<OptimizerNode, PlanNode>(8);
		}

		for (OptimizerNode.UnclosedBranchDescriptor uc : this.template.getOpenBranches()) {
			OptimizerNode brancher = uc.getBranchingNode();
			PlanNode selectedCandidate = null;

			if (branchPlan1 != null) {
				// predecessor 1 has branching children, see if it got the branch we are looking for
				selectedCandidate = branchPlan1.get(brancher);
			}

			if (selectedCandidate == null && branchPlan2 != null) {
				// predecessor 2 has branching children, see if it got the branch we are looking for
				selectedCandidate = branchPlan2.get(brancher);
			}

			if(selectedCandidate == null && getSolutionSetDeltaPlanNode() != null && getSolutionSetDeltaPlanNode()
					.branchPlan != null){
				selectedCandidate = getSolutionSetDeltaPlanNode().branchPlan.get(brancher);
			}

			if(selectedCandidate == null && getNextWorkSetPlanNode() != null && getNextWorkSetPlanNode()
					.branchPlan != null){
				selectedCandidate = getNextWorkSetPlanNode().branchPlan.get(brancher);
			}

			if (selectedCandidate == null) {
				throw new CompilerException(
						"Candidates for a node with open branches are missing information about the selected candidate ");
			}

			this.branchPlan.put(brancher, selectedCandidate);
		}
	}
}
 
Example 5
Source File: WorksetIterationPlanNode.java    From flink with Apache License 2.0 4 votes vote down vote up
protected void mergeBranchPlanMaps() {
	Map<OptimizerNode, PlanNode> branchPlan1 = input1.getSource().branchPlan;
	Map<OptimizerNode, PlanNode> branchPlan2 = input2.getSource().branchPlan;

	// merge the branchPlan maps according the template's uncloseBranchesStack
	if (this.template.hasUnclosedBranches()) {
		if (this.branchPlan == null) {
			this.branchPlan = new HashMap<OptimizerNode, PlanNode>(8);
		}

		for (OptimizerNode.UnclosedBranchDescriptor uc : this.template.getOpenBranches()) {
			OptimizerNode brancher = uc.getBranchingNode();
			PlanNode selectedCandidate = null;

			if (branchPlan1 != null) {
				// predecessor 1 has branching children, see if it got the branch we are looking for
				selectedCandidate = branchPlan1.get(brancher);
			}

			if (selectedCandidate == null && branchPlan2 != null) {
				// predecessor 2 has branching children, see if it got the branch we are looking for
				selectedCandidate = branchPlan2.get(brancher);
			}

			if(selectedCandidate == null && getSolutionSetDeltaPlanNode() != null && getSolutionSetDeltaPlanNode()
					.branchPlan != null){
				selectedCandidate = getSolutionSetDeltaPlanNode().branchPlan.get(brancher);
			}

			if(selectedCandidate == null && getNextWorkSetPlanNode() != null && getNextWorkSetPlanNode()
					.branchPlan != null){
				selectedCandidate = getNextWorkSetPlanNode().branchPlan.get(brancher);
			}

			if (selectedCandidate == null) {
				throw new CompilerException(
						"Candidates for a node with open branches are missing information about the selected candidate ");
			}

			this.branchPlan.put(brancher, selectedCandidate);
		}
	}
}
 
Example 6
Source File: WorksetIterationPlanNode.java    From flink with Apache License 2.0 4 votes vote down vote up
protected void mergeBranchPlanMaps() {
	Map<OptimizerNode, PlanNode> branchPlan1 = input1.getSource().branchPlan;
	Map<OptimizerNode, PlanNode> branchPlan2 = input2.getSource().branchPlan;

	// merge the branchPlan maps according the template's uncloseBranchesStack
	if (this.template.hasUnclosedBranches()) {
		if (this.branchPlan == null) {
			this.branchPlan = new HashMap<OptimizerNode, PlanNode>(8);
		}

		for (OptimizerNode.UnclosedBranchDescriptor uc : this.template.getOpenBranches()) {
			OptimizerNode brancher = uc.getBranchingNode();
			PlanNode selectedCandidate = null;

			if (branchPlan1 != null) {
				// predecessor 1 has branching children, see if it got the branch we are looking for
				selectedCandidate = branchPlan1.get(brancher);
			}

			if (selectedCandidate == null && branchPlan2 != null) {
				// predecessor 2 has branching children, see if it got the branch we are looking for
				selectedCandidate = branchPlan2.get(brancher);
			}

			if(selectedCandidate == null && getSolutionSetDeltaPlanNode() != null && getSolutionSetDeltaPlanNode()
					.branchPlan != null){
				selectedCandidate = getSolutionSetDeltaPlanNode().branchPlan.get(brancher);
			}

			if(selectedCandidate == null && getNextWorkSetPlanNode() != null && getNextWorkSetPlanNode()
					.branchPlan != null){
				selectedCandidate = getNextWorkSetPlanNode().branchPlan.get(brancher);
			}

			if (selectedCandidate == null) {
				throw new CompilerException(
						"Candidates for a node with open branches are missing information about the selected candidate ");
			}

			this.branchPlan.put(brancher, selectedCandidate);
		}
	}
}