@Test public void testGetProgress() throws Throwable { KafkaInputRecordReader kafkaInputRecordReader = new KafkaInputRecordReader(); assertEquals(1.0F, kafkaInputRecordReader.getProgress(), 0.01F); }
@Override public float getProgress() throws IOException, InterruptedException { if (watermark >= latestOffset || earliestOffset == latestOffset) { return 1.0f; } return Math.min(1.0f, (watermark - earliestOffset) / (float) (latestOffset - earliestOffset)); }
KafkaInputRecordReader extends RecordReader<LongWritable, BytesWritable> { @Override public float getProgress() throws IOException, InterruptedException { if (watermark >= latestOffset || earliestOffset == latestOffset) { return 1.0f; } return Math.min(1.0f, (watermark - earliestOffset) / (float) (latestOffset - earliestOffset)); } }
KafkaInputRecordReader extends RecordReader<LongWritable, BytesWritable> { @Override public float getProgress() throws IOException, InterruptedException { if (watermark >= latestOffset || earliestOffset == latestOffset) { return 1.0f; } return Math.min(1.0f, (watermark - earliestOffset) / (float) (latestOffset - earliestOffset)); }  }
KafkaInputRecordReader extends RecordReader<LongWritable, BytesWritable> { @Override public float getProgress() throws IOException, InterruptedException { if (watermark >= latestOffset || earliestOffset == latestOffset) { return 1.0f; } return Math.min(1.0f, (watermark - earliestOffset) / (float) (latestOffset - earliestOffset)); }  @Override void initialize(InputSplit split, TaskAttemptContext context); void initialize(InputSplit split, Configuration conf); @Override boolean nextKeyValue(); @Override LongWritable getCurrentKey(); @Override BytesWritable getCurrentValue(); @Override float getProgress(); @Override void close(); }
KafkaInputRecordReader extends RecordReader<LongWritable, BytesWritable> { @Override public float getProgress() throws IOException, InterruptedException { if (watermark >= latestOffset || earliestOffset == latestOffset) { return 1.0f; } return Math.min(1.0f, (watermark - earliestOffset) / (float) (latestOffset - earliestOffset)); }  @Override void initialize(InputSplit split, TaskAttemptContext context); void initialize(InputSplit split, Configuration conf); @Override boolean nextKeyValue(); @Override LongWritable getCurrentKey(); @Override BytesWritable getCurrentValue(); @Override float getProgress(); @Override void close(); static final long DEFAULT_KAFKA_CONSUMER_POLL_TIMEOUT; }