protected void removeClosedBranches(List<UnclosedBranchDescriptor> openList) { if (openList == null || openList.isEmpty() || this.closedBranchingNodes == null || this.closedBranchingNodes.isEmpty()) { return; } Iterator<UnclosedBranchDescriptor> it = openList.iterator(); while (it.hasNext()) { if (this.closedBranchingNodes.contains(it.next().getBranchingNode())) { //this branch was already closed --> remove it from the list it.remove(); } } }
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); } } } }
protected void mergeBranchPlanMaps(Map<OptimizerNode, PlanNode> branchPlan1, Map<OptimizerNode, PlanNode> branchPlan2) { // 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 (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); } // it may be that the branch candidate is only found once the broadcast variables are set if (selectedCandidate != null) { this.branchPlan.put(brancher, selectedCandidate); } } } }
protected void mergeBranchPlanMaps(Map<OptimizerNode, PlanNode> branchPlan1, Map<OptimizerNode, PlanNode> branchPlan2) { // 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 (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); } // it may be that the branch candidate is only found once the broadcast variables are set if (selectedCandidate != null) { this.branchPlan.put(brancher, selectedCandidate); } } } }
protected void mergeBranchPlanMaps(Map<OptimizerNode, PlanNode> branchPlan1, Map<OptimizerNode, PlanNode> branchPlan2) { // 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 (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); } // it may be that the branch candidate is only found once the broadcast variables are set if (selectedCandidate != null) { this.branchPlan.put(brancher, selectedCandidate); } } } }
protected void mergeBranchPlanMaps(Map<OptimizerNode, PlanNode> branchPlan1, Map<OptimizerNode, PlanNode> branchPlan2) { // 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 (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); } // it may be that the branch candidate is only found once the broadcast variables are set if (selectedCandidate != null) { this.branchPlan.put(brancher, selectedCandidate); } } } }
/** * Sets a list of all broadcast inputs attached to this node. */ public void setBroadcastInputs(List<NamedChannel> broadcastInputs) { if (broadcastInputs != null) { this.broadcastInputs = broadcastInputs; // update the branch map for (NamedChannel nc : broadcastInputs) { PlanNode source = nc.getSource(); mergeBranchPlanMaps(branchPlan, source.branchPlan); } } // do a sanity check that if we are branching, we have now candidates for each branch point if (this.template.hasUnclosedBranches()) { if (this.branchPlan == null) { throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point."); } for (UnclosedBranchDescriptor uc : this.template.getOpenBranches()) { OptimizerNode brancher = uc.getBranchingNode(); if (this.branchPlan.get(brancher) == null) { throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point."); } } } }
/** * Sets a list of all broadcast inputs attached to this node. */ public void setBroadcastInputs(List<NamedChannel> broadcastInputs) { if (broadcastInputs != null) { this.broadcastInputs = broadcastInputs; // update the branch map for (NamedChannel nc : broadcastInputs) { PlanNode source = nc.getSource(); mergeBranchPlanMaps(branchPlan, source.branchPlan); } } // do a sanity check that if we are branching, we have now candidates for each branch point if (this.template.hasUnclosedBranches()) { if (this.branchPlan == null) { throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point."); } for (UnclosedBranchDescriptor uc : this.template.getOpenBranches()) { OptimizerNode brancher = uc.getBranchingNode(); if (this.branchPlan.get(brancher) == null) { throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point."); } } } }
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); } } } }
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); } } } }
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); } } } }
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); } } } }
protected void removeClosedBranches(List<UnclosedBranchDescriptor> openList) { if (openList == null || openList.isEmpty() || this.closedBranchingNodes == null || this.closedBranchingNodes.isEmpty()) { return; } Iterator<UnclosedBranchDescriptor> it = openList.iterator(); while (it.hasNext()) { if (this.closedBranchingNodes.contains(it.next().getBranchingNode())) { //this branch was already closed --> remove it from the list it.remove(); } } }
protected void removeClosedBranches(List<UnclosedBranchDescriptor> openList) { if (openList == null || openList.isEmpty() || this.closedBranchingNodes == null || this.closedBranchingNodes.isEmpty()) { return; } Iterator<UnclosedBranchDescriptor> it = openList.iterator(); while (it.hasNext()) { if (this.closedBranchingNodes.contains(it.next().getBranchingNode())) { //this branch was already closed --> remove it from the list it.remove(); } } }
protected void removeClosedBranches(List<UnclosedBranchDescriptor> openList) { if (openList == null || openList.isEmpty() || this.closedBranchingNodes == null || this.closedBranchingNodes.isEmpty()) { return; } Iterator<UnclosedBranchDescriptor> it = openList.iterator(); while (it.hasNext()) { if (this.closedBranchingNodes.contains(it.next().getBranchingNode())) { //this branch was already closed --> remove it from the list it.remove(); } } }
protected void removeClosedBranches(List<UnclosedBranchDescriptor> openList) { if (openList == null || openList.isEmpty() || this.closedBranchingNodes == null || this.closedBranchingNodes.isEmpty()) { return; } Iterator<UnclosedBranchDescriptor> it = openList.iterator(); while (it.hasNext()) { if (this.closedBranchingNodes.contains(it.next().getBranchingNode())) { //this branch was already closed --> remove it from the list it.remove(); } } }
branchDeterminers[i] = this.openBranches.get(this.openBranches.size() - 1 - i).getBranchingNode();
int id2 = index2 >= 0 ? child2open.get(index2).getBranchingNode().getId() : -1; while (index1 >= 0 && (id1 = child1open.get(index1).getBranchingNode().getId()) > id2) { result.add(child1open.get(index1)); index1--; while (index2 >= 0 && (id2 = child2open.get(index2).getBranchingNode().getId()) > id1) { result.add(child2open.get(index2)); index2--; OptimizerNode currBanchingNode = child1open.get(index1).getBranchingNode();
OptimizerNode brancher = uc.getBranchingNode(); PlanNode selectedCandidate = null;
/** * Sets a list of all broadcast inputs attached to this node. */ public void setBroadcastInputs(List<NamedChannel> broadcastInputs) { if (broadcastInputs != null) { this.broadcastInputs = broadcastInputs; // update the branch map for (NamedChannel nc : broadcastInputs) { PlanNode source = nc.getSource(); mergeBranchPlanMaps(branchPlan, source.branchPlan); } } // do a sanity check that if we are branching, we have now candidates for each branch point if (this.template.hasUnclosedBranches()) { if (this.branchPlan == null) { throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point."); } for (UnclosedBranchDescriptor uc : this.template.getOpenBranches()) { OptimizerNode brancher = uc.getBranchingNode(); if (this.branchPlan.get(brancher) == null) { throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point."); } } } }