@Override public float getProgress() throws IOException { return stop == start ? 0.0f : Math.min(1.0f, (getPos() - start) / (float)(stop - start)); }
@Override public float getProgress() throws IOException { return stop == start ? 0.0f : Math.min(1.0f, (getPos() - start) / (float)(stop - start)); }
@Test public void emptyFile() throws IOException { AvroGenericRecordReader reader = new AvroGenericRecordReader(jobConf, emptyFileSplit, reporter); //next() should always return false Assert.assertEquals(false, reader.next(null, null)); //getPos() should always return 0 Assert.assertEquals(0, reader.getPos()); //close() should just do nothing reader.close(); } }
@Override public float getProgress() throws IOException { return stop == start ? 0.0f : Math.min(1.0f, (getPos() - start) / (float)(stop - start)); }
@Override public float getProgress() throws IOException { return stop == start ? 0.0f : Math.min(1.0f, (getPos() - start) / (float)(stop - start)); }