Package eu.stratosphere.compiler.plan

Examples of eu.stratosphere.compiler.plan.NamedChannel


     
      boolean validCombination = true;
     
      // check whether the broadcast inputs use the same plan candidate at the branching point
      for (int i = 0; i < broadcastChannelsCombination.size(); i++) {
        NamedChannel nc = broadcastChannelsCombination.get(i);
        PlanNode bcSource = nc.getSource();
       
        // check branch compatibility against input
        if (!areBranchCompatible(bcSource, inputSource)) {
          validCombination = false;
          break;
View Full Code Here


      String broadcastConnectionName = broadcastConnectionNames.get(i);
      List<PlanNode> broadcastPlanCandidates = broadcastConnection.getSource().getAlternativePlans(estimator);
      // wrap the plan candidates in named channels
      HashSet<NamedChannel> broadcastChannels = new HashSet<NamedChannel>(broadcastPlanCandidates.size());
      for (PlanNode plan: broadcastPlanCandidates) {
        final NamedChannel c = new NamedChannel(broadcastConnectionName, plan);
        c.setShipStrategy(ShipStrategyType.BROADCAST);
        broadcastChannels.add(c);
      }
      broadcastPlanChannels.add(broadcastChannels);
    }

    final RequestedGlobalProperties[] allValidGlobals;
    {
      Set<RequestedGlobalProperties> pairs = new HashSet<RequestedGlobalProperties>();
      for (OperatorDescriptorSingle ods : getPossibleProperties()) {
        pairs.addAll(ods.getPossibleGlobalProperties());
      }
      allValidGlobals = (RequestedGlobalProperties[]) pairs.toArray(new RequestedGlobalProperties[pairs.size()]);
    }
    final ArrayList<PlanNode> outputPlans = new ArrayList<PlanNode>();
   
    final int dop = getDegreeOfParallelism();
    final int subPerInstance = getSubtasksPerInstance();
    final int inDop = getPredecessorNode().getDegreeOfParallelism();
    final int inSubPerInstance = getPredecessorNode().getSubtasksPerInstance();
    final int numInstances = dop / subPerInstance + (dop % subPerInstance == 0 ? 0 : 1);
    final int inNumInstances = inDop / inSubPerInstance + (inDop % inSubPerInstance == 0 ? 0 : 1);
   
    final boolean globalDopChange = numInstances != inNumInstances;
    final boolean localDopChange = numInstances == inNumInstances & subPerInstance != inSubPerInstance;
   
    // create all candidates
    for (PlanNode child : subPlans) {
      if (this.inConn.getShipStrategy() == null) {
        // pick the strategy ourselves
        for (RequestedGlobalProperties igps: intGlobal) {
          final Channel c = new Channel(child, this.inConn.getMaterializationMode());
          igps.parameterizeChannel(c, globalDopChange, localDopChange);
         
          // if the DOP changed, make sure that we cancel out properties, unless the
          // ship strategy preserves/establishes them even under changing DOPs
          if (globalDopChange && !c.getShipStrategy().isNetworkStrategy()) {
            c.getGlobalProperties().reset();
          }
          if (localDopChange && !(c.getShipStrategy().isNetworkStrategy() ||
                c.getShipStrategy().compensatesForLocalDOPChanges())) {
            c.getGlobalProperties().reset();
          }
         
          // check whether we meet any of the accepted properties
          // we may remove this check, when we do a check to not inherit
          // requested global properties that are incompatible with all possible
          // requested properties
          for (RequestedGlobalProperties rgps: allValidGlobals) {
            if (rgps.isMetBy(c.getGlobalProperties())) {
              addLocalCandidates(c, broadcastPlanChannels, igps, outputPlans, estimator);
              break;
            }
          }
        }
      } else {
        // hint fixed the strategy
        final Channel c = new Channel(child, this.inConn.getMaterializationMode());
        if (this.keys != null) {
          c.setShipStrategy(this.inConn.getShipStrategy(), this.keys.toFieldList());
        } else {
          c.setShipStrategy(this.inConn.getShipStrategy());
        }
       
        if (globalDopChange) {
          c.adjustGlobalPropertiesForFullParallelismChange();
        } else if (localDopChange) {
          c.adjustGlobalPropertiesForLocalParallelismChange();
        }
       
        // check whether we meet any of the accepted properties
        for (RequestedGlobalProperties rgps: allValidGlobals) {
          if (rgps.isMetBy(c.getGlobalProperties())) {
            addLocalCandidates(c, broadcastPlanChannels, rgps, outputPlans, estimator);
            break;
          }
        }
      }
View Full Code Here

      String broadcastConnectionName = broadcastConnectionNames.get(i);
      List<PlanNode> broadcastPlanCandidates = broadcastConnection.getSource().getAlternativePlans(estimator);
      // wrap the plan candidates in named channels
      HashSet<NamedChannel> broadcastChannels = new HashSet<NamedChannel>(broadcastPlanCandidates.size());
      for (PlanNode plan: broadcastPlanCandidates) {
        final NamedChannel c = new NamedChannel(broadcastConnectionName, plan);
        c.setShipStrategy(ShipStrategyType.BROADCAST);
        broadcastChannels.add(c);
      }
      broadcastPlanChannels.add(broadcastChannels);
    }
   
View Full Code Here

      String broadcastConnectionName = broadcastConnectionNames.get(i);
      List<PlanNode> broadcastPlanCandidates = broadcastConnection.getSource().getAlternativePlans(estimator);
      // wrap the plan candidates in named channels
      HashSet<NamedChannel> broadcastChannels = new HashSet<NamedChannel>(broadcastPlanCandidates.size());
      for (PlanNode plan: broadcastPlanCandidates) {
        final NamedChannel c = new NamedChannel(broadcastConnectionName, plan);
        c.setShipStrategy(ShipStrategyType.BROADCAST);
        broadcastChannels.add(c);
      }
      broadcastPlanChannels.add(broadcastChannels);
    }
   
View Full Code Here

     
      boolean validCombination = true;
     
      // check whether the broadcast inputs use the same plan candidate at the branching point
      for (int i = 0; i < broadcastChannelsCombination.size(); i++) {
        NamedChannel nc = broadcastChannelsCombination.get(i);
        PlanNode bcSource = nc.getSource();
       
        if (!(areBranchCompatible(bcSource, inputSource1) || areBranchCompatible(bcSource, inputSource2))) {
          validCombination = false;
          break;
        }
View Full Code Here

TOP

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

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.