- java.lang.Object
-
- org.apache.lucene.util.PagedBytes.Reader
-
- All Implemented Interfaces:
Accountable
- Enclosing class:
- PagedBytes
public static final class PagedBytes.Reader extends java.lang.Object implements Accountable
Provides methods to read BytesRefs from a frozen PagedBytes.- See Also:
PagedBytes.freeze(boolean)
-
-
Field Summary
Fields Modifier and Type Field Description private static long
BASE_RAM_BYTES_USED
private int
blockBits
private int
blockMask
private byte[][]
blocks
private int
blockSize
private long
bytesUsedPerBlock
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Reader(PagedBytes pagedBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fill(BytesRef b, long start)
Reads length as 1 or 2 byte vInt prefix, starting at start.void
fillSlice(BytesRef b, long start, int length)
Gets a slice out ofPagedBytes
starting at start with a given length.byte
getByte(long o)
Get the byte at the given offset.long
ramBytesUsed()
Return the memory usage of this object in bytes.java.lang.String
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
-
Reader
private Reader(PagedBytes pagedBytes)
-
-
Method Detail
-
fillSlice
public void fillSlice(BytesRef b, long start, int length)
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
public void fill(BytesRef b, long start)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-