Package eu.stratosphere.compiler

Examples of eu.stratosphere.compiler.CompilerException


              break;
            case PARTITION_RANDOM:
              shipStrategy = "Redistribute";
              break;
            default:
              throw new CompilerException("Unknown ship strategy '" + conn.getShipStrategy().name()
                + "' in JSON generator.");
            }
          }
         
          if (channel != null && channel.getShipStrategyKeys() != null && channel.getShipStrategyKeys().size() > 0) {
            shipStrategy += " on " + (channel.getShipStrategySortOrder() == null ?
                channel.getShipStrategyKeys().toString() :
                Utils.createOrdering(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()).toString());
          }
 
          if (shipStrategy != null) {
            writer.print(", \"ship_strategy\": \"" + shipStrategy + "\"");
          }
         
          if (channel != null) {
            String localStrategy = null;
            switch (channel.getLocalStrategy()) {
            case NONE:
              break;
            case SORT:
              localStrategy = "Sort";
              break;
            case COMBININGSORT:
              localStrategy = "Sort (combining)";
              break;
            default:
              throw new CompilerException("Unknown local strategy " + channel.getLocalStrategy().name());
            }
           
            if (channel != null && channel.getLocalStrategyKeys() != null && channel.getLocalStrategyKeys().size() > 0) {
              localStrategy += " on " + (channel.getLocalStrategySortOrder() == null ?
                  channel.getLocalStrategyKeys().toString() :
                  Utils.createOrdering(channel.getLocalStrategyKeys(), channel.getLocalStrategySortOrder()).toString());
            }
           
            if (localStrategy != null) {
              writer.print(", \"local_strategy\": \"" + localStrategy + "\"");
            }
           
            if (channel != null && channel.getTempMode() != TempMode.NONE) {
              String tempMode = channel.getTempMode().toString();
              writer.print(", \"temp_mode\": \"" + tempMode + "\"");
            }
          }
         
          writer.print('}');
          connNum++;
        }
        inputNum++;
      }
      // finish predecessors
      writer.print("\n\t\t]");
    }
   
    //---------------------------------------------------------------------------------------
    // the part below here is relevant only to plan nodes with concrete strategies, etc
    //---------------------------------------------------------------------------------------

    final PlanNode p = node.getPlanNode();
    if (p == null) {
      // finish node
      writer.print("\n\t}");
      return;
    }
    // local strategy
    String locString = null;
    if (p.getDriverStrategy() != null) {
      switch (p.getDriverStrategy()) {
      case NONE:
      case BINARY_NO_OP:
        break;
       
      case UNARY_NO_OP:
        locString = "No-Op";
        break;
       
      case COLLECTOR_MAP:
      case MAP:
      case FLAT_MAP:
        locString = "Map";
        break;
     
      case ALL_REDUCE:
        locString = "Reduce All";
        break;
     
      case ALL_GROUP_REDUCE:
      case ALL_GROUP_COMBINE:
        locString = "Group Reduce All";
        break;
       
      case SORTED_REDUCE:
        locString = "Sorted Reduce";
        break;
       
      case SORTED_PARTIAL_REDUCE:
        locString = "Sorted Combine/Reduce";
        break;

      case SORTED_GROUP_REDUCE:
        locString = "Sorted Group Reduce";
        break;
       
      case SORTED_GROUP_COMBINE:
        locString = "Sorted Combine";
        break;

      case HYBRIDHASH_BUILD_FIRST:
        locString = "Hybrid Hash (build: " + child1name + ")";
        break;
      case HYBRIDHASH_BUILD_SECOND:
        locString = "Hybrid Hash (build: " + child2name + ")";
        break;

      case NESTEDLOOP_BLOCKED_OUTER_FIRST:
        locString = "Nested Loops (Blocked Outer: " + child1name + ")";
        break;
      case NESTEDLOOP_BLOCKED_OUTER_SECOND:
        locString = "Nested Loops (Blocked Outer: " + child2name + ")";
        break;
      case NESTEDLOOP_STREAMED_OUTER_FIRST:
        locString = "Nested Loops (Streamed Outer: " + child1name + ")";
        break;
      case NESTEDLOOP_STREAMED_OUTER_SECOND:
        locString = "Nested Loops (Streamed Outer: " + child2name + ")";
        break;

      case MERGE:
        locString = "Merge";
        break;

      case CO_GROUP:
        locString = "Co-Group";
        break;

      default:
        throw new CompilerException("Unknown local strategy '" + p.getDriverStrategy().name()
          + "' in JSON generator.");
      }

      if (locString != null) {
        writer.print(",\n\t\t\"driver_strategy\": \"");
View Full Code Here


    }
    else if (node instanceof BulkIterationPlanNode) {
      BulkIterationPlanNode iterationNode = (BulkIterationPlanNode) node;

      if (iterationNode.getRootOfStepFunction() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile an iteration step function where next partial solution is created by a Union node.");
      }
     
      // traverse the termination criterion for the first time. create schema only, no utilities. Needed in case of intermediate termination criterion
      if (iterationNode.getRootOfTerminationCriterion() != null) {
        SingleInputPlanNode addMapper = (SingleInputPlanNode) iterationNode.getRootOfTerminationCriterion();
        traverseChannel(addMapper.getInput());
      }

      BulkIterationBase<?> operator = (BulkIterationBase<?>) iterationNode.getPactContract();

      // set the serializer
      iterationNode.setSerializerForIterationChannel(createSerializer(operator.getOperatorInfo().getOutputType()));

      // done, we can now propagate our info down
      traverseChannel(iterationNode.getInput());
      traverse(iterationNode.getRootOfStepFunction());
    }
    else if (node instanceof WorksetIterationPlanNode) {
      WorksetIterationPlanNode iterationNode = (WorksetIterationPlanNode) node;
     
      if (iterationNode.getNextWorkSetPlanNode() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile a workset iteration step function where the next workset is produced by a Union node.");
      }
      if (iterationNode.getSolutionSetDeltaPlanNode() instanceof NAryUnionPlanNode) {
        throw new CompilerException("Optimizer cannot compile a workset iteration step function where the solution set delta is produced by a Union node.");
      }
     
      DeltaIterationBase<?, ?> operator = (DeltaIterationBase<?, ?>) iterationNode.getPactContract();
     
      // set the serializers and comparators for the workset iteration
View Full Code Here

  public void addOutgoingConnection(PactConnection pactConnection) {
    if (this.outgoingConnections == null) {
      this.outgoingConnections = new ArrayList<PactConnection>();
    } else {
      if (this.outgoingConnections.size() == 64) {
        throw new CompilerException("Cannot currently handle nodes with more than 64 outputs.");
      }
    }

    this.outgoingConnections.add(pactConnection);
  }
View Full Code Here

   */
  public void computeOutputEstimates(DataStatistics statistics) {
    // sanity checking
    for (PactConnection c : getIncomingConnections()) {
      if (c.getSource() == null) {
        throw new CompilerException("Bug: Estimate computation called before inputs have been set.");
      }
    }
   
    // let every operator do its computation
    computeOperatorSpecificDefaultEstimates(statistics);
View Full Code Here

  //                                    Pruning
  // --------------------------------------------------------------------------------------------
 
  protected void prunePlanAlternatives(List<PlanNode> plans) {
    if (plans.isEmpty()) {
      throw new CompilerException("No plan meeting the requirements could be created @ " + this + ". Most likely reason: Too restrictive plan hints.");
    }
    // shortcut for the simple case
    if (plans.size() == 1) {
      return;
    }
View Full Code Here

        if (this.outgoingConnections.get(num) == toParent) {
          break;
        }
      }
      if (num >= this.outgoingConnections.size()) {
        throw new CompilerException("Error in compiler: "
          + "Parent to get branch info for is not contained in the outgoing connections.");
      }

      // create the description and add it
      long bitvector = 0x1L << num;
      branches.add(new UnclosedBranchDescriptor(this, bitvector));
      return branches;
    }
    else {
      throw new CompilerException(
        "Error in compiler: Cannot get branch info for successor in a node with no successors.");
    }
  }
View Full Code Here

      } else if (shipStrategy.equalsIgnoreCase(PactCompiler.HINT_SHIP_STRATEGY_FORWARD)) {
        preSet = ShipStrategyType.FORWARD;
      } else if (shipStrategy.equalsIgnoreCase(PactCompiler.HINT_SHIP_STRATEGY_REPARTITION)) {
        preSet = ShipStrategyType.PARTITION_RANDOM;
      } else {
        throw new CompilerException("Unrecognized ship strategy hint: " + shipStrategy);
      }
    } else {
      preSet = null;
    }
   
    // get the predecessor node
    Operator<?> children = ((SingleInputOperator<?, ?, ?>) getPactContract()).getInput();
   
    OptimizerNode pred;
    PactConnection conn;
    if (children == null) {
      throw new CompilerException("Error: Node for '" + getPactContract().getName() + "' has no input.");
    } else {
      pred = contractToNode.get(children);
      conn = new PactConnection(pred, this);
      if (preSet != null) {
        conn.setShipStrategy(preSet);
View Full Code Here

  public void accept(Visitor<OptimizerNode> visitor) {
    if (visitor.preVisit(this)) {
      if (getPredecessorNode() != null) {
        getPredecessorNode().accept(visitor);
      } else {
        throw new CompilerException();
      }
      for (PactConnection connection : getBroadcastConnections()) {
        connection.getSource().accept(visitor);
      }
      visitor.postVisit(this);
View Full Code Here

  @Override
  public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
    if (node instanceof SinkJoiner) {
      return new SinkJoinerPlanNode((SinkJoiner) node, in1, in2);
    } else {
      throw new CompilerException();
    }
  }
View Full Code Here

                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.");
            }
          }
         
          instantiate(operator, c1, c2, broadcastPlanChannels, outputPlans, estimator, igps, igps, noLocalProps, noLocalProps);
        }
View Full Code Here

TOP

Related Classes of eu.stratosphere.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.