package
0.0.0-20240905174813-5b86810c7bc7
Repository: https://github.com/geange/lucene-go.git
Documentation: pkg.go.dev

# README

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 implementations provide different trade-offs between memory usage and access speed. The standard usage scenario is replacing large int or long arrays in order to reduce the memory footprint.

In-memory structures

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

  • 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

  • Same as deltaPackedBuilder but assumes values are 0-based.

PackedLongValues.monotonicBuilder

  • Same as deltaPackedBuilder except that compression is good when the stream is a succession of affine functions.

Disk-based structures

Writer/Reader/ReaderIterator

  • Only supports positive longs.
  • Requires the number of bits per value to be known in advance.
  • Splits the stream into fixed-size blocks.
  • 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/BlockPackedReader/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.

# Packages

No description provided by the author
No description provided by the author

# Functions

BitsRequired Returns how many bits are required to hold values up to and including maxValue NOTE: This method returns at least 1.
No description provided by the author
CopyValues Copy src[srcPos:srcPos+len] into dest[destPos:destPos+len] using at most mem bytes.
CopyValuesWithBuffer Same as copy(PackedInts.Reader, int, PackedInts.Mutable, int, int, int) but using a pre-allocated buffer.
DefaultGetMutable Create a packed integer array with the given amount of values initialized to 0.
No description provided by the author
No description provided by the author
No description provided by the author
GetEncoder Get an PackedInts.Encoder.
No description provided by the author
No description provided by the author
No description provided by the author
NewBlockPackedReaderIterator Sole constructor.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewGrowableWriter startBitsPerValue: the initial number of bits per value, may grow depending on the data valueCount: the number of values acceptableOverheadRatio: an acceptable overhead ratio.
NewMonotonicBlockPackedReader IndexInput in, int packedIntsVersion, int blockSize, long valueCount, boolean direct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewPacked64 Creates an array with the internal structures adjusted for the given limits and initialized to 0.
No description provided by the author
No description provided by the author
NewPacked64V1 Creates an array with content retrieved from the given DataInput.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
COMPACT No memory overhead at all, but the returned implementation may be slow.
DEFAULT At most 25% memory overhead.
DEFAULT_BUFFER_SIZE Default amount of memory to use for bulk operations.
FAST At most 50% memory overhead, always select a reasonably fast implementation.
FASTEST At most 700% memory overhead, always select a direct implementation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
x % BLOCK_SIZE.
No description provided by the author
The #bits representing BLOCK_SIZE.
32 = int, 64 = long.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
SUPPORTED_BITS_PER_VALUE = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 21, 32}.

# Structs

No description provided by the author
BlockPackedReader Provides random access to a stream written with BlockPackedWriter.
BlockPackedReaderIterator Reader for sequences of longs written with BlockPackedWriter.
BlockPackedWriter A writer for large sequences of longs.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Direct8 Direct wrapping of 8-bits values to a backing array.
No description provided by the author
DirectPackedReader Reads directly from disk on each get just for back compat, use DirectReader/DirectWriter for more efficient impl.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DirectReader Retrieves an instance previously written by DirectWriter.
DirectWriter Class for writing packed integers to be directly read from Directory.
FixSizePagedMutable A FixSizePagedMutable.
No description provided by the author
FormatAndBits Simple class that holds a format and a number of bits per value.
GrowableWriter Implements Mutable, but grows the bit count of the underlying packed ints on-demand.
MonotonicBlockPackedReader Provides random access to a stream written with MonotonicBlockPackedWriter.
MonotonicBlockPackedWriter A writer for large monotonically increasing sequences of positive longs.
No description provided by the author
No description provided by the author
NullReader A PackedInts.PackedIntsReader which has all its values equal to 0 (bitsPerValue = 0).
Packed16ThreeBlocks Packs integers into 3 shorts (48 bits per value).
No description provided by the author
No description provided by the author
Packed8ThreeBlocks Packs integers into 3 bytes (24 bits per value).
PackedInts Simplistic compression for array of unsigned long values.
PackedLongValues compress integers into a PackedLongValues instance.
No description provided by the author
No description provided by the author
PagedGrowableWriter A PagedGrowableWriter.

# Interfaces

No description provided by the author
Decoder A decoder for packed integers.
Encoder An encoder for packed integers.
No description provided by the author
No description provided by the author
No description provided by the author
Mutable A packed integer array that can be modified.
No description provided by the author
No description provided by the author
No description provided by the author
Reader A read-only random access array of positive integers.
ReaderIterator Run-once iterator interface, to decode previously saved PackedInts.
Writer A write-once Writer.
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author