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
Indexs 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 TypeMethodDescriptiondefault voidappendIndex(ReadOnlyIndex idx) Append the entireReadOnlyIndexto this builderdefault voidappendIndexWithOffset(ReadOnlyIndex idx, long offset) Appends the index shifted by the provided offset to this builder.voidappendKey(long key) Append the specified key to the builder.default voidAppend a set of keys from the provided long iterator.default voidAppend all of the keys from the specifiedAttributes.OrderedKeyIndices.default voidAppend a chunk of ordered ranges.default voidappendOrderedKeys(OrderedKeys orderedKeys) Append the entire set of ordered keys by range to this builder.voidappendRange(long rangeFirstKey, long rangeLastKey) Append the specified range of keys to the builder.default voidAppend all of the ranges from the specifiedLongRangeIterator.default booleanexecute(long value) Append the specified value to the builder.getIndex()Get the index constructed from all of the keys added so far.default voidsetDomain(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.Methods inherited from interface com.illumon.iris.db.v2.utils.LongRangeConsumer
accept
-
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:
executein interfacegnu.trove.procedure.TLongProcedure- Parameters:
value- the value- Returns:
- true always
-
appendIndex
Append the entireReadOnlyIndexto 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
-