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
-
public final class PagedMutable extends LongValues
APagedMutable
. This class slices data into fixed-size blocks which have the same number of bits per value. It can be a useful replacement forPackedInts.Mutable
to store more than 2B values.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.index.NumericDocValues
EMPTY
-
-
Constructor Summary
Constructors Constructor Description PagedMutable(long size, int pageSize, int bitsPerValue, float acceptableOverheadRatio)
Create a newPagedMutable
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
baseRamBytesUsed()
protected void
fillPages()
long
get(long index)
Get value atindex
.T
grow()
Similar toArrayUtil.grow(long[])
.T
grow(long minSize)
Similar toArrayUtil.grow(long[], int)
.protected PackedInts.Mutable
newMutable(int valueCount, int bitsPerValue)
protected PagedMutable
newUnfilledCopy(long newSize)
long
ramBytesUsed()
Return the number of bytes used by this object.T
resize(long newSize)
Create a new copy of sizenewSize
based on the content of this buffer.void
set(long index, long value)
Set value atindex
.long
size()
The number of values.java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.util.LongValues
get
-
-
-
-
Constructor Detail
-
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 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 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
public final T resize(long newSize)
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
public final T grow(long minSize)
Similar toArrayUtil.grow(long[], int)
.
-
grow
public final T grow()
Similar toArrayUtil.grow(long[])
.
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-