@Override public long getPos() throws IOException { return isEmptyInput ? 0 : reader.tell(); }
public long getPos() throws IOException { return reader.tell(); }
public long getPos() throws IOException { return reader.tell(); }
protected AvroAsTextRecordReader(FileReader<T> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
protected AvroRecordReader(FileReader<T> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
public AvroGenericRecordReader(JobConf job, FileSplit split, Reporter reporter) throws IOException { this.jobConf = job; Schema latest; try { latest = getSchema(job, split); } catch (AvroSerdeException e) { throw new IOException(e); } GenericDatumReader<GenericRecord> gdr = new GenericDatumReader<GenericRecord>(); if(latest != null) { gdr.setExpected(latest); } if (split.getLength() == 0) { this.isEmptyInput = true; this.start = 0; this.reader = null; } else { this.isEmptyInput = false; this.reader = new DataFileReader<GenericRecord>(new FsInput(split.getPath(), job), gdr); this.reader.sync(split.getStart()); this.start = reader.tell(); } this.stop = split.getStart() + split.getLength(); this.recordReaderID = new UID(); }
@Override public long tell() throws IOException { return reader.tell(); }
public long getPos() throws IOException { return reader.tell(); }
@Override public long getPos() throws IOException { return reader.tell(); }
public long getPos() throws IOException { return reader.tell(); }
@Override public float getProgress() throws IOException, InterruptedException { if (start == end) { return 0.0f; } else { return Math.min(1.0f, ((float) (reader.tell() - start)) / ((float) (end - start))); } }
@Override public float getProgress() throws IOException, InterruptedException { if (start == end) { return 0.0f; } else { return Math.min(1.0f, ((float) (reader.tell() - start)) / ((float) (end - start))); } }
@Override public float getProgress() throws IOException, InterruptedException { Preconditions.checkState(dataFileReader != null); if (splitLength == 0) { return 1.0f; } float splitRelativeLocation = dataFileReader.tell() - splitStart; return splitRelativeLocation / splitLength; }
protected AvroAsTextRecordReader(FileReader<T> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
protected void init(FileReader<T> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
protected void init(FileReader<T> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
protected AvroRecordReader(FileReader<T> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
protected void init(FileReader<T> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
protected AvroAsJSONRecordReader(FileReader<GenericRecord> reader, FileSplit split) throws IOException { this.reader = reader; reader.sync(split.getStart()); this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }
@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 = AvroMode .fromConfiguration(context.getConfiguration()) .getReader(schema); this.reader = DataFileReader.openReader(in, datumReader); reader.sync(split.getStart()); // sync to start this.start = reader.tell(); this.end = split.getStart() + split.getLength(); }