Class CompressedInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.lang.AutoCloseable, DataInputPlus

    public class CompressedInputStream
    extends RebufferingInputStream
    implements java.lang.AutoCloseable
    InputStream which reads compressed chunks from the underlying input stream and deals with decompression and position tracking. The underlying input will be an instance of RebufferingInputStream except in some unit tests. Compressed chunks transferred will be a subset of all chunks in the source streamed sstable - just enough to deserialize the requested partition position ranges. Correctness of the entire operation depends on provided partition position ranges and compressed chunks properly matching, and there is no way on the receiving side to verify if that's the case, which arguably makes this a little brittle.
    • Constructor Detail

      • CompressedInputStream

        public CompressedInputStream​(DataInputPlus input,
                                     CompressionInfo compressionInfo,
                                     ChecksumType checksumType,
                                     java.util.function.DoubleSupplier validateChecksumChance)
        Parameters:
        input - Input input to read compressed data from
        compressionInfo - Compression info
    • Method Detail

      • reBuffer

        protected void reBuffer()
                         throws java.io.IOException
        Description copied from class: RebufferingInputStream
        Implementations must implement this method to refill the buffer. They can expect the buffer to be empty when this method is invoked.
        Specified by:
        reBuffer in class RebufferingInputStream
        Throws:
        java.io.IOException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream