Package org.apache.trevni.avro

Examples of org.apache.trevni.avro.HadoopInput


    }

    if (visibleTrevniFiles.accept(p)) {
     
      AvroColumnReader.Params params =
          new AvroColumnReader.Params(new HadoopInput(p, job.getConfiguration()));
       AvroColumnReader<GenericData.Record> reader =
          new AvroColumnReader<GenericData.Record>(params);
       return reader.getFileSchema();
    } else
      throw new IOException("overly simple file search didn't find a trevni file");
View Full Code Here


            @Override
            public void initialize(InputSplit isplit, TaskAttemptContext tac) throws IOException, InterruptedException {
              // TODO Auto-generated method stub
              fsplit = (FileSplit) isplit;
              params = new AvroColumnReader.Params(
                  new HadoopInput(fsplit.getPath(), tac.getConfiguration()));
              Schema inputSchema = getInputAvroSchema();
              System.err.printf("initializing RecordReader with schema %s\n", inputSchema);
              params.setSchema(inputSchema);
              reader = new AvroColumnReader<GenericData.Record>(params);
              rows = reader.getRowCount();
View Full Code Here

/** Static utility methods for tools. */
class TrevniUtil {

  static Input input(String filename) throws IOException {
    if (filename.startsWith("hdfs://")) {
      return new HadoopInput(new Path(filename), new Configuration());
    } else {
      return new InputFile(new File(filename));
    }
  }
View Full Code Here

      throws IOException, InterruptedException {
    final FileSplit file = (FileSplit)inputSplit;
    context.setStatus(file.toString());

    final AvroColumnReader.Params params =
      new AvroColumnReader.Params(new HadoopInput(file.getPath(), context.getConfiguration()));
    params.setModel(ReflectData.get());
   
    if (AvroJob.getInputKeySchema(context.getConfiguration()) != null) {
      params.setSchema(AvroJob.getInputKeySchema(context.getConfiguration()));
    }
View Full Code Here

/** Static utility methods for tools. */
class Util {

  static Input input(String filename) throws IOException {
    if (filename.startsWith("hdfs://")) {
      return new HadoopInput(new Path(filename), new Configuration());
    } else {
      return new InputFile(new File(filename));
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.trevni.avro.HadoopInput

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.