Package org.apache.flink.compiler

Examples of org.apache.flink.compiler.CompilerException


    DriverStrategy strategy;
   
    if(!in1.isOnDynamicPath() && in2.isOnDynamicPath()) {
      // sanity check that the first input is cached and remove that cache
      if (!in1.getTempMode().isCached()) {
        throw new CompilerException("No cache at point where static and dynamic parts meet.");
      }
      in1.setTempMode(in1.getTempMode().makeNonCached());
      strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST_CACHED;
    }
    else {
View Full Code Here


  public WorksetIterationNode(DeltaIterationBase<?, ?> iteration) {
    super(iteration);
   
    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);
   
View Full Code Here

      GlobalProperties gp = candidate.getGlobalProperties();
     
      if (gp.getPartitioning() != PartitioningProperty.HASH_PARTITIONED || gp.getPartitioningFields() == null ||
          !gp.getPartitioningFields().equals(this.solutionSetKeyFields))
      {
        throw new CompilerException("Bug: The solution set delta is not partitioned.");
      }
    }
   
    // 5) Create a candidate for the Iteration Node for every remaining plan of the step function.
   
    final GlobalProperties gp = new GlobalProperties();
    gp.setHashPartitioned(this.solutionSetKeyFields);
    gp.addUniqueFieldCombination(this.solutionSetKeyFields);
   
    LocalProperties lp = LocalProperties.EMPTY.addUniqueFields(this.solutionSetKeyFields);
   
    // take all combinations of solution set delta and workset plans
    for (PlanNode solutionSetCandidate : solutionSetDeltaCandidates) {
      for (PlanNode worksetCandidate : worksetCandidates) {
        // check whether they have the same operator at their latest branching point
        if (this.singleRoot.areBranchCompatible(solutionSetCandidate, worksetCandidate)) {
         
          SingleInputPlanNode siSolutionDeltaCandidate = (SingleInputPlanNode) solutionSetCandidate;
          boolean immediateDeltaUpdate;
         
          // check whether we need a dedicated solution set delta operator, or whether we can update on the fly
          if (siSolutionDeltaCandidate.getInput().getShipStrategy() == ShipStrategyType.FORWARD && this.solutionDeltaImmediatelyAfterSolutionJoin) {
            // we do not need this extra node. we can make the predecessor the delta
            // sanity check the node and connection
            if (siSolutionDeltaCandidate.getDriverStrategy() != DriverStrategy.UNARY_NO_OP || siSolutionDeltaCandidate.getInput().getLocalStrategy() != LocalStrategy.NONE) {
              throw new CompilerException("Invalid Solution set delta node.");
            }
           
            solutionSetCandidate = siSolutionDeltaCandidate.getInput().getSource();
            immediateDeltaUpdate = true;
          } else {
View Full Code Here

    List<UnclosedBranchDescriptor> pred2branches = getSecondPredecessorNode().openBranches;
   
    // if the predecessors do not have branches, then we have multiple sinks that do not originate from
    // a common data flow.
    if (pred1branches == null || pred1branches.isEmpty() || pred2branches == null || pred2branches.isEmpty()) {
      throw new CompilerException("The given program contains multiple disconnected data flows.");
    }
   
    // copy the lists and merge
    List<UnclosedBranchDescriptor> result1 = new ArrayList<UnclosedBranchDescriptor>(pred1branches);
    List<UnclosedBranchDescriptor> result2 = new ArrayList<UnclosedBranchDescriptor>(pred2branches);
View Full Code Here

    this.keys2 = k2 == null || k2.length == 0 ? null : new FieldList(k2);
   
    if (this.keys1 != null) {
      if (this.keys2 != null) {
        if (this.keys1.size() != this.keys2.size()) {
          throw new CompilerException("Unequal number of key fields on the two inputs.");
        }
      } else {
        throw new CompilerException("Keys are set on first input, but not on second.");
      }
    } else if (this.keys2 != null) {
      throw new CompilerException("Keys are set on second input, but not on first.");
    }
  }
View Full Code Here

      } else if (PactCompiler.HINT_SHIP_STRATEGY_REPARTITION_RANGE.equals(shipStrategy)) {
        preSet1 = preSet2 = ShipStrategyType.PARTITION_RANGE;
      } else if (shipStrategy.equalsIgnoreCase(PactCompiler.HINT_SHIP_STRATEGY_REPARTITION)) {
        preSet1 = preSet2 = ShipStrategyType.PARTITION_RANDOM;
      } else {
        throw new CompilerException("Unknown hint for shipping strategy: " + shipStrategy);
      }
    }

    // see if there is a hint that dictates which shipping strategy to use for the FIRST input
    shipStrategy = conf.getString(PactCompiler.HINT_SHIP_STRATEGY_FIRST_INPUT, null);
    if (shipStrategy != null) {
      if (PactCompiler.HINT_SHIP_STRATEGY_FORWARD.equals(shipStrategy)) {
        preSet1 = ShipStrategyType.FORWARD;
      } else if (PactCompiler.HINT_SHIP_STRATEGY_BROADCAST.equals(shipStrategy)) {
        preSet1 = ShipStrategyType.BROADCAST;
      } else if (PactCompiler.HINT_SHIP_STRATEGY_REPARTITION_HASH.equals(shipStrategy)) {
        preSet1 = ShipStrategyType.PARTITION_HASH;
      } else if (PactCompiler.HINT_SHIP_STRATEGY_REPARTITION_RANGE.equals(shipStrategy)) {
        preSet1 = ShipStrategyType.PARTITION_RANGE;
      } else if (shipStrategy.equalsIgnoreCase(PactCompiler.HINT_SHIP_STRATEGY_REPARTITION)) {
        preSet1 = ShipStrategyType.PARTITION_RANDOM;
      } else {
        throw new CompilerException("Unknown hint for shipping strategy of input one: " + shipStrategy);
      }
    }

    // see if there is a hint that dictates which shipping strategy to use for the SECOND input
    shipStrategy = conf.getString(PactCompiler.HINT_SHIP_STRATEGY_SECOND_INPUT, null);
    if (shipStrategy != null) {
      if (PactCompiler.HINT_SHIP_STRATEGY_FORWARD.equals(shipStrategy)) {
        preSet2 = ShipStrategyType.FORWARD;
      } else if (PactCompiler.HINT_SHIP_STRATEGY_BROADCAST.equals(shipStrategy)) {
        preSet2 = ShipStrategyType.BROADCAST;
      } else if (PactCompiler.HINT_SHIP_STRATEGY_REPARTITION_HASH.equals(shipStrategy)) {
        preSet2 = ShipStrategyType.PARTITION_HASH;
      } else if (PactCompiler.HINT_SHIP_STRATEGY_REPARTITION_RANGE.equals(shipStrategy)) {
        preSet2 = ShipStrategyType.PARTITION_RANGE;
      } else if (shipStrategy.equalsIgnoreCase(PactCompiler.HINT_SHIP_STRATEGY_REPARTITION)) {
        preSet2 = ShipStrategyType.PARTITION_RANDOM;
      } else {
        throw new CompilerException("Unknown hint for shipping strategy of input two: " + shipStrategy);
      }
    }
   
    // get the predecessors
    DualInputOperator<?, ?, ?, ?> contr = (DualInputOperator<?, ?, ?, ?>) getPactContract();
   
    Operator<?> leftPred = contr.getFirstInput();
    Operator<?> rightPred = contr.getSecondInput();
   
    OptimizerNode pred1;
    PactConnection conn1;
    if (leftPred == null) {
      throw new CompilerException("Error: Node for '" + getPactContract().getName() + "' has no input set for first input.");
    } else {
      pred1 = contractToNode.get(leftPred);
      conn1 = new PactConnection(pred1, this);
      if (preSet1 != null) {
        conn1.setShipStrategy(preSet1);
      }
    }
   
    // create the connection and add it
    this.input1 = conn1;
    pred1.addOutgoingConnection(conn1);
   
    OptimizerNode pred2;
    PactConnection conn2;
    if (rightPred == null) {
      throw new CompilerException("Error: Node for '" + getPactContract().getName() + "' has no input set for second input.");
    } else {
      pred2 = contractToNode.get(rightPred);
      conn2 = new PactConnection(pred2, this);
      if (preSet2 != null) {
        conn2.setShipStrategy(preSet2);
View Full Code Here

            continue;
          }
         
          SourceAndDamReport res = in1.getSource().hasDamOnPathDownTo(candAtBrancher);
          if (res == NOT_FOUND) {
            throw new CompilerException("Bug: Tracing dams for deadlock detection is broken.");
          } else if (res == FOUND_SOURCE) {
            damOnAllLeftPaths = false;
          } else if (res == FOUND_SOURCE_AND_DAM) {
            someDamOnLeftPaths = true;
          } else {
            throw new CompilerException();
          }
        }
      }
     
      if (strategy.secondDam() == DamBehavior.FULL_DAM || in2.getLocalStrategy().dams() || in2.getTempMode().breaksPipeline()) {
        someDamOnRightPaths = true;
      } else {
        for (OptimizerNode brancher : this.hereJoinedBranches) {
          PlanNode candAtBrancher = in2.getSource().getCandidateAtBranchPoint(brancher);
         
          // not all candidates are found, because this list includes joined branched from both regular inputs and broadcast vars
          if (candAtBrancher == null) {
            continue;
          }
         
          SourceAndDamReport res = in2.getSource().hasDamOnPathDownTo(candAtBrancher);
          if (res == NOT_FOUND) {
            throw new CompilerException("Bug: Tracing dams for deadlock detection is broken.");
          } else if (res == FOUND_SOURCE) {
            damOnAllRightPaths = false;
          } else if (res == FOUND_SOURCE_AND_DAM) {
            someDamOnRightPaths = true;
          } else {
            throw new CompilerException();
          }
        }
      }
     
      // okay combinations are both all dam or both no dam
