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
-
Constructor Summary
ConstructorDescriptionOfflinePointWriter
(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 TypeMethodDescriptionvoid
append
(byte[] packedValue, int docID) Add a new point from the packed value and docIdvoid
append
(PointValue pointValue) Add a new point from aPointValue
void
close()
long
count()
Return the number of points in this writervoid
destroy()
Removes any temp files behind this writergetReader
(long start, long length) Returns aPointReader
iterator to step through all previously added pointsprotected OfflinePointReader
getReader
(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:PointWriter
Add a new point from the packed value and docId- Specified by:
append
in interfacePointWriter
- Throws:
IOException
-
append
Description copied from interface:PointWriter
Add a new point from aPointValue
- Specified by:
append
in interfacePointWriter
- Throws:
IOException
-
getReader
Description copied from interface:PointWriter
Returns aPointReader
iterator to step through all previously added points- Specified by:
getReader
in 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:PointWriter
Return the number of points in this writer- Specified by:
count
in interfacePointWriter
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
destroy
Description copied from interface:PointWriter
Removes any temp files behind this writer- Specified by:
destroy
in interfacePointWriter
- Throws:
IOException
-
toString
-