@Test public void testRecordReader() throws Exception { List<String> paths = Lists.newArrayList("/path1", "/path2"); GobblinWorkUnitsInputFormat.GobblinSplit split = new GobblinWorkUnitsInputFormat.GobblinSplit(paths); GobblinWorkUnitsInputFormat inputFormat = new GobblinWorkUnitsInputFormat(); RecordReader<LongWritable, Text> recordReader = inputFormat.createRecordReader(split, new TaskAttemptContextImpl(new Configuration(), new TaskAttemptID("a", 1, TaskType.MAP, 1, 1))); recordReader.nextKeyValue(); Assert.assertEquals(recordReader.getCurrentKey().get(), 0); Assert.assertEquals(recordReader.getCurrentValue().toString(), "/path1"); recordReader.nextKeyValue(); Assert.assertEquals(recordReader.getCurrentKey().get(), 1); Assert.assertEquals(recordReader.getCurrentValue().toString(), "/path2"); Assert.assertFalse(recordReader.nextKeyValue()); }
@Override public RecordReader<LongWritable, Text> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { return new GobblinRecordReader((GobblinSplit) split); }
GobblinWorkUnitsInputFormat extends InputFormat<LongWritable, Text> { @Override public RecordReader<LongWritable, Text> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { return new GobblinRecordReader((GobblinSplit) split); } }
GobblinWorkUnitsInputFormat extends InputFormat<LongWritable, Text> { @Override public RecordReader<LongWritable, Text> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { return new GobblinRecordReader((GobblinSplit) split); }  }
GobblinWorkUnitsInputFormat extends InputFormat<LongWritable, Text> { @Override public RecordReader<LongWritable, Text> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { return new GobblinRecordReader((GobblinSplit) split); }  static void setMaxMappers(Job job, int maxMappers); static int getMaxMapper(Configuration conf); @Override List<InputSplit> getSplits(JobContext context); @Override RecordReader<LongWritable, Text> createRecordReader(InputSplit split, TaskAttemptContext context); }
GobblinWorkUnitsInputFormat extends InputFormat<LongWritable, Text> { @Override public RecordReader<LongWritable, Text> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { return new GobblinRecordReader((GobblinSplit) split); }  static void setMaxMappers(Job job, int maxMappers); static int getMaxMapper(Configuration conf); @Override List<InputSplit> getSplits(JobContext context); @Override RecordReader<LongWritable, Text> createRecordReader(InputSplit split, TaskAttemptContext context);  }