java.lang.Object
org.apache.lucene.util.bkd.HeapPointWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,PointWriter
Utility class to write new points into in-heap arrays.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal byte[]private boolean(package private) final BKDConfigprivate intprivate HeapPointReader.HeapPointValueprivate final byte[](package private) final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(byte[] packedValue, int docID) Add a new point from the packed value and docIdvoidappend(PointValue pointValue) Add a new point from aPointValuevoidclose()intcomputeCardinality(int from, int to, int[] commonPrefixLengths) longcount()Return the number of points in this writervoiddestroy()Removes any temp files behind this writergetPackedValueSlice(int index) Returns a reference, inresult, to the byte[] slice holding this valuegetReader(long start, long length) Returns aPointReaderiterator to step through all previously added pointsvoidswap(int i, int j) toString()
-
Field Details
-
block
public final byte[] block -
size
final int size -
config
-
scratch
private final byte[] scratch -
nextWrite
private int nextWrite -
closed
private boolean closed -
pointValue
-
-
Constructor Details
-
HeapPointWriter
-
-
Method Details
-
getPackedValueSlice
Returns a reference, inresult, to the byte[] slice holding this value -
append
public void append(byte[] packedValue, int docID) Description copied from interface:PointWriterAdd a new point from the packed value and docId- Specified by:
appendin interfacePointWriter
-
append
Description copied from interface:PointWriterAdd a new point from aPointValue- Specified by:
appendin interfacePointWriter
-
swap
public void swap(int i, int j) -
computeCardinality
public int computeCardinality(int from, int to, int[] commonPrefixLengths) -
count
public long count()Description copied from interface:PointWriterReturn the number of points in this writer- Specified by:
countin interfacePointWriter
-
getReader
Description copied from interface:PointWriterReturns aPointReaderiterator to step through all previously added points- Specified by:
getReaderin 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
-
toString
-