Package org.apache.lucene.util.bkd
Class HeapPointWriter
- java.lang.Object
-
- org.apache.lucene.util.bkd.HeapPointWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,PointWriter
public final class HeapPointWriter extends Object implements PointWriter
Utility class to write new points into in-heap arrays.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description HeapPointWriter(int initSize, int maxSize, int packedBytesLength, boolean longOrds, boolean singleValuePerDoc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(byte[] packedValue, long ord, int docID)
Add a new pointvoid
close()
void
copyFrom(HeapPointWriter other)
void
destroy()
Removes any temp files behind this writervoid
getPackedValueSlice(int index, BytesRef result)
Returns a reference, inresult
, to the byte[] slice holding this valuePointReader
getReader(long start, long length)
Returns aPointReader
iterator to step through all previously added pointsPointReader
getSharedReader(long start, long length, List<Closeable> toCloseHeroically)
Returns the single shared reader, used at multiple times during the recursion, to read previously added pointsvoid
readPackedValue(int index, byte[] bytes)
String
toString()
-
-
-
Field Detail
-
docIDs
public int[] docIDs
-
ordsLong
public long[] ordsLong
-
ords
public int[] ords
-
valuesPerBlock
public final int valuesPerBlock
-
blocks
public final List<byte[]> blocks
-
-
Method Detail
-
copyFrom
public void copyFrom(HeapPointWriter other)
-
readPackedValue
public void readPackedValue(int index, byte[] bytes)
-
getPackedValueSlice
public void getPackedValueSlice(int index, BytesRef result)
Returns a reference, inresult
, to the byte[] slice holding this value
-
append
public void append(byte[] packedValue, long ord, int docID)
Description copied from interface:PointWriter
Add a new point- Specified by:
append
in interfacePointWriter
-
getReader
public PointReader getReader(long start, long length)
Description copied from interface:PointWriter
Returns aPointReader
iterator to step through all previously added points- Specified by:
getReader
in interfacePointWriter
-
getSharedReader
public PointReader getSharedReader(long start, long length, List<Closeable> toCloseHeroically)
Description copied from interface:PointWriter
Returns the single shared reader, used at multiple times during the recursion, to read previously added points- Specified by:
getSharedReader
in interfacePointWriter
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
destroy
public void destroy()
Description copied from interface:PointWriter
Removes any temp files behind this writer- Specified by:
destroy
in interfacePointWriter
-
-