Class MonotonicBlockPackedWriter
- java.lang.Object
-
- org.apache.cassandra.index.sai.disk.v1.bitpack.AbstractBlockPackedWriter
-
- org.apache.cassandra.index.sai.disk.v1.bitpack.MonotonicBlockPackedWriter
-
public class MonotonicBlockPackedWriter extends AbstractBlockPackedWriter
A writer for large monotonically increasing sequences of positive longs. The writer is optimised for monotonic sequences and stores values as a series of deltas from an expected value. The expected value is calculated from the minimum value in the block and the average delta for the block. This means that stored values are generally smaller and can be packed into a smaller number of bits, allowing for larger block sizes. Modified copy ofMonotonicBlockPackedWriter
to useDirectWriter
for optimised reads that doesn't require seeking through the whole file to open a thread-exclusive reader.
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.index.sai.disk.v1.bitpack.AbstractBlockPackedWriter
blockIndex, blockMetaWriter, blockValues, finished, indexOutput
-
-
Constructor Summary
Constructors Constructor Description MonotonicBlockPackedWriter(org.apache.lucene.store.IndexOutput out, int blockSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long l)
Append a new long.protected void
flushBlock()
-
Methods inherited from class org.apache.cassandra.index.sai.disk.v1.bitpack.AbstractBlockPackedWriter
finish
-
-
-
-
Method Detail
-
add
public void add(long l) throws java.io.IOException
Description copied from class:AbstractBlockPackedWriter
Append a new long.- Overrides:
add
in classAbstractBlockPackedWriter
- Throws:
java.io.IOException
-
flushBlock
protected void flushBlock() throws java.io.IOException
- Specified by:
flushBlock
in classAbstractBlockPackedWriter
- Throws:
java.io.IOException
-
-