Package eu.stratosphere.compiler.dataproperties

Examples of eu.stratosphere.compiler.dataproperties.GlobalProperties


   * @param template The template optimizer node that this candidate is created for.
   */
  public SourcePlanNode(DataSourceNode template, String nodeName) {
    super(template, nodeName, DriverStrategy.NONE);
   
    this.globalProps = new GlobalProperties();
    this.localProps = new LocalProperties();
    updatePropertiesWithUniqueSets(template.getUniqueFields());
  }
View Full Code Here


   
    // 5) Create a candidate for the Iteration Node for every remaining plan of the step function.
    if (terminationCriterion == null) {
      for (PlanNode candidate : candidates) {
        BulkIterationPlanNode node = new BulkIterationPlanNode(this, "BulkIteration ("+this.getPactContract().getName()+")", in, pspn, candidate);
        GlobalProperties gProps = candidate.getGlobalProperties().clone();
        LocalProperties lProps = candidate.getLocalProperties().clone();
        node.initProperties(gProps, lProps);
        target.add(node);
      }
    }
    else if(candidates.size() > 0) {
      List<PlanNode> terminationCriterionCandidates = this.terminationCriterion.getAlternativePlans(estimator);

      SingleRootJoiner singleRoot = (SingleRootJoiner) this.singleRoot;
     
      for (PlanNode candidate : candidates) {
        for(PlanNode terminationCandidate : terminationCriterionCandidates) {
          if (singleRoot.areBranchCompatible(candidate, terminationCandidate)) {
            BulkIterationPlanNode node = new BulkIterationPlanNode(this, "BulkIteration ("+this.getPactContract().getName()+")", in, pspn, candidate, terminationCandidate);
            GlobalProperties gProps = candidate.getGlobalProperties().clone();
            LocalProperties lProps = candidate.getLocalProperties().clone();
            node.initProperties(gProps, lProps);
            target.add(node);
           
          }
View Full Code Here

      }
    }
   
    {
      // output node global properties
      final GlobalProperties gp = p.getGlobalProperties();

      writer.print(",\n\t\t\"global_properties\": [\n");

      addProperty(writer, "Partitioning", gp.getPartitioning().name(), true);
      if (gp.getPartitioningFields() != null) {
        addProperty(writer, "Partitioned on", gp.getPartitioningFields().toString(), false);
      }
      if (gp.getPartitioningOrdering() != null) {
        addProperty(writer, "Partitioning Order", gp.getPartitioningOrdering().toString(), false)
      }
      else {
        addProperty(writer, "Partitioning Order", "(none)", false);
      }
      if (n.getUniqueFields() == null || n.getUniqueFields().size() == 0) {
View Full Code Here

     
      final SingleInputPlanNode node = dps.instantiate(in, this);
      node.setBroadcastInputs(broadcastChannelsCombination);
     
      // compute how the strategy affects the properties
      GlobalProperties gProps = in.getGlobalProperties().clone();
      LocalProperties lProps = in.getLocalProperties().clone();
      gProps = dps.computeGlobalProperties(gProps);
      lProps = dps.computeLocalProperties(lProps);
     
      // filter by the user code field copies
      gProps = gProps.filterByNodesConstantSet(this, 0);
      lProps = lProps.filterByNodesConstantSet(this, 0);
     
      // apply
      node.initProperties(gProps, lProps);
      node.updatePropertiesWithUniqueSets(getUniqueFields());
View Full Code Here

              c2.adjustGlobalPropertiesForLocalParallelismChange();
            }
          }
         
          // get the global properties and clear unique fields (not preserved anyways during the union)
          GlobalProperties p1 = c1.getGlobalProperties();
          GlobalProperties p2 = c2.getGlobalProperties();
          p1.clearUniqueFieldCombinations();
          p2.clearUniqueFieldCombinations();
         
          // adjust the partitionings, if they exist but are not equal. this may happen when both channels have a
          // partitioning that fulfills the requirements, but both are incompatible. For example may a property requirement
          // be ANY_PARTITIONING on fields (0) and one channel is range partitioned on that field, the other is hash
          // partitioned on that field.
          if (!igps.isTrivial() && !(p1.equals(p2))) {
            if (c1.getShipStrategy() == ShipStrategyType.FORWARD && c2.getShipStrategy() != ShipStrategyType.FORWARD) {
              // adjust c2 to c1
              c2 = c2.clone();
              p1.parameterizeChannel(c2,globalDopChange2);
            } else if (c2.getShipStrategy() == ShipStrategyType.FORWARD && c1.getShipStrategy() != ShipStrategyType.FORWARD) {
              // adjust c1 to c2
              c1 = c1.clone();
              p2.parameterizeChannel(c1,globalDopChange1);
            } else if (c1.getShipStrategy() == ShipStrategyType.FORWARD && c2.getShipStrategy() == ShipStrategyType.FORWARD) {
              boolean adjustC1 = c1.getEstimatedOutputSize() <= 0 || c2.getEstimatedOutputSize() <= 0 ||
                  c1.getEstimatedOutputSize() <= c2.getEstimatedOutputSize();
              if (adjustC1) {
                c2 = c2.clone();
                p1.parameterizeChannel(c2, globalDopChange2);
              } else {
                c1 = c1.clone();
                p2.parameterizeChannel(c1, globalDopChange1);
              }
            } else {
              // this should never happen, as it implies both realize a different strategy, which is
              // excluded by the check that the required strategies must match
              throw new CompilerException("Bug in Plan Enumeration for Union Node.");
View Full Code Here

    return Collections.singletonList(new RequestedLocalProperties());
  }
 
  @Override
  public GlobalProperties computeGlobalProperties(GlobalProperties gProps) {
    return new GlobalProperties();
  }
View Full Code Here

      placePipelineBreakersIfNecessary(operator.getStrategy(), in1, in2);
     
      DualInputPlanNode node = operator.instantiate(in1, in2, this);
      node.setBroadcastInputs(broadcastChannelsCombination);
     
      GlobalProperties gp1 = in1.getGlobalProperties().clone().filterByNodesConstantSet(this, 0);
      GlobalProperties gp2 = in2.getGlobalProperties().clone().filterByNodesConstantSet(this, 1);
      GlobalProperties combined = operator.computeGlobalProperties(gp1, gp2);

      LocalProperties lp1 = in1.getLocalProperties().clone().filterByNodesConstantSet(this, 0);
      LocalProperties lp2 = in2.getLocalProperties().clone().filterByNodesConstantSet(this, 1);
      LocalProperties locals = operator.computeLocalProperties(lp1, lp2);
     
View Full Code Here

    return new BinaryUnionPlanNode((BinaryUnionNode) node, in1, in2);
  }

  @Override
  public GlobalProperties computeGlobalProperties(GlobalProperties in1, GlobalProperties in2) {
    GlobalProperties newProps = new GlobalProperties();
   
    if (in1.getPartitioning() == PartitioningProperty.HASH_PARTITIONED &&
      in2.getPartitioning() == PartitioningProperty.HASH_PARTITIONED &&
      in1.getPartitioningFields().equals(in2.getPartitioningFields()))
    {
      newProps.setHashPartitioned(in1.getPartitioningFields());
    }
   
    return newProps;
  }
View Full Code Here

    return new DualInputPlanNode(node, "CoGroup ("+node.getPactContract().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders);
  }
 
  @Override
  public GlobalProperties computeGlobalProperties(GlobalProperties in1, GlobalProperties in2) {
    GlobalProperties gp = GlobalProperties.combine(in1, in2);
    if (gp.getUniqueFieldCombination() != null && gp.getUniqueFieldCombination().size() > 0 &&
          gp.getPartitioning() == PartitioningProperty.RANDOM)
    {
      gp.setAnyPartitioning(gp.getUniqueFieldCombination().iterator().next().toFieldList());
    }
    gp.clearUniqueFieldCombinations();
    return gp;
  }
View Full Code Here

    final int[] ssKeys = iteration.getSolutionSetKeyFields();
    if (ssKeys == null || ssKeys.length == 0) {
      throw new CompilerException("Invalid WorksetIteration: No key fields defined for the solution set.");
    }
    this.solutionSetKeyFields = new FieldList(ssKeys);
    this.partitionedProperties = new GlobalProperties();
    this.partitionedProperties.setHashPartitioned(this.solutionSetKeyFields);
   
    int weight = iteration.getMaximumNumberOfIterations() > 0 ?
      iteration.getMaximumNumberOfIterations() : DEFAULT_COST_WEIGHT;
     
View Full Code Here

TOP

Related Classes of eu.stratosphere.compiler.dataproperties.GlobalProperties

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.