Package org.apache.avro.file

Examples of org.apache.avro.file.SeekableInput


  @Override
  public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException, InterruptedException {
    FileSplit split = (FileSplit) genericSplit;
    Configuration conf = context.getConfiguration();
    SeekableInput in = new FsInput(split.getPath(), conf);
    DatumReader<T> datumReader = null;
    if (context.getConfiguration().getBoolean(AvroJob.INPUT_IS_REFLECT, true)) {
      ReflectDataFactory factory = Avros.getReflectDataFactory(conf);
      datumReader = factory.getReader(schema);
    } else {
View Full Code Here


      datumReader = new ReflectDatumReader<E>(avroValueType);
    }
   
    LOG.info("Opening split " + split);
   
    SeekableInput in = new FSDataInputStreamWrapper(stream, (int) split.getLength());
   
    dataFileReader = DataFileReader.openReader(in, datumReader);
    dataFileReader.sync(split.getStart());
  }
View Full Code Here

      throw new IllegalArgumentException("Only compatible with FileSplits.");
    }
    FileSplit fileSplit = (FileSplit) inputSplit;

    // Open a seekable input stream to the Avro container file.
    SeekableInput seekableFileInput
        = createSeekableInput(context.getConfiguration(), fileSplit.getPath());

    // Wrap the seekable input stream in an Avro DataFileReader.
    Configuration conf = context.getConfiguration();
    GenericData dataModel = AvroSerialization.createDataModel(conf);
View Full Code Here

      datumReader = new ReflectDatumReader<E>(avroValueType);
    }
   
    LOG.info("Opening split " + split);
   
    SeekableInput in = new FSDataInputStreamWrapper(stream, (int) split.getLength());
   
    dataFileReader = DataFileReader.openReader(in, datumReader);
    dataFileReader.sync(split.getStart());
  }
View Full Code Here

      datumReader = new ReflectDatumReader<E>(avroValueType);
    }
   
    LOG.info("Opening split " + split);
   
    SeekableInput in = new FSDataInputStreamWrapper(stream, (int) split.getLength());
   
    dataFileReader = DataFileReader.openReader(in, datumReader);
    dataFileReader.sync(split.getStart());
   
    reuseAvroValue = null;
View Full Code Here

  @Override
  public void open(FileInputSplit split) throws IOException {
    super.open(split);
    DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>();
    SeekableInput in = new FSDataInputStreamWrapper(stream, (int) split.getLength());
    LOG.info("Opening split " + split);
    dataFileReader = DataFileReader.openReader(in, datumReader);
    dataFileReader.sync(split.getStart());
  }
View Full Code Here

TOP

Related Classes of org.apache.avro.file.SeekableInput

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.