Package com.illumon.iris.db.v2.utils
Interface Index.SequentialBuilder
- All Superinterfaces:
LongRangeConsumer
,gnu.trove.procedure.TLongProcedure
- Enclosing interface:
- Index
public static interface Index.SequentialBuilder extends gnu.trove.procedure.TLongProcedure, LongRangeConsumer
An builder for
Index
s that requires keys to be added in a monotonically increasing fashion. These builders
are optimized for patterns where this is true.-
Method Summary
Modifier and Type Method Description default void
appendIndex(ReadOnlyIndex idx)
Append the entireReadOnlyIndex
to this builderdefault void
appendIndexWithOffset(ReadOnlyIndex idx, long offset)
Appends the index shifted by the provided offset to this builder.void
appendKey(long key)
Append the specified key to the builder.default void
appendKeys(PrimitiveIterator.OfLong it)
Append a set of keys from the provided long iterator.default void
appendOrderedKeyIndicesChunk(LongChunk<Attributes.OrderedKeyIndices> chunk)
Append all of the keys from the specifiedAttributes.OrderedKeyIndices
.default void
appendOrderedKeyRangesChunk(LongChunk<Attributes.OrderedKeyRanges> chunk)
Append a chunk of ordered ranges.default void
appendOrderedKeys(OrderedKeys orderedKeys)
Append the entire set of ordered keys by range to this builder.void
appendRange(long rangeFirstKey, long rangeLastKey)
Append the specified range of keys to the builder.default void
appendRanges(LongRangeIterator it)
Append all of the ranges from the specifiedLongRangeIterator
.default boolean
execute(long value)
Append the specified value to the builder.Index
getIndex()
Get the index constructed from all of the keys added so far.default void
setDomain(long minKey, long maxKey)
No obligation to call, but if called, (a) should be called before providing any values, and (b) no value should be provided outside of the domain.
-
Method Details
-
setDomain
default void setDomain(long minKey, long maxKey)No obligation to call, but if called, (a) should be called before providing any values, and (b) no value should be provided outside of the domain. Implementations may be able to use this information to improve memory utilization. Either of the arguments may be given as Index.NULL_KEY, indicating that the respective value is not known.- Parameters:
minKey
- the minimum key to be provided, or Index.NULL_KEY if not known.maxKey
- the maximum key to be provided, or Index.NULL_KEY if not known.
-
getIndex
Index getIndex()Get the index constructed from all of the keys added so far.- Returns:
- an Index
-
appendKey
void appendKey(long key)Append the specified key to the builder.- Parameters:
key
- the key
-
appendRange
void appendRange(long rangeFirstKey, long rangeLastKey)Append the specified range of keys to the builder.- Parameters:
rangeFirstKey
- the first key in the range (inclusive)rangeLastKey
- the last key in the range (inclusive)
-
appendKeys
Append a set of keys from the provided long iterator.- Parameters:
it
- the iterator
-
appendOrderedKeyIndicesChunk
Append all of the keys from the specifiedAttributes.OrderedKeyIndices
.- Parameters:
chunk
- the chunk of ordered indices
-
appendRanges
Append all of the ranges from the specifiedLongRangeIterator
.- Parameters:
it
- the long range iterator
-
appendOrderedKeyRangesChunk
Append a chunk of ordered ranges.- Parameters:
chunk
- the chunk
-
execute
default boolean execute(long value)Append the specified value to the builder.- Specified by:
execute
in interfacegnu.trove.procedure.TLongProcedure
- Parameters:
value
- the value- Returns:
- true always
-
appendIndex
Append the entireReadOnlyIndex
to this builder- Parameters:
idx
- the index
-
appendIndexWithOffset
Appends the index shifted by the provided offset to this builder.- Parameters:
idx
- The index to append.offset
- An offset to apply to every range in the index.
-
appendOrderedKeys
Append the entire set of ordered keys by range to this builder.- Parameters:
orderedKeys
- the ordered keys to add
-