public long getPos() throws IOException { return in.tell(); }
public float getProgress() throws IOException { if (end == start) { return 0.0f; } else { return Math.min(1.0f, (in.tell() - start) / (float)(end - start)); } }
public TetherRecordReader(JobConf job, FileSplit split) throws IOException { this.in = new FsInput(split.getPath(), job); this.reader = new DataFileReader<>(in, new GenericDatumReader<>()); reader.sync(split.getStart()); // sync to start this.start = in.tell(); this.end = split.getStart() + split.getLength(); job.set(AvroJob.INPUT_SCHEMA, reader.getSchema().toString()); }
@Test public void testTell() throws Exception { long expectedTellPos = FILE_CONTENTS.length() / 2; fsInput.seek(expectedTellPos); long actualTellPos = fsInput.tell(); assertThat(actualTellPos, is(equalTo(expectedTellPos))); }
public long getPos() throws IOException { return in.tell(); }
public long getPos() throws IOException { return in.tell(); }
public long getPos() throws IOException { return in.tell(); }
public float getProgress() throws IOException { if (end == start) { return 0.0f; } else { return Math.min(1.0f, (in.tell() - start) / (float)(end - start)); } }
@Override public float getProgress() throws IOException { if (end == start) { return 0.0f; } else { return Math.min(1.0f, (in.tell() - start) / (float) (end - start)); } }
public float getProgress() throws IOException { if (end == start) { return 0.0f; } else { return Math.min(1.0f, (in.tell() - start) / (float)(end - start)); } }
public float getProgress() throws IOException { if (end == start) { return 0.0f; } else { return Math.min(1.0f, (in.tell() - start) / (float)(end - start)); } }
public TetherRecordReader(JobConf job, FileSplit split) throws IOException { this.in = new FsInput(split.getPath(), job); this.reader = new DataFileReader<Object>(in, new GenericDatumReader<Object>()); reader.sync(split.getStart()); // sync to start this.start = in.tell(); this.end = split.getStart() + split.getLength(); job.set(AvroJob.INPUT_SCHEMA, reader.getSchema().toString()); }
public TetherRecordReader(JobConf job, FileSplit split) throws IOException { this.in = new FsInput(split.getPath(), job); this.reader = new DataFileReader<Object>(in, new GenericDatumReader<Object>()); reader.sync(split.getStart()); // sync to start this.start = in.tell(); this.end = split.getStart() + split.getLength(); job.set(AvroJob.INPUT_SCHEMA, reader.getSchema().toString()); }
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { FileSplit fileSplit = (FileSplit) split; Configuration config = context.getConfiguration(); Path path = fileSplit.getPath(); this.in = new FsInput(path, config); DatumReader<T> datumReader = getDatumReader(config); this.reader = new DataFileReader<T>(in, datumReader); reader.sync(fileSplit.getStart()); // sync to start this.start = in.tell(); this.end = fileSplit.getStart() + split.getLength(); }
public AvroRecordReader(JobConf job, FileSplit split) throws IOException { this.in = new FsInput(split.getPath(), job); Schema s = AvroJob.getInputSchema(job); this.reader = new DataFileReader<T>(in, new SpecificDatumReader<T>(s)); reader.sync(split.getStart()); // sync to start this.start = in.tell(); this.end = split.getStart() + split.getLength(); }