Package org.apache.flink.api.common

Examples of org.apache.flink.api.common.InvalidProgramException


   * @see Order
   */
  public SortedGrouping<T> sortGroup(int field, Order order) {
   
    if (!dataSet.getType().isTupleType()) {
      throw new InvalidProgramException("Specifying order keys via field positions is only valid for tuple data types");
    }
    if (field >= dataSet.getType().getArity()) {
      throw new IllegalArgumentException("Order key out of tuple bounds.");
    }
    ExpressionKeys<T> ek = new ExpressionKeys<T>(new int[]{field}, dataSet.getType());
View Full Code Here


   * @see Order
   */
  public SortedGrouping<T> sortGroup(String field, Order order) {
   
    if (! (dataSet.getType() instanceof CompositeType)) {
      throw new InvalidProgramException("Specifying order keys via field positions is only valid for composite data types (pojo / tuple / case class)");
    }
    ExpressionKeys<T> ek = new ExpressionKeys<T>(new String[]{field}, dataSet.getType());
    addSortGroupInternal(ek, order);
    return this;
  }
View Full Code Here

   * is in fact a tuple type.
   */
  @Override
  public void setInputType(TypeInformation<?> type) {
    if (!type.isTupleType()) {
      throw new InvalidProgramException("The " + ScalaCsvOutputFormat.class.getSimpleName() +
        " can only be used to write tuple data sets.");
    }
  }
View Full Code Here

    super(Validate.notNull(input), input.getType());

    Validate.notNull(function);

    if (!input.getType().isTupleType()) {
      throw new InvalidProgramException("Aggregating on field positions is only possible on tuple data types.");
    }

    TupleTypeInfoBase<?> inType = (TupleTypeInfoBase<?>) input.getType();

    if (field < 0 || field >= inType.getArity()) {
View Full Code Here

    super(Validate.notNull(input).getDataSet(), input.getDataSet().getType());

    Validate.notNull(function);

    if (!input.getDataSet().getType().isTupleType()) {
      throw new InvalidProgramException("Aggregating on field positions is only possible on tuple data types.");
    }

    TupleTypeInfoBase<?> inType = (TupleTypeInfoBase<?>) input.getDataSet().getType();

    if (field < 0 || field >= inType.getArity()) {
View Full Code Here

  // --------------------------------------------------------------------------------------------
 
  private <IN> void executeDataSink(GenericDataSinkBase<?> sink) throws Exception {
    Operator<?> inputOp = sink.getInput();
    if (inputOp == null) {
      throw new InvalidProgramException("The data sink " + sink.getName() + " has no input.");
    }
   
    @SuppressWarnings("unchecked")
    List<IN> input = (List<IN>) execute(inputOp);
   
View Full Code Here

  }
 
  private <IN, OUT> List<OUT> executeUnaryOperator(SingleInputOperator<?, ?, ?> operator, int superStep) throws Exception {
    Operator<?> inputOp = operator.getInput();
    if (inputOp == null) {
      throw new InvalidProgramException("The unary operation " + operator.getName() + " has no input.");
    }
   
    @SuppressWarnings("unchecked")
    List<IN> inputData = (List<IN>) execute(inputOp, superStep);
   
View Full Code Here

  private <IN1, IN2, OUT> List<OUT> executeBinaryOperator(DualInputOperator<?, ?, ?, ?> operator, int superStep) throws Exception {
    Operator<?> inputOp1 = operator.getFirstInput();
    Operator<?> inputOp2 = operator.getSecondInput();
   
    if (inputOp1 == null) {
      throw new InvalidProgramException("The binary operation " + operator.getName() + " has no first input.");
    }
    if (inputOp2 == null) {
      throw new InvalidProgramException("The binary operation " + operator.getName() + " has no second input.");
    }
   
    // compute inputs
    @SuppressWarnings("unchecked")
    List<IN1> inputData1 = (List<IN1>) execute(inputOp1, superStep);
View Full Code Here

 
  @SuppressWarnings("unchecked")
  private <T> List<T> executeBulkIteration(BulkIterationBase<?> iteration) throws Exception {
    Operator<?> inputOp = iteration.getInput();
    if (inputOp == null) {
      throw new InvalidProgramException("The iteration " + iteration.getName() + " has no input (initial partial solution).");
    }
    if (iteration.getNextPartialSolution() == null) {
      throw new InvalidProgramException("The iteration " + iteration.getName() + " has no next partial solution defined (is not closed).");
    }
   
    List<T> inputData = (List<T>) execute(inputOp);
   
    // get the operators that are iterative
View Full Code Here

  @SuppressWarnings("unchecked")
  private <T> List<T> executeDeltaIteration(DeltaIterationBase<?, ?> iteration) throws Exception {
    Operator<?> solutionInput = iteration.getInitialSolutionSet();
    Operator<?> worksetInput = iteration.getInitialWorkset();
    if (solutionInput == null) {
      throw new InvalidProgramException("The delta iteration " + iteration.getName() + " has no initial solution set.");
    }
    if (worksetInput == null) {
      throw new InvalidProgramException("The delta iteration " + iteration.getName() + " has no initial workset.");
    }
    if (iteration.getSolutionSetDelta() == null) {
      throw new InvalidProgramException("The iteration " + iteration.getName() + " has no solution set delta defined (is not closed).");
    }
    if (iteration.getNextWorkset() == null) {
      throw new InvalidProgramException("The iteration " + iteration.getName() + " has no workset defined (is not closed).");
    }


    List<T> solutionInputData = (List<T>) execute(solutionInput);
    List<T> worksetInputData = (List<T>) execute(worksetInput);
View Full Code Here

TOP

Related Classes of org.apache.flink.api.common.InvalidProgramException

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.