Package org.kitesdk.data

Examples of org.kitesdk.data.DatasetReaderException


    try {
      reader = new DataFileReader<E>(new AvroFSInput(fileSystem.open(path),
        fileSystem.getFileStatus(path).getLen()),
          DataModelUtil.getDatumReaderForType(type, schema));
    } catch (IOException e) {
      throw new DatasetReaderException("Unable to create reader path:" + path, e);
    }

    state = ReaderWriterState.OPEN;
  }
View Full Code Here


    E record = DataModelUtil.createRecord(type, schema);
    try {
      return reader.next(record);
    } catch (IOException ex) {
      throw new DatasetReaderException(ex);
    }
  }
View Full Code Here

    LOG.debug("Closing reader on path:{}", path);

    try {
      reader.close();
    } catch (IOException e) {
      throw new DatasetReaderException("Unable to close reader path:" + path, e);
    }

    state = ReaderWriterState.CLOSED;
  }
View Full Code Here

    try {
      reader = new AvroParquetReader<E>(
          fileSystem.getConf(), fileSystem.makeQualified(path));
    } catch (IOException e) {
      throw new DatasetReaderException("Unable to create reader path:" + path, e);
    }

    state = ReaderWriterState.OPEN;
  }
View Full Code Here

      try {
        next = reader.read();
      } catch (EOFException e) {
        return false;
      } catch (IOException e) {
        throw new DatasetReaderException("Unable to read next record from: " + path, e);
      }
    }
    return next != null;
  }
View Full Code Here

    LOG.debug("Closing reader on path:{}", path);

    try {
      reader.close();
    } catch (IOException e) {
      throw new DatasetReaderException("Unable to close reader path:" + path, e);
    }

    state = ReaderWriterState.CLOSED;
  }
View Full Code Here

      case UNION:
        int index = ReflectData.get().resolveUnion(schema, value);
        return valueString(value, schema.getTypes().get(index));
      default:
        // FIXED, BYTES, MAP, ARRAY, RECORD are not supported
        throw new DatasetReaderException(
            "Unsupported field type:" + schema.getType());
    }
  }
View Full Code Here

    try {
      this.incoming =  fs.open(path);
      this.size = fs.getFileStatus(path).getLen();
    } catch (IOException ex) {
      throw new DatasetReaderException("Cannot open path: " + path, ex);
    }

    this.reader = CSVUtil.newReader(incoming, props);
    // header is determined by the schema, so skip the file header
    // TODO: support the orderByHeader property
View Full Code Here

  private boolean advance() {
    try {
      next = reader.readNext();
    } catch (IOException ex) {
      throw new DatasetReaderException("Could not read record", ex);
    }
    return (next != null);
  }
View Full Code Here

    LOG.debug("Closing reader on path:{}", path);

    try {
      reader.close();
    } catch (IOException e) {
      throw new DatasetReaderException("Unable to close reader path:" + path, e);
    }

    state = ReaderWriterState.CLOSED;
  }
View Full Code Here

TOP

Related Classes of org.kitesdk.data.DatasetReaderException

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.