org.apache.cassandra.io.util

## Class MmappedRegions.Region

- java.lang.Object
- - org.apache.cassandra.io.util.MmappedRegions.Region

- All Implemented Interfaces:
    Rebufferer.BufferHolder
  Enclosing class:
    MmappedRegions

      public static final class MmappedRegions.Region
      extends java.lang.Object
      implements Rebufferer.BufferHolder

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.nio.ByteBuffer` | `buffer`
    `long` | `offset`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Region(long offset, java.nio.ByteBuffer buffer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.nio.ByteBuffer` | `buffer()` Returns a useable buffer (i.e.
    `long` | `end()`
    `long` | `offset()` Position in the file of the start of the buffer.
    `void` | `release()` To be called when this buffer is no longer in use.

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

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

- - ### Field Detail

    - #### offset

          public final long offset

    - #### buffer

          public final java.nio.ByteBuffer buffer

  - ### Constructor Detail

    - #### Region

          public Region(long offset,
                        java.nio.ByteBuffer buffer)

  - ### Method Detail

    - #### buffer

          public java.nio.ByteBuffer buffer()

      Description copied from interface: `Rebufferer.BufferHolder`
      Returns a useable buffer (i.e. one whose position and limit can be freely modified). Its limit will be set to the size of the available data in the buffer. The buffer must be treated as read-only.
      Specified by:
        `buffer` in interface `Rebufferer.BufferHolder`

    - #### offset

          public long offset()

      Description copied from interface: `Rebufferer.BufferHolder`
      Position in the file of the start of the buffer.
      Specified by:
        `offset` in interface `Rebufferer.BufferHolder`

    - #### end

          public long end()

    - #### release

          public void release()

      Description copied from interface: `Rebufferer.BufferHolder`
      To be called when this buffer is no longer in use. Must be called for all BufferHolders, or ChunkCache will not be able to free blocks.
      Specified by:
        `release` in interface `Rebufferer.BufferHolder`

Copyright © 2018 The Apache Software Foundation