CompressedRandomAccessReader (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.io.compress

## Class CompressedRandomAccessReader

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

- All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.io.DataOutput, 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, bufferOffset, CACHE_FLUSH_INTERVAL_IN_BYTES, channel, current, DEFAULT_BUFFER_SIZE, markedPointer, owner, validBufferBytes`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CompressedRandomAccessReader(java.lang.String dataFilePath, CompressionMetadata metadata, PoolingSegmentedFile owner)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getTotalBufferSize()`
    `long` | `length()`
    `static CompressedRandomAccessReader` | `open(java.lang.String dataFilePath, CompressionMetadata metadata)`
    `static CompressedRandomAccessReader` | `open(java.lang.String path, CompressionMetadata metadata, CompressedPoolingSegmentedFile owner)`
    `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

      `bufferCursor, bytesPastMark, bytesPastMark, bytesRemaining, close, deallocate, getFilePointer, getPath, getPosition, isEOF, mark, open, open, read, read, read, readBytes, reset, reset, resetBuffer, seek, write, write, write`

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

      `getChannel, getFD, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setLength, skipBytes, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF`

    - ### 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(java.lang.String dataFilePath,
                                      CompressionMetadata metadata,
                                      PoolingSegmentedFile owner)
                                          throws java.io.FileNotFoundException

      Throws:
        `java.io.FileNotFoundException`

  - ### Method Detail

    - #### open

          public static CompressedRandomAccessReader open(java.lang.String path,
                                          CompressionMetadata metadata,
                                          CompressedPoolingSegmentedFile owner)

    - #### open

          public static CompressedRandomAccessReader open(java.lang.String dataFilePath,
                                          CompressionMetadata metadata)

    - #### 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 © 2014 The Apache Software Foundation