java.lang.Object
org.apache.lucene.util.packed.AbstractBlockPackedWriter
- Direct Known Subclasses:
BlockPackedWriter,MonotonicBlockPackedWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[](package private) static final intprotected boolean(package private) static final int(package private) static final int(package private) static final intprotected intprotected longprotected DataOutputprotected final long[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractBlockPackedWriter(DataOutput out, int blockSize) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(long l) Append a new long.(package private) voidprivate voidvoidfinish()Flush all buffered data to disk.protected abstract voidflush()longord()Return the number of values which have been added.voidreset(DataOutput out) Reset this writer to wrapout.protected final voidwriteValues(int bitsRequired) (package private) static voidwriteVLong(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
-