GroupVIntUtil

This class contains utility methods and constants for group varint

Types

Link copied to clipboard
fun interface IntReader

Provides an abstraction for read int values, so that decoding logic can be reused in different DataInput.

Properties

Link copied to clipboard
const val MAX_LENGTH_PER_GROUP: Int = 17

Functions

Link copied to clipboard
fun readGroupVInt(in: DataInput, dst: IntArray, offset: Int)
fun readGroupVInt(in: DataInput, dst: LongArray, offset: Int)

Default implementation of read single group, for optimal performance, you should use instead.

fun readGroupVInt(in: DataInput, remaining: Long, reader: GroupVIntUtil.IntReader, pos: Long, dst: IntArray, offset: Int): Int
fun readGroupVInt(in: DataInput, remaining: Long, reader: GroupVIntUtil.IntReader, pos: Long, dst: LongArray, offset: Int): Int

Faster implementation of read single group, It read values from the buffer that would not cross boundaries.

Link copied to clipboard
fun readGroupVInts(in: DataInput, dst: IntArray, limit: Int)

Read all the group varints, including the tail vints.

fun readGroupVInts(in: DataInput, dst: LongArray, limit: Int)

Read all the group varints, including the tail vints. we need a long[] because this is what postings are using, all longs are actually required to be integers.

Link copied to clipboard
fun writeGroupVInts(out: DataOutput, scratch: ByteArray, values: IntArray, limit: Int)
fun writeGroupVInts(out: DataOutput, scratch: ByteArray, values: LongArray, limit: Int)

The implementation for group-varint encoding, It uses a maximum of .MAX_LENGTH_PER_GROUP bytes scratch buffer.