Package org.apache.flink.api.common

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


  @SuppressWarnings({ "unchecked", "rawtypes" })
  public ReduceOperator<T> minBy(int... fields)  {
   
    // Check for using a tuple
    if(!this.type.isTupleType()) {
      throw new InvalidProgramException("Method minBy(int) only works on tuples.");
    }
     
    return new ReduceOperator<T>(this, new SelectByMinFunction(
        (TupleTypeInfo) this.type, fields));
  }
View Full Code Here


  @SuppressWarnings({ "unchecked", "rawtypes" })
  public ReduceOperator<T> maxBy(int... fields)  {
   
    // Check for using a tuple
    if(!this.type.isTupleType()) {
      throw new InvalidProgramException("Method maxBy(int) only works on tuples.");
    }
     
    return new ReduceOperator<T>(this, new SelectByMaxFunction(
        (TupleTypeInfo) this.type, fields));
  }
View Full Code Here

   * @param n The desired number of elements.
   * @return A ReduceGroupOperator that represents the DataSet containing the elements.
  */
  public GroupReduceOperator<T, T> first(int n) {
    if(n < 1) {
      throw new InvalidProgramException("Parameter n of first(n) must be at least 1.");
    }
   
    return reduceGroup(new FirstReducer<T>(n));
  }
View Full Code Here

    inputFormat.setFilePath(new Path(filePath));
    try {
      return createInput(inputFormat, TypeExtractor.getInputFormatTypes(inputFormat));
    }
    catch (Exception e) {
      throw new InvalidProgramException("The type returned by the input format could not be automatically determined. " +
          "Please specify the TypeInformation of the produced type explicitly.");
    }
  }
View Full Code Here

   
    try {
      return createInput(inputFormat, TypeExtractor.getInputFormatTypes(inputFormat));
    }
    catch (Exception e) {
      throw new InvalidProgramException("The type returned by the input format could not be automatically determined. " +
          "Please specify the TypeInformation of the produced type explicitly.");
    }
  }
View Full Code Here

   * @param n The desired number of elements for each group.
   * @return A ReduceGroupOperator that represents the DataSet containing the elements.
  */
  public GroupReduceOperator<T, T> first(int n) {
    if(n < 1) {
      throw new InvalidProgramException("Parameter n of first(n) must be at least 1.");
    }
   
    return reduceGroup(new FirstReducer<T>(n));
  }
View Full Code Here

  @SuppressWarnings({ "unchecked", "rawtypes" })
  public ReduceOperator<T> minBy(int... fields)  {
   
    // Check for using a tuple
    if(!this.dataSet.getType().isTupleType()) {
      throw new InvalidProgramException("Method minBy(int) only works on tuples.");
    }
     
    return new ReduceOperator<T>(this, new SelectByMinFunction(
        (TupleTypeInfo) this.dataSet.getType(), fields));
  }
View Full Code Here

  @SuppressWarnings({ "unchecked", "rawtypes" })
  public ReduceOperator<T> maxBy(int... fields)  {
   
    // Check for using a tuple
    if(!this.dataSet.getType().isTupleType()) {
      throw new InvalidProgramException("Method maxBy(int) only works on tuples.");
    }
     
    return new ReduceOperator<T>(this, new SelectByMaxFunction(
        (TupleTypeInfo) this.dataSet.getType(), fields));
  }
View Full Code Here

    ReadFields readfieldSet = udfClass.getAnnotation(ReadFields.class);

    Set<Annotation> result = null;

    if (notConstantSet != null && constantSet != null) {
      throw new InvalidProgramException("Either " + ConstantFields.class.getSimpleName() + " or " +
          ConstantFieldsExcept.class.getSimpleName() + " can be annotated to a function, not both.");
    }

    if (notConstantSet != null) {
      result = new HashSet<Annotation>();
View Full Code Here

    ReadFieldsFirst readfieldSet1 = udfClass.getAnnotation(ReadFieldsFirst.class);
    ReadFieldsSecond readfieldSet2 = udfClass.getAnnotation(ReadFieldsSecond.class);

    if (notConstantSet1 != null && constantSet1 != null) {
      throw new InvalidProgramException("Either " + ConstantFieldsFirst.class.getSimpleName() + " or " +
          ConstantFieldsFirstExcept.class.getSimpleName() + " can be annotated to a function, not both.");
    }

    if (constantSet2 != null && notConstantSet2 != null) {
      throw new InvalidProgramException("Either " + ConstantFieldsSecond.class.getSimpleName() + " or " +
          ConstantFieldsSecondExcept.class.getSimpleName() + " can be annotated to a function, not both.");
    }

    Set<Annotation> result = null;
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.