@Override public long position() { if (delegate == null) { return initialPosition; } return delegate.position(); }
@Override public String toString() { return toStringHelper(this) .add("source", orcDataSourceId) .add("compressedOffset", compressedSliceInput.position()) .add("uncompressedOffset", current == null ? null : current.position()) .add("decompressor", decompressor.map(Object::toString).orElse("none")) .toString(); } }
public long getCheckpoint() { // if the decompressed buffer is empty, return a checkpoint starting at the next block if (current == null || (current.position() == 0 && current.remaining() == 0)) { return createInputStreamCheckpoint(toIntExact(compressedSliceInput.position()), 0); } // otherwise return a checkpoint at the last compressed block read and the current position in the buffer return createInputStreamCheckpoint(currentCompressedBlockOffset, toIntExact(current.position())); }
public boolean seekToCheckpoint(long checkpoint) throws IOException { int compressedBlockOffset = decodeCompressedBlockOffset(checkpoint); int decompressedOffset = decodeDecompressedOffset(checkpoint); boolean discardedBuffer; if (compressedBlockOffset != currentCompressedBlockOffset) { if (!decompressor.isPresent()) { throw new OrcCorruptionException(orcDataSourceId, "Reset stream has a compressed block offset but stream is not compressed"); } compressedSliceInput.setPosition(compressedBlockOffset); current = EMPTY_SLICE.getInput(); discardedBuffer = true; } else { discardedBuffer = false; } if (decompressedOffset != current.position()) { current.setPosition(0); if (current.remaining() < decompressedOffset) { decompressedOffset -= current.remaining(); advance(); } current.setPosition(decompressedOffset); } return discardedBuffer; }
currentCompressedBlockOffset = toIntExact(compressedSliceInput.position()); int b0 = compressedSliceInput.readUnsignedByte(); int b1 = compressedSliceInput.readUnsignedByte();
@Override public long position() { if (delegate == null) { return initialPosition; } return delegate.position(); }
@Override public long position() { if (delegate == null) { return initialPosition; } return delegate.position(); }
@Override public long position() { if (delegate == null) { return initialPosition; } return delegate.position(); }
@Override public String toString() { return toStringHelper(this) .add("source", orcDataSourceId) .add("compressedOffset", compressedSliceInput.position()) .add("uncompressedOffset", current == null ? null : current.position()) .add("decompressor", decompressor.map(Object::toString).orElse("none")) .toString(); } }
@Override public String toString() { return toStringHelper(this) .add("source", orcDataSourceId) .add("compressedOffset", compressedSliceInput.position()) .add("uncompressedOffset", current == null ? null : current.position()) .add("decompressor", decompressor.map(Object::toString).orElse("none")) .toString(); } }
@Override public String toString() { return toStringHelper(this) .add("source", orcDataSourceId) .add("compressedOffset", compressedSliceInput.position()) .add("uncompressedOffset", current == null ? null : current.position()) .add("decompressor", decompressor.map(Object::toString).orElse("none")) .toString(); } }
/** * Gets the number of bytes remaining after the current position in this stream. */ public final long remaining() { return length() - position(); } }
public long getCheckpoint() { // if the decompressed buffer is empty, return a checkpoint starting at the next block if (current == null || (current.position() == 0 && current.remaining() == 0)) { return createInputStreamCheckpoint(Ints.checkedCast(compressedSliceInput.position()), 0); } // otherwise return a checkpoint at the last compressed block read and the current position in the buffer return createInputStreamCheckpoint(currentCompressedBlockOffset, Ints.checkedCast(current.position())); }
public long getCheckpoint() { // if the decompressed buffer is empty, return a checkpoint starting at the next block if (current == null || (current.position() == 0 && current.remaining() == 0)) { return createInputStreamCheckpoint(toIntExact(compressedSliceInput.position()), 0); } // otherwise return a checkpoint at the last compressed block read and the current position in the buffer return createInputStreamCheckpoint(currentCompressedBlockOffset, toIntExact(current.position())); }
/** * Gets the number of bytes remaining after the current position in this stream. */ public final long remaining() { return length() - position(); } }
public long getCheckpoint() { // if the decompressed buffer is empty, return a checkpoint starting at the next block if (current == null || (current.position() == 0 && current.remaining() == 0)) { return createInputStreamCheckpoint(toIntExact(compressedSliceInput.position()), 0); } // otherwise return a checkpoint at the last compressed block read and the current position in the buffer return createInputStreamCheckpoint(currentCompressedBlockOffset, toIntExact(current.position())); }
public long getCheckpoint() { // if the decompressed buffer is empty, return a checkpoint starting at the next block if (current == null || (current.position() == 0 && current.remaining() == 0)) { return createInputStreamCheckpoint(toIntExact(compressedSliceInput.position()), 0); } // otherwise return a checkpoint at the last compressed block read and the current position in the buffer return createInputStreamCheckpoint(currentCompressedBlockOffset, toIntExact(current.position())); }
public boolean seekToCheckpoint(long checkpoint) throws IOException { int compressedBlockOffset = decodeCompressedBlockOffset(checkpoint); int decompressedOffset = decodeDecompressedOffset(checkpoint); boolean discardedBuffer; if (compressedBlockOffset != currentCompressedBlockOffset) { if (!decompressor.isPresent()) { throw new OrcCorruptionException(orcDataSourceId, "Reset stream has a compressed block offset but stream is not compressed"); } compressedSliceInput.setPosition(compressedBlockOffset); current = EMPTY_SLICE.getInput(); discardedBuffer = true; } else { discardedBuffer = false; } if (decompressedOffset != current.position()) { current.setPosition(0); if (current.remaining() < decompressedOffset) { decompressedOffset -= current.remaining(); advance(); } current.setPosition(decompressedOffset); } return discardedBuffer; }
public boolean seekToCheckpoint(long checkpoint) throws IOException { int compressedBlockOffset = decodeCompressedBlockOffset(checkpoint); int decompressedOffset = decodeDecompressedOffset(checkpoint); boolean discardedBuffer; if (compressedBlockOffset != currentCompressedBlockOffset) { if (compressionKind == UNCOMPRESSED) { throw new OrcCorruptionException("Reset stream has a compressed block offset but stream is not compressed"); } compressedSliceInput.setPosition(compressedBlockOffset); current = EMPTY_SLICE.getInput(); discardedBuffer = true; } else { discardedBuffer = false; } if (decompressedOffset != current.position()) { current.setPosition(0); if (current.remaining() < decompressedOffset) { decompressedOffset -= current.remaining(); advance(); } current.setPosition(decompressedOffset); } return discardedBuffer; }