java.lang.Object
org.apache.lucene.util.packed.BulkOperation
- All Implemented Interfaces:
PackedInts.Decoder,PackedInts.Encoder
- Direct Known Subclasses:
BulkOperationPacked,BulkOperationPackedSingleBlock
Efficient sequential read/write of packed integers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BulkOperation[]private static final BulkOperation[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intcomputeIterations(int valueCount, int ramBudget) For every number of bits per value, there is a minimum number of blocks (b) / values (v) you need to write in order to reach the next block boundary:static BulkOperationof(PackedInts.Format format, int bitsPerValue) protected intwriteLong(long block, byte[] blocks, int blocksOffset) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.packed.PackedInts.Decoder
byteBlockCount, byteValueCount, decode, decode, decode, decode, longBlockCount, longValueCountMethods inherited from interface org.apache.lucene.util.packed.PackedInts.Encoder
byteBlockCount, byteValueCount, encode, encode, encode, encode, longBlockCount, longValueCount
-
Field Details
-
packedBulkOps
-
packedSingleBlockBulkOps
-
-
Constructor Details
-
BulkOperation
BulkOperation()
-
-
Method Details
-
of
-
writeLong
protected int writeLong(long block, byte[] blocks, int blocksOffset) -
computeIterations
public final int computeIterations(int valueCount, int ramBudget) For every number of bits per value, there is a minimum number of blocks (b) / values (v) you need to write in order to reach the next block boundary:- 16 bits per value -> b=2, v=1 - 24 bits per value -> b=3, v=1 - 50 bits per value -> b=25, v=4 - 63 bits per value -> b=63, v=8 - ...
A bulk read consists in copyingiterations*vvalues that are contained initerations*bblocks into along[](higher values ofiterationsare likely to yield a better throughput): this requires n * (b + 8v) bytes of memory.This method computes
iterationsasramBudget / (b + 8v)(since a long is 8 bytes).
-