Package 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
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.-
Field Summary
Fields inherited from class org.apache.lucene.index.NumericDocValues
EMPTY
-
Constructor Summary
ConstructorDescriptionPagedMutable
(long size, int pageSize, int bitsPerValue, float acceptableOverheadRatio) Create a newPagedMutable
instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal long
get
(long index) Get value atindex
.final PagedMutable
grow()
Similar toArrayUtil.grow(long[])
.final PagedMutable
grow
(long minSize) Similar toArrayUtil.grow(long[], int)
.long
Return the number of bytes used by this object.final PagedMutable
resize
(long newSize) Create a new copy of sizenewSize
based on the content of this buffer.final void
set
(long index, long value) Set value atindex
.final long
size()
The number of values.final String
toString()
Methods inherited from class org.apache.lucene.util.LongValues
get
-
Constructor Details
-
PagedMutable
public PagedMutable(long size, int pageSize, int bitsPerValue, float acceptableOverheadRatio) Create a newPagedMutable
instance.- Parameters:
size
- the number of values to store.pageSize
- the number of values per pagebitsPerValue
- the number of bits per valueacceptableOverheadRatio
- an acceptable overhead ratio
-
-
Method Details
-
size
public final long size()The number of values. -
get
public final long get(long index) Description copied from class:LongValues
Get value atindex
.- Specified by:
get
in classLongValues
-
set
public final void set(long index, long value) Set value atindex
. -
ramBytesUsed
public long ramBytesUsed()Return the number of bytes used by this object. -
resize
Create a new copy of sizenewSize
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
Similar toArrayUtil.grow(long[], int)
. -
grow
Similar toArrayUtil.grow(long[])
. -
toString
-