Examples of InvalidProgramException


Examples of eu.stratosphere.api.common.InvalidProgramException

   *        FileDataSink that is checked.
   */
  private void checkFileDataSink(FileDataSinkBase<?> fileSink) {
    String path = fileSink.getFilePath();
    if (path == null) {
      throw new InvalidProgramException("File path of FileDataSink is null.");
    }
    if (path.length() == 0) {
      throw new InvalidProgramException("File path of FileDataSink is empty string.");
    }
   
    try {
      Path p = new Path(path);
      String scheme = p.toUri().getScheme();
     
      if (scheme == null) {
        throw new InvalidProgramException("File path \"" + path + "\" of FileDataSink has no file system scheme (like 'file:// or hdfs://').");
      }
    } catch (Exception e) {
      throw new InvalidProgramException("File path \"" + path + "\" of FileDataSink is an invalid path: " + e.getMessage());
    }
    checkDataSink(fileSink);
  }
View Full Code Here

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

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

  @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

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

   * @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

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

    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

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

   
    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

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

   * @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

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

  @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

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

  @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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.