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 voidappend(byte[] packedValue, long ord, int docID)Add a new pointvoidclose()voidcopyFrom(HeapPointWriter other)voiddestroy()Removes any temp files behind this writervoidgetPackedValueSlice(int index, BytesRef result)Returns a reference, inresult, to the byte[] slice holding this valuePointReadergetReader(long start, long length)Returns aPointReaderiterator to step through all previously added pointsPointReadergetSharedReader(long start, long length, List<Closeable> toCloseHeroically)Returns the single shared reader, used at multiple times during the recursion, to read previously added pointsvoidreadPackedValue(int index, byte[] bytes)StringtoString()
-
-
-
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:PointWriterAdd a new point- Specified by:
appendin interfacePointWriter
-
getReader
public PointReader getReader(long start, long length)
Description copied from interface:PointWriterReturns aPointReaderiterator to step through all previously added points- Specified by:
getReaderin interfacePointWriter
-
getSharedReader
public PointReader getSharedReader(long start, long length, List<Closeable> toCloseHeroically)
Description copied from interface:PointWriterReturns the single shared reader, used at multiple times during the recursion, to read previously added points- Specified by:
getSharedReaderin interfacePointWriter
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
destroy
public void destroy()
Description copied from interface:PointWriterRemoves any temp files behind this writer- Specified by:
destroyin interfacePointWriter
-
-