Package org.apache.lucene.util
Class PagedBytes.Reader
java.lang.Object
org.apache.lucene.util.PagedBytes.Reader
- All Implemented Interfaces:
Accountable
- Enclosing class:
- PagedBytes
Provides methods to read BytesRefs from a frozen PagedBytes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
private final int
private final int
private final byte[][]
private final int
private final long
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Reads length as 1 or 2 byte vInt prefix, starting at start.void
Gets a slice out ofPagedBytes
starting at start with a given length.byte
getByte
(long o) Get the byte at the given offset.long
Return the memory usage of this object in bytes.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
-
Field Details
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED -
blocks
private final byte[][] blocks -
blockBits
private final int blockBits -
blockMask
private final int blockMask -
blockSize
private final int blockSize -
bytesUsedPerBlock
private final long bytesUsedPerBlock
-
-
Constructor Details
-
Reader
-
-
Method Details
-
fillSlice
Gets a slice out ofPagedBytes
starting at start with a given length. Iff the slice spans across a block border this method will allocate sufficient resources and copy the paged data.Slices spanning more than two blocks are not supported.
-
getByte
public byte getByte(long o) Get the byte at the given offset. -
fill
Reads length as 1 or 2 byte vInt prefix, starting at start.Note: this method does not support slices spanning across block borders.
-
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 interfaceAccountable
-
toString
-