@Override public void initialize(InputSplit unusedSplit, TaskAttemptContext cx) throws IOException, InterruptedException { super.initialize( new FileSplit(this.split.getPath(this.idx), this.split.getOffset(this.idx), this.split.getLength(this.idx), null), cx); }
/** {@inheritDoc} */ @Override public RecordReader<AvroKey<T>, NullWritable> createRecordReader( InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { Schema readerSchema = AvroJob.getInputKeySchema(context.getConfiguration()); if (null == readerSchema) { LOG.warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired."); LOG.info("Using a reader schema equal to the writer schema."); } return new AvroKeyRecordReader<>(readerSchema); } }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { return innerReader.nextKeyValue(); }
@Override public AvroKey<T> getCurrentKey() throws IOException, InterruptedException { return delegate.getCurrentKey(); }
@Override public void close() throws IOException { delegate.close(); delegate = null; }
@Override public float getProgress() throws IOException, InterruptedException { return delegate.getProgress(); }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { return delegate.nextKeyValue(); }
@Override public AvroKey<GenericRecord> getCurrentKey() throws IOException, InterruptedException { return innerReader.getCurrentKey(); }
@Override public void close() throws IOException { innerReader.close(); }
@Override public float getProgress() throws IOException, InterruptedException { return innerReader.getProgress(); }
@Override public void initialize(InputSplit unusedSplit, TaskAttemptContext cx) throws IOException, InterruptedException { super.initialize( new FileSplit(this.split.getPath(this.idx), this.split.getOffset(this.idx), this.split.getLength(this.idx), null), cx); }
/** {@inheritDoc} */ @Override public RecordReader<AvroKey<T>, NullWritable> createRecordReader( InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { Schema readerSchema = AvroJob.getInputKeySchema(context.getConfiguration()); if (null == readerSchema) { LOG.warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired."); LOG.info("Using a reader schema equal to the writer schema."); } return new AvroKeyRecordReader<T>(readerSchema); } }
/** {@inheritDoc} */ @Override public boolean nextKeyValue() throws IOException, InterruptedException { boolean hasNext = false; try { hasNext = super.nextKeyValue(); } catch (AvroRuntimeException are) { // Survive an "Invalid sync!" exception logger().error("Trapping " + are.getMessage()); } return hasNext; }
@Override public void initialize(InputSplit unusedSplit, TaskAttemptContext cx) throws IOException, InterruptedException { super.initialize( new FileSplit(this.split.getPath(this.idx), this.split.getOffset(this.idx), this.split.getLength(this.idx), null), cx); }
public AvroKeyCombineFileReader(CombineFileSplit split, TaskAttemptContext arg1, Integer idx) throws IOException, InterruptedException { this.split = split; this.context = arg1; this.idx = idx; Schema schema = RelaxedSchemaUtils.getInputKeySchema(arg1.getConfiguration()); //System.err.println(schema); innerReader = new AvroKeyRecordReader<GenericRecord>(schema); }
@Override public void initialize(InputSplit arg0, TaskAttemptContext arg1) throws IOException, InterruptedException { innerReader.initialize(new FileSplit(split.getPath(idx), split.getOffset(idx), split.getLength(idx), null), arg1); }
/** {@inheritDoc} */ @Override public RecordReader<AvroKey<T>, NullWritable> createRecordReader( InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { Schema readerSchema = AvroMultipleInputsUtil.getInputKeySchemaForSplit(context.getConfiguration(), split); if (readerSchema == null) { throw new RuntimeException("Could not determine input schema"); } return new AvroKeyRecordReader<T>(readerSchema); } }
@Override public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException, InterruptedException { CombineFileSplit combineSplit = (CombineFileSplit)inputSplit; FileSplit split = new FileSplit( combineSplit.getPath(splitIndex), combineSplit.getOffset(splitIndex), combineSplit.getLength(splitIndex), combineSplit.getLocations()); // Initialize with the single FileSplit for the current index delegate.initialize(split, context); }
@Override public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException, InterruptedException { this.inputSplit = (CombineFileSplit)inputSplit; FileSplit fileSplit = new FileSplit(this.inputSplit.getPath(idx), this.inputSplit.getOffset(idx), this.inputSplit.getLength(idx), this.inputSplit.getLocations()); super.initialize(fileSplit, context); } }