org.apache.cassandra.io.compress

## Class CompressedRandomAccessReader

- java.lang.Object
- - java.io.InputStream
  - - org.apache.cassandra.io.util.AbstractDataInput
    - - org.apache.cassandra.io.util.RandomAccessReader
      - - org.apache.cassandra.io.compress.CompressedRandomAccessReader

- All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.lang.AutoCloseable, FileDataInput
  Direct Known Subclasses:
    CompressedThrottledReader

      public class CompressedRandomAccessReader
      extends RandomAccessReader

  CRAR extends RAR to transparently uncompress blocks from the file into RAR.buffer. Most of the RAR "read bytes from the buffer, rebuffering when necessary" machinery works unchanged after that.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.io.util.RandomAccessReader

      `RandomAccessReader.BufferedRandomAccessFileMark`

  - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.io.util.RandomAccessReader

      `buffer, BUFFER_SIZE, bufferOffset, channel, DEFAULT_BUFFER_SIZE, markedPointer, owner`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CompressedRandomAccessReader(ChannelProxy channel, CompressionMetadata metadata, ICompressedFile file, PoolingSegmentedFile owner)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.nio.ByteBuffer` | `allocateBuffer(int bufferSize, BufferType bufferType)`
    `void` | `deallocate()`
    `int` | `getTotalBufferSize()`
    `long` | `length()`
    `static CompressedRandomAccessReader` | `open(ChannelProxy channel, CompressionMetadata metadata)`
    `static CompressedRandomAccessReader` | `open(ICompressedFile file)`
    `protected void` | `reBuffer()` Read data from file starting from current currentOffset to populate buffer.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.apache.cassandra.io.util.RandomAccessReader

      `bytesPastMark, bytesPastMark, bytesRemaining, close, current, getChannel, getFilePointer, getPath, getPosition, getPositionLimit, isEOF, mark, open, open, open, open, read, read, read, readBytes, reset, reset, seek`

    - ### Methods inherited from class org.apache.cassandra.io.util.AbstractDataInput

      `readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes`

    - ### Methods inherited from class java.io.InputStream

      `available, mark, markSupported, skip`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.io.DataInput

      `readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes`

- - ### Constructor Detail

    - #### CompressedRandomAccessReader

          protected CompressedRandomAccessReader(ChannelProxy channel,
                                                 CompressionMetadata metadata,
                                                 ICompressedFile file,
                                                 PoolingSegmentedFile owner)

  - ### Method Detail

    - #### open

          public static CompressedRandomAccessReader open(ChannelProxy channel,
                                                          CompressionMetadata metadata)

    - #### open

          public static CompressedRandomAccessReader open(ICompressedFile file)

    - #### allocateBuffer

          protected java.nio.ByteBuffer allocateBuffer(int bufferSize,
                                                       BufferType bufferType)

      Overrides:
        `allocateBuffer` in class `RandomAccessReader`

    - #### deallocate

          public void deallocate()

      Overrides:
        `deallocate` in class `RandomAccessReader`

    - #### reBuffer

          protected void reBuffer()

      Description copied from class: `RandomAccessReader`
      Read data from file starting from current currentOffset to populate buffer.
      Overrides:
        `reBuffer` in class `RandomAccessReader`

    - #### getTotalBufferSize

          public int getTotalBufferSize()

      Overrides:
        `getTotalBufferSize` in class `RandomAccessReader`

    - #### length

          public long length()

      Overrides:
        `length` in class `RandomAccessReader`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `RandomAccessReader`

Copyright © 2018 The Apache Software Foundation