Package org.apache.lucene.util.bkd
Class OfflinePointWriter
java.lang.Object
org.apache.lucene.util.bkd.OfflinePointWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,PointWriter
Writes points to disk in a fixed-with format.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOfflinePointWriter(BKDConfig config, Directory tempDir, String tempFileNamePrefix, String desc, long expectedCount) Create a new writer with an unknown number of incoming points -
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()longcount()Return the number of points in this writervoiddestroy()Removes any temp files behind this writergetReader(long start, long length) Returns aPointReaderiterator to step through all previously added pointsprotected OfflinePointReadergetReader(long start, long length, byte[] reusableBuffer) toString()
-
Field Details
-
out
-
name
-
-
Constructor Details
-
OfflinePointWriter
public OfflinePointWriter(BKDConfig config, Directory tempDir, String tempFileNamePrefix, String desc, long expectedCount) throws IOException Create a new writer with an unknown number of incoming points- Throws:
IOException
-
-
Method Details
-
append
Description copied from interface:PointWriterAdd a new point from the packed value and docId- Specified by:
appendin interfacePointWriter- Throws:
IOException
-
append
Description copied from interface:PointWriterAdd a new point from aPointValue- Specified by:
appendin interfacePointWriter- Throws:
IOException
-
getReader
Description copied from interface:PointWriterReturns aPointReaderiterator to step through all previously added points- Specified by:
getReaderin interfacePointWriter- Throws:
IOException
-
getReader
protected OfflinePointReader getReader(long start, long length, byte[] reusableBuffer) throws IOException - Throws:
IOException
-
count
public long count()Description copied from interface:PointWriterReturn the number of points in this writer- Specified by:
countin interfacePointWriter
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
destroy
Description copied from interface:PointWriterRemoves any temp files behind this writer- Specified by:
destroyin interfacePointWriter- Throws:
IOException
-
toString
-