Package org.apache.flink.compiler

Examples of org.apache.flink.compiler.CompilerException


  @Override
  public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
    boolean[] inputOrders = in1.getLocalProperties().getOrdering().getFieldSortDirections();
   
    if (inputOrders == null || inputOrders.length < this.keys1.size()) {
      throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a merge operator.");
    } else if (inputOrders.length > this.keys1.size()) {
      boolean[] tmp = new boolean[this.keys1.size()];
      System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
      inputOrders = tmp;
    }
View Full Code Here


  @Override
  public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) {
    boolean[] inputOrders = in2.getLocalProperties().getOrdering() == null ? null : in2.getLocalProperties().getOrdering().getFieldSortDirections();

    if (inputOrders == null || inputOrders.length < this.keys2.size()) {
      throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator.");
    } else if (inputOrders.length > this.keys2.size()) {
      boolean[] tmp = new boolean[this.keys2.size()];
      System.arraycopy(inputOrders, 0, tmp, 0, tmp.length);
      inputOrders = tmp;
    }
View Full Code Here

        break;
      case FORWARD:
        this.localProps = this.source.getLocalProperties();
        break;
      case NONE:
        throw new CompilerException("ShipStrategy has not yet been set.");
      default:
        throw new CompilerException("Unknown ShipStrategy.");
    }
  }
View Full Code Here

    }
   
    // some strategies globally reestablish properties
    switch (this.shipStrategy) {
    case FORWARD:
      throw new CompilerException("Cannot use FORWARD strategy between operations " +
          "with different number of parallel instances.");
    case NONE: // excluded by sanity check. left here for verification check completion
    case BROADCAST:
    case PARTITION_HASH:
    case PARTITION_RANGE:
    case PARTITION_RANDOM:
    case PARTITION_FORCED_REBALANCE:
      return;
    }
    throw new CompilerException("Unrecognized Ship Strategy Type: " + this.shipStrategy);
  }
View Full Code Here

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

            break;
          case PARTITION_FORCED_REBALANCE:
            shipStrategy = "Rebalance";
            break;
          default:
            throw new CompilerException("Unknown ship strategy '" + inConn.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() :
View Full Code Here

            .branchPlan != null){
          selectedCandidate = getNextWorkSetPlanNode().branchPlan.get(brancher);
        }

        if (selectedCandidate == null) {
          throw new CompilerException(
              "Candidates for a node with open branches are missing information about the selected candidate ");
        }

        this.branchPlan.put(brancher, selectedCandidate);
      }
View Full Code Here

        break;
      case RANGE_PARTITIONED:
        channel.setShipStrategy(ShipStrategyType.PARTITION_RANGE, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections());
        break;
      default:
        throw new CompilerException();
    }
  }
View Full Code Here

     
      Costs parentCosts = pred.getCumulativeCostsShare();
      if (parentCosts != null) {
        this.cumulativeCosts.addCosts(parentCosts);
      } else {
        throw new CompilerException("Trying to set the costs of an operator before the predecessor costs are computed.");
      }
    }
   
    // add all broadcast variable inputs
    if (this.broadcastInputs != null) {
      for (NamedChannel nc : this.broadcastInputs) {
        Costs bcInputCost = nc.getSource().getCumulativeCostsShare();
        if (bcInputCost != null) {
          this.cumulativeCosts.addCosts(bcInputCost);
        } else {
          throw new CompilerException("Trying to set the costs of an operator before the broadcast input costs are computed.");
        }
      }
    }
  }
View Full Code Here

    }
   
    // do a sanity check that if we are branching, we have now candidates for each branch point
    if (this.template.hasUnclosedBranches()) {
      if (this.branchPlan == null) {
        throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point.");
      }
 
      for (UnclosedBranchDescriptor uc : this.template.getOpenBranches()) {
        OptimizerNode brancher = uc.getBranchingNode();
        if (this.branchPlan.get(brancher) == null) {
          throw new CompilerException("Branching and rejoining logic did not find a candidate for the branching point.");
        }
      }
    }
  }
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.