Package org.kitesdk.data

Examples of org.kitesdk.data.DatasetException


    // types may be missing, but fieldSchema will return a nullable string
    List<Schema.Field> fields = Lists.newArrayList();
    for (int i = 0; i < header.length; i += 1) {
      if (header[i] == null) {
        throw new DatasetException("Bad header for field " + i + ": null");
      } else if (header[i].trim().isEmpty()) {
        throw new DatasetException(
            "Bad header for field " + i + ": \"" + header[i] + "\"");
      } else if(!Compatibility.isAvroCompatibleName(header[i].trim())) {
        throw new DatasetException(
              "Bad header for field, should start with a character " +
              "or _ and can contain only alphanumerics and _ " +
              i + ": \"" + header[i] + "\"");
      }
      fields.add(new Schema.Field(
View Full Code Here


            // TODO: add a check here for range.couldContain(Marker)
            dirs.add(stat.getPath().getName());
          }
        }
      } catch (IOException ex) {
        throw new DatasetException("Cannot list directory:" + dir, ex);
      }

      return dirs;
    }
View Full Code Here

    try {
      return new FileSystemPartitionIterator(
          fs, root, descriptor.getPartitionStrategy(), descriptor.getSchema(),
          constraints);
    } catch (IOException ex) {
      throw new DatasetException("Cannot list partitions in view:" + this, ex);
    }
  }
View Full Code Here

    if (view instanceof FileSystemView) {
      return ((FileSystemView<?>) view).dirIterator();
    } else if (view instanceof FileSystemDataset) {
      return ((FileSystemDataset<?>) view).dirIterator();
    } else {
      throw new DatasetException(
          "Underlying Dataset must be a FileSystemDataset");
    }
  }
View Full Code Here

  public static FieldPartitioner identity(String sourceName, String name, String className, int buckets) {
    Class<?> typeClass;
    try {
      typeClass = Class.forName(className);
    } catch (ClassNotFoundException e) {
      throw new DatasetException("Cannot find class: " + className, e);
    }
    return new IdentityFieldPartitioner(sourceName, name, typeClass, buckets);
  }
View Full Code Here

TOP

Related Classes of org.kitesdk.data.DatasetException

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.