@Override public long getPos() throws IOException { return delegate.getPos(); }
public long getPos() throws IOException { if (recordReader != null) { return recordReader.getPos(); } else { return 0; } }
private long getSyncedPosition() throws IOException { return recordReader.getPos(); } /**
@Override public long getPos() throws IOException { return recordReader.getPos(); }
@Override public long getPos() throws IOException { return rr.getPos(); }
public long getPos() throws IOException { return recordReader.getPos(); }
public long getPos() throws IOException { if (recordReader != null) { return recordReader.getPos(); } else { return 0; } }
@Override public long getPos() throws IOException { return recordReader.getPos(); }
private long getSyncedPosition() throws IOException { return recordReader.getPos(); } /**
public long getPos() throws IOException { return recordReader.getPos(); }
@Override public String toString() { long position = -1; try { if (reader != null) { position = reader.getPos(); } } catch (IOException e) { logger.trace("Unable to obtain reader position.", e); } return getClass().getSimpleName() + "[Database=" + table.getDbName() + ", Table=" + table.getTableName() + ", Position=" + position + "]"; } }
@Override public float getProgress() throws IOException { // The calculation is strongly dependent on the assumption that all splits // came from the same file return Math.min(1.0f, ((recordReader == null || this.getIOContext().isBinarySearching()) ? progress : recordReader.getPos()) / (float) (split.getLength())); }
@Override public float getProgress() throws IOException { // The calculation is strongly dependent on the assumption that all splits // came from the same file return Math.min(1.0f, ((recordReader == null || this.getIOContext().isBinarySearching()) ? progress : recordReader.getPos()) / (float) (split.getLength())); }
/** * Request position from proxied RR. */ public long getPos() throws IOException { return rr.getPos(); }
/** * Request position from proxied RR. */ public long getPos() throws IOException { return rr.getPos(); }
@Override public long getPos() throws IOException { return delegate.getPos(); }
@Override public long getPos() throws IOException { return recordReader.getPos(); }
/** * Request position from proxied RR. */ public long getPos() throws IOException { return rr.getPos(); }
/** * test DBInputFormat class. Class should split result for chunks * @throws Exception */ @Test(timeout = 10000) public void testDBInputFormat() throws Exception { JobConf configuration = new JobConf(); setupDriver(configuration); DBInputFormat<NullDBWritable> format = new DBInputFormat<NullDBWritable>(); format.setConf(configuration); format.setConf(configuration); DBInputFormat.DBInputSplit splitter = new DBInputFormat.DBInputSplit(1, 10); Reporter reporter = mock(Reporter.class); RecordReader<LongWritable, NullDBWritable> reader = format.getRecordReader( splitter, configuration, reporter); configuration.setInt(MRJobConfig.NUM_MAPS, 3); InputSplit[] lSplits = format.getSplits(configuration, 3); assertEquals(5, lSplits[0].getLength()); assertEquals(3, lSplits.length); // test reader .Some simple tests assertEquals(LongWritable.class, reader.createKey().getClass()); assertEquals(0, reader.getPos()); assertEquals(0, reader.getProgress(), 0.001); reader.close(); }
@Override public float getProgress() throws IOException { // The calculation is strongly dependent on the assumption that all splits // came from the same file return Math.min(1.0f, ((recordReader == null || this.getIOContext().isBinarySearching()) ? progress : recordReader.getPos()) / (float) (split.getLength())); }