Package eu.stratosphere.compiler.plan

Examples of eu.stratosphere.compiler.plan.BinaryUnionPlanNode


    @Override
    public void postVisit(PlanNode visitable) {
     
      if (visitable instanceof BinaryUnionPlanNode) {
        final BinaryUnionPlanNode unionNode = (BinaryUnionPlanNode) visitable;
        final Channel in1 = unionNode.getInput1();
        final Channel in2 = unionNode.getInput2();
     
        PlanNode newUnionNode;
       
        // if any input is cached, we keep this as a binary union and do not collapse it into a
        // n-ary union
//        if (in1.getTempMode().isCached() || in2.getTempMode().isCached()) {
//          // replace this node by an explicit operator
//          Channel cached, pipelined;
//          if (in1.getTempMode().isCached()) {
//            cached = in1;
//            pipelined = in2;
//          } else {
//            cached = in2;
//            pipelined = in1;
//          }
//         
//          newUnionNode = new DualInputPlanNode(unionNode.getOriginalOptimizerNode(), cached, pipelined,
//            DriverStrategy.UNION_WITH_CACHED);
//          newUnionNode.initProperties(unionNode.getGlobalProperties(), new LocalProperties());
//         
//          in1.setTarget(newUnionNode);
//          in2.setTarget(newUnionNode);
//        } else {
          // collect the union inputs to collapse this operator with
          // its collapsed predecessors. check whether an input is materialized to prevent
          // collapsing
          List<Channel> inputs = new ArrayList<Channel>();
          collect(in1, inputs);
          collect(in2, inputs);
         
          newUnionNode = new NAryUnionPlanNode(unionNode.getOptimizerNode(), inputs, unionNode.getGlobalProperties());
         
          // adjust the input channels to have their target point to the new union node
          for (Channel c : inputs) {
            c.setTarget(newUnionNode);
          }
//        }
       
        unionNode.getOutgoingChannels().get(0).swapUnionNodes(newUnionNode);
      }
    }
View Full Code Here


    return Collections.emptyList();
  }

  @Override
  public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
    return new BinaryUnionPlanNode((BinaryUnionNode) node, in1, in2);
  }
View Full Code Here

TOP

Related Classes of eu.stratosphere.compiler.plan.BinaryUnionPlanNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.