Package eu.stratosphere.api.common

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


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

    }

    Matcher matcher = PATTERN_ANNOTATION.matcher(s);

    if (!matcher.matches()) {
      throw new InvalidProgramException("Unrecognized annotation string format.");
    }

    Matcher forwardMatcher = PATTERN_FORWARD.matcher(s);
    while (forwardMatcher.find()) {
      int sourceField = Integer.valueOf(forwardMatcher.group(2));
View Full Code Here

  private static FieldSet readFieldSetFromString(String s, TypeInformation<?> inType, TypeInformation<?> outType) {
    Matcher matcher = PATTERN_LIST.matcher(s);

    if (!matcher.matches()) {
      throw new InvalidProgramException("Unrecognized annotation string format.");
    }

    matcher = PATTERN_DIGIT.matcher(s);
    FieldSet fs = new FieldSet();
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();
        }

        if (keys2.isEmpty()) {
          throw new InvalidProgramException("The join keys must not be empty.");
        }

        if (!keys1.areCompatibale(keys2)) {
          throw new InvalidProgramException("The pair of join keys are not compatible with each other.");
        }

        return new CoGroupOperatorWithoutFunction(keys2);
      }
View Full Code Here

          if (keys2 == null) {
            throw new NullPointerException();
          }

          if (keys2.isEmpty()) {
            throw new InvalidProgramException("The join keys must not be empty.");
          }

          this.keys2 = keys2;
        }
View Full Code Here

      this(groupingFields, type, false);
    }
   
    public FieldPositionKeys(int[] groupingFields, TypeInformation<T> type, boolean allowEmpty) {
      if (!type.isTupleType()) {
        throw new InvalidProgramException("Specifying keys via field positions is only valid for tuple data types");
      }
     
      if (!allowEmpty && (groupingFields == null || groupingFields.length == 0)) {
        throw new IllegalArgumentException("The grouping fields must not be empty.");
      }
View Full Code Here

    }
   
    public void checkJoinKeyFields(int[] keyFields) {
      int[] ssKeys = deltaIteration.keys.computeLogicalKeyPositions();
      if (!Arrays.equals(ssKeys, keyFields)) {
        throw new InvalidProgramException("The solution set must be joind with using the keys with which elements are identified.");
      }
    }
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

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.