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.
-
-
Field Summary
Fields Modifier and Type Field Description byte[]block
-
Constructor Summary
Constructors Constructor Description HeapPointWriter(BKDConfig config, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(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 writerPointValuegetPackedValueSlice(int index)Returns a reference, inresult, to the byte[] slice holding this valuePointReadergetReader(long start, long length)Returns aPointReaderiterator to step through all previously added pointsvoidswap(int i, int j)StringtoString()
-
-
-
Constructor Detail
-
HeapPointWriter
public HeapPointWriter(BKDConfig config, int size)
-
-
Method Detail
-
getPackedValueSlice
public PointValue getPackedValueSlice(int index)
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
public void append(PointValue pointValue)
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
public PointReader getReader(long start, long length)
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
-
-