Package org.apache.lucene.util.bkd
Class OfflinePointWriter
- java.lang.Object
-
- org.apache.lucene.util.bkd.OfflinePointWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PointWriter
public final class OfflinePointWriter extends Object implements 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 Modifier and Type Field Description StringnameIndexOutputout
-
Constructor Summary
Constructors Constructor Description OfflinePointWriter(BKDConfig config, Directory tempDir, String tempFileNamePrefix, String desc, long expectedCount)Create a new writer with an unknown number of incoming points
-
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()longcount()Return the number of points in this writervoiddestroy()Removes any temp files behind this writerPointReadergetReader(long start, long length)Returns aPointReaderiterator to step through all previously added pointsprotected OfflinePointReadergetReader(long start, long length, byte[] reusableBuffer)StringtoString()
-
-
-
Field Detail
-
out
public final IndexOutput out
-
name
public final String name
-
-
Constructor Detail
-
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 Detail
-
append
public void append(byte[] packedValue, int docID) throws IOExceptionDescription copied from interface:PointWriterAdd a new point from the packed value and docId- Specified by:
appendin interfacePointWriter- Throws:
IOException
-
append
public void append(PointValue pointValue) throws IOException
Description copied from interface:PointWriterAdd a new point from aPointValue- Specified by:
appendin interfacePointWriter- Throws:
IOException
-
getReader
public PointReader getReader(long start, long length) throws IOException
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
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
destroy
public void destroy() throws IOExceptionDescription copied from interface:PointWriterRemoves any temp files behind this writer- Specified by:
destroyin interfacePointWriter- Throws:
IOException
-
-