View Full Code Here

 
  @Override
  public void accept(Visitor<OptimizerNode> visitor) {
    if (visitor.preVisit(this)) {
      if (this.input1 == null || this.input2 == null) {
        throw new CompilerException();
      }
     
      getFirstPredecessorNode().accept(visitor);
      getSecondPredecessorNode().accept(visitor);
     
View Full Code Here

    DriverStrategy strategy;
   
    if (!in2.isOnDynamicPath() && in1.isOnDynamicPath()) {
      // sanity check that the first input is cached and remove that cache
      if (!in2.getTempMode().isCached()) {
        throw new CompilerException("No cache at point where static and dynamic parts meet.");
      }
     
      in2.setTempMode(in2.getTempMode().makeNonCached());
      strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED;
    }
View Full Code Here

    Ordering prod2 = produced2.getOrdering();
   
    if (prod1 == null || prod2 == null || prod1.getNumberOfFields() < numRelevantFields ||
        prod2.getNumberOfFields() < prod2.getNumberOfFields())
    {
      throw new CompilerException("The given properties do not meet this operators requirements.");
    }
     
    for (int i = 0; i < numRelevantFields; i++) {
      if (prod1.getOrder(i) != prod2.getOrder(i)) {
        return false;
View Full Code Here

TOP

Related Classes of org.apache.flink.compiler.CompilerException

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.