OrdinalMap

Maps per-segment ordinals to/from global ordinal space, using a compact packed-ints representation.

NOTE: this is a costly operation, as it must merge sort all terms, and may require non-trivial RAM once done. It's better to operate in segment-private ordinal space instead when possible.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class SegmentMap(weights: LongArray) : Accountable

Properties

Link copied to clipboard

Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Cache key of whoever asked for this awful thing

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the total number of unique terms in global ord space.

Functions

Link copied to clipboard
fun getFirstSegmentNumber(globalOrd: Long): Int

Given a global ordinal, returns the index of the first segment that contains this term.

Link copied to clipboard
fun getFirstSegmentOrd(globalOrd: Long): Long

Given global ordinal, returns the ordinal of the first segment which contains this ordinal (the corresponding to the segment return .getFirstSegmentNumber).

Link copied to clipboard
fun getGlobalOrds(segmentIndex: Int): LongValues

Given a segment number, return a LongValues instance that maps segment ordinals to global ordinals.

Link copied to clipboard
open override fun ramBytesUsed(): Long

Return the memory usage of this object in bytes. Negative values are illegal.