public final class OfflinePointWriter extends java.lang.Object implements PointWriter
| Modifier and Type | Field and Description |
|---|---|
private boolean |
closed |
(package private) long |
count |
(package private) long |
expectedCount |
java.lang.String |
name |
IndexOutput |
out |
(package private) int |
packedBytesLength |
(package private) Directory |
tempDir |
| Constructor and Description |
|---|
OfflinePointWriter(Directory tempDir,
java.lang.String tempFileNamePrefix,
int packedBytesLength,
java.lang.String desc,
long expectedCount)
Create a new writer with an unknown number of incoming points
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(byte[] packedValue,
int docID)
Add a new point from the packed value and docId
|
void |
append(PointValue pointValue)
Add a new point from a
PointValue |
void |
close() |
long |
count()
Return the number of points in this writer
|
void |
destroy()
Removes any temp files behind this writer
|
PointReader |
getReader(long start,
long length)
Returns a
PointReader iterator to step through all previously added points |
protected OfflinePointReader |
getReader(long start,
long length,
byte[] reusableBuffer) |
java.lang.String |
toString() |
final Directory tempDir
public final IndexOutput out
public final java.lang.String name
final int packedBytesLength
long count
private boolean closed
final long expectedCount
public OfflinePointWriter(Directory tempDir, java.lang.String tempFileNamePrefix, int packedBytesLength, java.lang.String desc, long expectedCount) throws java.io.IOException
java.io.IOExceptionpublic void append(byte[] packedValue,
int docID)
throws java.io.IOException
PointWriterappend in interface PointWriterjava.io.IOExceptionpublic void append(PointValue pointValue) throws java.io.IOException
PointWriterPointValueappend in interface PointWriterjava.io.IOExceptionpublic PointReader getReader(long start, long length) throws java.io.IOException
PointWriterPointReader iterator to step through all previously added pointsgetReader in interface PointWriterjava.io.IOExceptionprotected OfflinePointReader getReader(long start, long length, byte[] reusableBuffer) throws java.io.IOException
java.io.IOExceptionpublic long count()
PointWritercount in interface PointWriterpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void destroy()
throws java.io.IOException
PointWriterdestroy in interface PointWriterjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object