Package org.apache.lucene.util.packed
Class AbstractBlockPackedWriter
java.lang.Object
org.apache.lucene.util.packed.AbstractBlockPackedWriter
- Direct Known Subclasses:
BlockPackedWriter
,MonotonicBlockPackedWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
(package private) static final int
protected boolean
(package private) static final int
(package private) static final int
(package private) static final int
protected int
protected long
protected DataOutput
protected final long[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractBlockPackedWriter
(DataOutput out, int blockSize) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(long l) Append a new long.(package private) void
private void
void
finish()
Flush all buffered data to disk.protected abstract void
flush()
long
ord()
Return the number of values which have been added.void
reset
(DataOutput out) Reset this writer to wrapout
.protected final void
writeValues
(int bitsRequired) (package private) static void
writeVLong
(DataOutput out, long i)
-
Field Details
-
MIN_BLOCK_SIZE
static final int MIN_BLOCK_SIZE- See Also:
-
MAX_BLOCK_SIZE
static final int MAX_BLOCK_SIZE- See Also:
-
MIN_VALUE_EQUALS_0
static final int MIN_VALUE_EQUALS_0- See Also:
-
BPV_SHIFT
static final int BPV_SHIFT- See Also:
-
out
-
values
protected final long[] values -
blocks
protected byte[] blocks -
off
protected int off -
ord
protected long ord -
finished
protected boolean finished
-
-
Constructor Details
-
AbstractBlockPackedWriter
Sole constructor.- Parameters:
blockSize
- the number of values of a single block, must be a multiple of64
-
-
Method Details
-
writeVLong
- Throws:
IOException
-
reset
Reset this writer to wrapout
. The block size remains unchanged. -
checkNotFinished
private void checkNotFinished() -
add
Append a new long.- Throws:
IOException
-
addBlockOfZeros
- Throws:
IOException
-
finish
Flush all buffered data to disk. This instance is not usable anymore after this method has been called untilreset(DataOutput)
has been called.- Throws:
IOException
-
ord
public long ord()Return the number of values which have been added. -
flush
- Throws:
IOException
-
writeValues
- Throws:
IOException
-