Package org.apache.lucene.util.packed
Packed integer arrays and streams.
The packed package provides
- sequential and random access capable arrays of positive longs,
- routines for efficient serialization and deserialization of streams of packed integers.
The main access point is the PackedInts
factory.
In-memory structures
PackedInts.Mutable
- Only supports positive longs.
- Requires the number of bits per value to be known in advance.
- Random-access for both writing and reading.
GrowableWriter
- Same as PackedInts.Mutable but grows the number of bits per values when needed.
- Useful to build a PackedInts.Mutable from a read-once stream of longs.
PagedGrowableWriter
- Slices data into fixed-size blocks stored in GrowableWriters.
- Supports more than 2B values.
- You should use PackedLongValues instead if you don't need random write access.
PackedLongValues.deltaPackedBuilder(int, float)
- Can store any sequence of longs.
- Compression is good when values are close to each other.
- Supports random reads, but only sequential writes.
- Can address up to 2^42 values.
PackedLongValues.packedBuilder(int, float)
- Same as deltaPackedBuilder but assumes values are 0-based.
PackedLongValues.monotonicBuilder(int, float)
- Same as deltaPackedBuilder except that compression is good when the stream is a succession of affine functions.
Disk-based structures
PackedInts.Writer
,PackedInts.Reader
,PackedInts.ReaderIterator
- Only supports positive longs.
- Requires the number of bits per value to be known in advance.
- Supports both fast sequential access with low memory footprint with ReaderIterator and random-access by either loading values in memory or leaving them on disk with Reader.
BlockPackedWriter
,BlockPackedReaderIterator
- Splits the stream into fixed-size blocks.
- Compression is good when values are close to each other.
- Can address up to 2B * blockSize values.
MonotonicBlockPackedWriter
,MonotonicBlockPackedReader
- Same as the non-monotonic variants except that compression is good when the stream is a succession of affine functions.
- The reason why there is no sequential access is that if you need sequential access, you should rather delta-encode and use BlockPackedWriter.
PackedDataOutput
,PackedDataInput
- Writes sequences of longs where each long can use any number of bits.
-
Interface Summary Interface Description PackedInts.Decoder A decoder for packed integers.PackedInts.Encoder An encoder for packed integers.PackedInts.ReaderIterator Run-once iterator interface, to decode previously saved PackedInts. -
Class Summary Class Description AbstractBlockPackedWriter AbstractPagedMutable<T extends AbstractPagedMutable<T>> Base implementation forPagedMutable
andPagedGrowableWriter
.BlockPackedReaderIterator Reader for sequences of longs written withBlockPackedWriter
.BlockPackedWriter A writer for large sequences of longs.BulkOperation Efficient sequential read/write of packed integers.BulkOperationPacked Non-specializedBulkOperation
forPackedInts.Format.PACKED
.BulkOperationPacked1 Efficient sequential read/write of packed integers.BulkOperationPacked10 Efficient sequential read/write of packed integers.BulkOperationPacked11 Efficient sequential read/write of packed integers.BulkOperationPacked12 Efficient sequential read/write of packed integers.BulkOperationPacked13 Efficient sequential read/write of packed integers.BulkOperationPacked14 Efficient sequential read/write of packed integers.BulkOperationPacked15 Efficient sequential read/write of packed integers.BulkOperationPacked16 Efficient sequential read/write of packed integers.BulkOperationPacked17 Efficient sequential read/write of packed integers.BulkOperationPacked18 Efficient sequential read/write of packed integers.BulkOperationPacked19 Efficient sequential read/write of packed integers.BulkOperationPacked2 Efficient sequential read/write of packed integers.BulkOperationPacked20 Efficient sequential read/write of packed integers.BulkOperationPacked21 Efficient sequential read/write of packed integers.BulkOperationPacked22 Efficient sequential read/write of packed integers.BulkOperationPacked23 Efficient sequential read/write of packed integers.BulkOperationPacked24 Efficient sequential read/write of packed integers.BulkOperationPacked3 Efficient sequential read/write of packed integers.BulkOperationPacked4 Efficient sequential read/write of packed integers.BulkOperationPacked5 Efficient sequential read/write of packed integers.BulkOperationPacked6 Efficient sequential read/write of packed integers.BulkOperationPacked7 Efficient sequential read/write of packed integers.BulkOperationPacked8 Efficient sequential read/write of packed integers.BulkOperationPacked9 Efficient sequential read/write of packed integers.BulkOperationPackedSingleBlock Non-specializedBulkOperation
forPackedInts.Format.PACKED_SINGLE_BLOCK
.DeltaPackedLongValues DeltaPackedLongValues.Builder DirectMonotonicReader Retrieves an instance previously written byDirectMonotonicWriter
.DirectMonotonicReader.Meta In-memory metadata that needs to be kept around forDirectMonotonicReader
to read data from disk.DirectMonotonicWriter Write monotonically-increasing sequences of integers.DirectPacked64SingleBlockReader DirectPackedReader DirectReader Retrieves an instance previously written byDirectWriter
DirectReader.DirectPackedReader1 DirectReader.DirectPackedReader12 DirectReader.DirectPackedReader16 DirectReader.DirectPackedReader2 DirectReader.DirectPackedReader20 DirectReader.DirectPackedReader24 DirectReader.DirectPackedReader28 DirectReader.DirectPackedReader32 DirectReader.DirectPackedReader4 DirectReader.DirectPackedReader40 DirectReader.DirectPackedReader48 DirectReader.DirectPackedReader56 DirectReader.DirectPackedReader64 DirectReader.DirectPackedReader8 DirectWriter Class for writing packed integers to be directly read from Directory.GrowableWriter ImplementsPackedInts.Mutable
, but grows the bit count of the underlying packed ints on-demand.MonotonicBlockPackedReader Provides random access to a stream written withMonotonicBlockPackedWriter
.MonotonicBlockPackedWriter A writer for large monotonically increasing sequences of positive longs.MonotonicLongValues MonotonicLongValues.Builder Packed64 Space optimized random access capable array of values with a fixed number of bits/value.Packed64SingleBlock This class is similar toPacked64
except that it trades space for speed by ensuring that a single block needs to be read/written in order to read/write a value.Packed64SingleBlock.Packed64SingleBlock1 Packed64SingleBlock.Packed64SingleBlock10 Packed64SingleBlock.Packed64SingleBlock12 Packed64SingleBlock.Packed64SingleBlock16 Packed64SingleBlock.Packed64SingleBlock2 Packed64SingleBlock.Packed64SingleBlock21 Packed64SingleBlock.Packed64SingleBlock3 Packed64SingleBlock.Packed64SingleBlock32 Packed64SingleBlock.Packed64SingleBlock4 Packed64SingleBlock.Packed64SingleBlock5 Packed64SingleBlock.Packed64SingleBlock6 Packed64SingleBlock.Packed64SingleBlock7 Packed64SingleBlock.Packed64SingleBlock8 Packed64SingleBlock.Packed64SingleBlock9 PackedDataInput ADataInput
wrapper to read unaligned, variable-length packed integers.PackedDataOutput ADataOutput
wrapper to write unaligned, variable-length packed integers.PackedInts Simplistic compression for array of unsigned long values.PackedInts.FormatAndBits Simple class that holds a format and a number of bits per value.PackedInts.Mutable A packed integer array that can be modified.PackedInts.MutableImpl PackedInts.NullReader APackedInts.Reader
which has all its values equal to 0 (bitsPerValue = 0).PackedInts.Reader A read-only random access array of positive integers.PackedInts.ReaderImpl A simple base for Readers that keeps track of valueCount and bitsPerValue.PackedInts.ReaderIteratorImpl PackedInts.Writer A write-once Writer.PackedLongValues Utility class to compress integers into aLongValues
instance.PackedLongValues.Builder A Builder for aPackedLongValues
instance.PackedReaderIterator PackedWriter PagedGrowableWriter PagedMutable APagedMutable
. -
Enum Summary Enum Description PackedInts.Format A format to write packed ints.