Package eu.stratosphere.api.common

Examples of eu.stratosphere.api.common.InvalidProgramException


    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.");
    }
   
    TupleTypeInfo<?> inType = (TupleTypeInfo<?>) 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.");
    }
   
    TupleTypeInfo<?> inType = (TupleTypeInfo<?>) input.getDataSet().getType();
   
    if (field < 0 || field >= inType.getArity()) {
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

 
  public SortedGrouping(DataSet<T> set, Keys<T> keys, int field, Order order) {
    super(set, keys);
   
    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.");
    }
   
View Full Code Here

  public SortedGrouping<T> sortGroup(int field, Order order) {
   
    int pos;
   
    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.");
    }
   
View Full Code Here

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

      }
      else if (super.keys1 instanceof Keys.FieldPositionKeys
            && super.keys2 instanceof Keys.FieldPositionKeys)
      {
        if (!super.keys1.areCompatibale(super.keys2)) {
          throw new InvalidProgramException("The types of the key fields do not match.");
        }
       
        int[] logicalKeyPositions1 = super.keys1.computeLogicalKeyPositions();
        int[] logicalKeyPositions2 = super.keys2.computeLogicalKeyPositions();
       
View Full Code Here

        if (keys1 == null) {
          throw new NullPointerException();
        }
       
        if (keys1.isEmpty()) {
          throw new InvalidProgramException("The join keys must not be empty.");
        }
       
        this.keys1 = keys1;
      }
View Full Code Here

        if (keys2 == null) {
          throw new NullPointerException("The join keys may not be null.");
        }
       
        if (keys2.isEmpty()) {
          throw new InvalidProgramException("The join keys may not be empty.");
        }
       
        if (!keys1.areCompatibale(keys2)) {
          throw new InvalidProgramException("The pair of join keys are not compatible with each other.");
        }
       
       
        // sanity check solution set key mismatches
        if (input1 instanceof SolutionSetPlaceHolder) {
          if (keys1 instanceof FieldPositionKeys) {
            int[] positions = ((FieldPositionKeys<?>) keys1).computeLogicalKeyPositions();
            ((SolutionSetPlaceHolder<?>) input1).checkJoinKeyFields(positions);
          } else {
            throw new InvalidProgramException("Currently, the solution set may only be joined with using tuple field positions.");
          }
        }
        if (input2 instanceof SolutionSetPlaceHolder) {
          if (keys2 instanceof FieldPositionKeys) {
            int[] positions = ((FieldPositionKeys<?>) keys2).computeLogicalKeyPositions();
            ((SolutionSetPlaceHolder<?>) input2).checkJoinKeyFields(positions);
          } else {
            throw new InvalidProgramException("Currently, the solution set may only be joined with using tuple field positions.");
          }
        }
       
       
        return new DefaultJoin<I1, I2>(input1, input2, keys1, keys2, joinHint);
View Full Code Here

TOP

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