MmappedSegmentedFile (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.io.util

## Class MmappedSegmentedFile

- java.lang.Object
- - org.apache.cassandra.utils.concurrent.SharedCloseableImpl
  - - org.apache.cassandra.io.util.SegmentedFile
    - - org.apache.cassandra.io.util.MmappedSegmentedFile

- All Implemented Interfaces:
    java.lang.AutoCloseable, SharedCloseable

      public class MmappedSegmentedFile
      extends SegmentedFile

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MmappedSegmentedFile.Builder` Overrides the default behaviour to create segments of a maximum size.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `MAX_SEGMENT_SIZE`

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

      `channel, length, onDiskLength`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MmappedSegmentedFile(ChannelProxy channel, long length, org.apache.cassandra.io.util.SegmentedFile.Segment[] segments)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long[]` | `copyReadableBounds()` Retrieve the readable bounds if any so they can be cloned into other files such as when downsampling an index summary.
    `FileDataInput` | `getSegment(long position)`
    `static boolean` | `maybeRepair(CFMetaData metadata, Descriptor descriptor, IndexSummary indexSummary, SegmentedFile.Builder ibuilder, SegmentedFile.Builder dbuilder)`
    `MmappedSegmentedFile` | `sharedCopy()`

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

      `createReader, createThrottledReader, dropPageCache, getBuilder, getCompressedBuilder, iterator, path, toString`

    - ### Methods inherited from class org.apache.cassandra.utils.concurrent.SharedCloseableImpl

      `close, close, isCleanedUp`

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

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

- - ### Field Detail

    - #### MAX_SEGMENT_SIZE

          public static long MAX_SEGMENT_SIZE

  - ### Constructor Detail

    - #### MmappedSegmentedFile

          public MmappedSegmentedFile(ChannelProxy channel,
                                      long length,
                                      org.apache.cassandra.io.util.SegmentedFile.Segment[] segments)

  - ### Method Detail

    - #### sharedCopy

          public MmappedSegmentedFile sharedCopy()

      Specified by:
        `sharedCopy` in interface `SharedCloseable`
      Specified by:
        `sharedCopy` in class `SegmentedFile`
      Returns:
        a new instance of the object representing the same state and backed by the same underlying resources. Coordinates with the original (and other instances) when the underlying resource should be closed. Throws an exception if the shared resource has already been closed.

    - #### getSegment

          public FileDataInput getSegment(long position)

      Overrides:
        `getSegment` in class `SegmentedFile`
      Returns:
        The segment containing the given position: must be closed after use.

    - #### copyReadableBounds

          public long[] copyReadableBounds()

      Description copied from class: `SegmentedFile`
      Retrieve the readable bounds if any so they can be cloned into other files such as when downsampling an index summary. Readable bounds are in between record locations in a file that are good positions for mapping the file such that records don't cross mappings.
      Overrides:
        `copyReadableBounds` in class `SegmentedFile`

    - #### maybeRepair

          public static boolean maybeRepair(CFMetaData metadata,
                                            Descriptor descriptor,
                                            IndexSummary indexSummary,
                                            SegmentedFile.Builder ibuilder,
                                            SegmentedFile.Builder dbuilder)

Copyright © 2018 The Apache Software Foundation