org.apache.lucene.util.packed

## Class PagedMutable

- java.lang.Object
- - org.apache.lucene.index.NumericDocValues
  - - org.apache.lucene.util.LongValues
    - - org.apache.lucene.util.packed.PagedMutable

- All Implemented Interfaces:
    Accountable

      public final class PagedMutable
      extends LongValues

  A `PagedMutable`. This class slices data into fixed-size blocks which have the same number of bits per value. It can be a useful replacement for `PackedInts.Mutable` to store more than 2B values.
  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.util.LongValues

      `IDENTITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PagedMutable(long size, int pageSize, int bitsPerValue, float acceptableOverheadRatio)` Create a new `PagedMutable` instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected long` | `baseRamBytesUsed()`
    `protected void` | `fillPages()`
    `long` | `get(long index)` Get value at `index`.
    `T` | `grow()` Similar to `ArrayUtil.grow(long[])`.
    `T` | `grow(long minSize)` Similar to `ArrayUtil.grow(long[], int)`.
    `protected PackedInts.Mutable` | `newMutable(int valueCount, int bitsPerValue)`
    `protected PagedMutable` | `newUnfilledCopy(long newSize)`
    `long` | `ramBytesUsed()` Return the memory usage of this object in bytes.
    `T` | `resize(long newSize)` Create a new copy of size `newSize` based on the content of this buffer.
    `void` | `set(long index, long value)` Set value at `index`.
    `long` | `size()` The number of values.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.lucene.util.LongValues

      `get`

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

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

    - ### Methods inherited from interface org.apache.lucene.util.Accountable

      `getChildResources`

- - ### Constructor Detail

    - #### PagedMutable

          public PagedMutable(long size,
                              int pageSize,
                              int bitsPerValue,
                              float acceptableOverheadRatio)

      Create a new `PagedMutable` instance.
      Parameters:
        `size` - the number of values to store.
        `pageSize` - the number of values per page
        `bitsPerValue` - the number of bits per value
        `acceptableOverheadRatio` - an acceptable overhead ratio

  - ### Method Detail

    - #### newMutable

          protected PackedInts.Mutable newMutable(int valueCount,
                                                  int bitsPerValue)

    - #### newUnfilledCopy

          protected PagedMutable newUnfilledCopy(long newSize)

    - #### baseRamBytesUsed

          protected long baseRamBytesUsed()

    - #### fillPages

          protected final void fillPages()

    - #### size

          public final long size()

      The number of values.

    - #### get

          public final long get(long index)

      Description copied from class: `LongValues`
      Get value at `index`.
      Specified by:
        `get` in class `LongValues`

    - #### set

          public final void set(long index,
                                long value)

      Set value at `index`.

    - #### ramBytesUsed

          public long ramBytesUsed()

      Description copied from interface: `Accountable`
      Return the memory usage of this object in bytes. Negative values are illegal.
      Specified by:
        `ramBytesUsed` in interface `Accountable`

    - #### resize

          public final T resize(long newSize)

      Create a new copy of size `newSize` based on the content of this buffer. This method is much more efficient than creating a new instance and copying values one by one.

    - #### grow

          public final T grow(long minSize)

      Similar to `ArrayUtil.grow(long[], int)`.

    - #### grow

          public final T grow()

      Similar to `ArrayUtil.grow(long[])`.

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.