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 String
name
IndexOutput
out
-
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 void
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 writerPointReader
getReader(long start, long length)
Returns aPointReader
iterator to step through all previously added pointsprotected OfflinePointReader
getReader(long start, long length, byte[] reusableBuffer)
String
toString()
-
-
-
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 IOException
Description copied from interface:PointWriter
Add a new point from the packed value and docId- Specified by:
append
in interfacePointWriter
- Throws:
IOException
-
append
public void append(PointValue pointValue) throws IOException
Description copied from interface:PointWriter
Add a new point from aPointValue
- Specified by:
append
in interfacePointWriter
- Throws:
IOException
-
getReader
public PointReader getReader(long start, long length) throws IOException
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
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
destroy
public void destroy() throws IOException
Description copied from interface:PointWriter
Removes any temp files behind this writer- Specified by:
destroy
in interfacePointWriter
- Throws:
IOException
-
-