org.apache.lucene.util.packed

## Class PagedGrowableWriter

- java.lang.Object
- - org.apache.lucene.util.LongValues
  - - org.apache.lucene.util.packed.AbstractPagedMutable<PagedGrowableWriter>
    - - org.apache.lucene.util.packed.PagedGrowableWriter

- All Implemented Interfaces:
    Accountable

      public final class PagedGrowableWriter
      extends AbstractPagedMutable<PagedGrowableWriter>

  A `PagedGrowableWriter`. This class slices data into fixed-size blocks which have independent numbers of bits per value and grow on-demand.

  You should use this class instead of the `PackedLongValues` related ones only when you need random write-access. Otherwise this class will likely be slower and less memory-efficient.

  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, ZEROES`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected long` | `baseRamBytesUsed()`
    `protected PackedInts.Mutable` | `newMutable(int valueCount, int bitsPerValue)`
    `protected PagedGrowableWriter` | `newUnfilledCopy(long newSize)`

    - ### Methods inherited from class org.apache.lucene.util.packed.AbstractPagedMutable

      `fillPages, get, grow, grow, ramBytesUsed, resize, set, size, toString`

    - ### 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

    - #### PagedGrowableWriter

          public PagedGrowableWriter(long size,
                                     int pageSize,
                                     int startBitsPerValue,
                                     float acceptableOverheadRatio)

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

  - ### Method Detail

    - #### newMutable

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

      Specified by:
        `newMutable` in class `AbstractPagedMutable<PagedGrowableWriter>`

    - #### newUnfilledCopy

          protected PagedGrowableWriter newUnfilledCopy(long newSize)

      Specified by:
        `newUnfilledCopy` in class `AbstractPagedMutable<PagedGrowableWriter>`

    - #### baseRamBytesUsed

          protected long baseRamBytesUsed()

      Overrides:
        `baseRamBytesUsed` in class `AbstractPagedMutable<PagedGrowableWriter>`

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