@Override public void open(FileInputSplit split) throws IOException { super.open(split); this.blockInfo = this.createAndReadBlockInfo(); // We set the size of the BlockBasedInput to splitLength as each split contains one block. // After reading the block info, we seek in the file to the correct position. this.readRecords = 0; this.stream.seek(this.splitStart + this.blockInfo.getFirstRecordStart()); this.blockBasedInput = new BlockBasedInput(this.stream, (int) blockInfo.getFirstRecordStart(), this.splitLength); this.dataInputStream = new DataInputViewStreamWrapper(blockBasedInput); }
@PublicEvolving @Override public void reopen(FileInputSplit split, Tuple2<Long, Long> state) throws IOException { Preconditions.checkNotNull(split, "reopen() cannot be called on a null split."); Preconditions.checkNotNull(state, "reopen() cannot be called with a null initial state."); try { this.open(split); } finally { this.blockInfo = this.createAndReadBlockInfo(); long blockPos = state.f0; this.readRecords = state.f1; this.stream.seek(this.splitStart + blockPos); this.blockBasedInput = new BlockBasedInput(this.stream, (int) blockPos, this.splitLength); this.dataInputStream = new DataInputViewStreamWrapper(blockBasedInput); } } }
@Override public void open(FileInputSplit split) throws IOException { super.open(split); this.blockInfo = this.createAndReadBlockInfo(); // We set the size of the BlockBasedInput to splitLength as each split contains one block. // After reading the block info, we seek in the file to the correct position. this.readRecords = 0; this.stream.seek(this.splitStart + this.blockInfo.getFirstRecordStart()); this.blockBasedInput = new BlockBasedInput(this.stream, (int) blockInfo.getFirstRecordStart(), this.splitLength); this.dataInputStream = new DataInputViewStreamWrapper(blockBasedInput); }
@Override public void open(FileInputSplit split) throws IOException { super.open(split); this.blockInfo = this.createAndReadBlockInfo(); // We set the size of the BlockBasedInput to splitLength as each split contains one block. // After reading the block info, we seek in the file to the correct position. this.readRecords = 0; this.stream.seek(this.splitStart + this.blockInfo.getFirstRecordStart()); this.blockBasedInput = new BlockBasedInput(this.stream, (int) blockInfo.getFirstRecordStart(), this.splitLength); this.dataInputStream = new DataInputViewStreamWrapper(blockBasedInput); }
@PublicEvolving @Override public void reopen(FileInputSplit split, Tuple2<Long, Long> state) throws IOException { Preconditions.checkNotNull(split, "reopen() cannot be called on a null split."); Preconditions.checkNotNull(state, "reopen() cannot be called with a null initial state."); try { this.open(split); } finally { this.blockInfo = this.createAndReadBlockInfo(); long blockPos = state.f0; this.readRecords = state.f1; this.stream.seek(this.splitStart + blockPos); this.blockBasedInput = new BlockBasedInput(this.stream, (int) blockPos, this.splitLength); this.dataInputStream = new DataInputViewStreamWrapper(blockBasedInput); } } }
@PublicEvolving @Override public void reopen(FileInputSplit split, Tuple2<Long, Long> state) throws IOException { Preconditions.checkNotNull(split, "reopen() cannot be called on a null split."); Preconditions.checkNotNull(state, "reopen() cannot be called with a null initial state."); try { this.open(split); } finally { this.blockInfo = this.createAndReadBlockInfo(); long blockPos = state.f0; this.readRecords = state.f1; this.stream.seek(this.splitStart + blockPos); this.blockBasedInput = new BlockBasedInput(this.stream, (int) blockPos, this.splitLength); this.dataInputStream = new DataInputViewStreamWrapper(blockBasedInput); } } }