Class CurrentOnlyIndex
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
,LongSizedDataStructure
,Index
,OrderedKeys
,ReadOnlyIndex
,SafeCloseable
,Externalizable
,Serializable
,AutoCloseable
,Iterable<Long>
public class CurrentOnlyIndex extends OrderedKeysAsChunkImpl implements Index, Externalizable
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.Index
Index.AbstractRandomBuilder, Index.AdaptiveIndexBuilder, Index.Factory, Index.IndexUpdateCoalescer, Index.LegacyIndexUpdateCoalescer, Index.RandomBuilder, Index.SequentialBuilder, Index.ShiftInversionHelper
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.OrderedKeys
OrderedKeys.Iterator
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.ReadOnlyIndex
ReadOnlyIndex.Evaluator<T extends Comparable<T>>, ReadOnlyIndex.Iterator, ReadOnlyIndex.RangeIterator, ReadOnlyIndex.SearchIterator, ReadOnlyIndex.TargetComparator
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.utils.Index
BAD_RANGES_AS_ERROR, CURRENT_FACTORY, FACTORY, USE_PRIORITY_QUEUE_RANDOM_BUILDER, VALIDATE_COALESCED_UPDATES
-
Constructor Summary
Constructors Constructor Description CurrentOnlyIndex()
CurrentOnlyIndex(TreeIndexImpl impl)
-
Method Summary
Modifier and Type Method Description com.fishlib.base.log.LogOutput
append(com.fishlib.base.log.LogOutput logOutput)
Index
asIndex()
Get anIndex
representation of thisOrderedKeys
.void
clear()
CurrentOnlyIndex
clone()
Create a copy of this index.void
close()
Free any resources associated with this object.void
compact()
May reclaim some unused memory.boolean
containsRange(long start, long end)
Queries whether this index contains every element in the range provided.void
copyImmutableGroupings(TupleSource source, TupleSource dest)
boolean
empty()
Queries whether this index is empty (i.e.boolean
equals(Object obj)
void
fillKeyIndicesChunk(WritableLongChunk<? extends Attributes.KeyIndices> chunkToFill)
Fill the suppliedWritableLongChunk
with individual keys from thisOrderedKeys
.void
fillKeyRangesChunk(WritableLongChunk<Attributes.OrderedKeyRanges> chunkToFill)
Fill the suppliedWritableLongChunk
with key ranges from thisOrderedKeys
.long
find(long key)
Returns the position in [0..(size-1)] where the key is found.gnu.trove.list.array.TLongArrayList[]
findMissing(ReadOnlyIndex keys)
For the given keys Index, under the assertion that none of them are present in the current index, return the tentative insertion points in the current index with the count for each of themlong
findPrev(long key)
Returns the position in [0..(size-1)] where the key is found in the previous index.long
firstKey()
Get the first key in thisIndex
.long
firstKeyPrev()
boolean
forEachLong(LongAbortableConsumer lc)
Provide each value contained in this index, in increased sorted order to the consumer.boolean
forEachLongRange(LongRangeAbortableConsumer larc)
For as long as the consumer wants more ranges, call accept on the consumer with the individual key ranges in this OrderedKeys, in increasing order.long
get(long pos)
Returns the key at the given rank position.long
getAverageRunLengthEstimate()
Get an estimate of the average (mean) length of runs of adjacent keys in thisOrderedKeys
.Map<Object,ReadOnlyIndex>
getGrouping(TupleSource tupleSource)
Get the current groupings for the specified columnMap<Object,ReadOnlyIndex>
getGroupingForKeySet(Set<Object> keys, TupleSource tupleSource)
Return a grouping that contains keys that match the values in keySet.TreeIndexImpl
getImpl()
void
getKeysForPositions(PrimitiveIterator.OfLong positions, LongConsumer outputKeys)
Returns the sequence of (increasing) keys corresponding to the positions provided as input.OrderedKeys
getOrderedKeysByKeyRange(long startKeyInclusive, long endKeyInclusive)
Get an ordered subset of the keys in thisOrderedKeys
for a key range.OrderedKeys
getOrderedKeysByPosition(long startPositionInclusive, long length)
Get an ordered subset of the keys in thisOrderedKeys
for a position range.OrderedKeys.Iterator
getOrderedKeysIterator()
Get anOrderedKeys.Iterator
over thisOrderedKeys
.long
getPrev(long pos)
Map<Object,ReadOnlyIndex>
getPrevGrouping(TupleSource tupleSource)
Get the previous groupings for the specified columnIndex
getPrevIndex()
Index
getSubIndexForKeySet(Set<Object> keySet, TupleSource tupleSource)
Return a subIndex that contains indices that match the values in keySet.boolean
hasGrouping(ColumnSource... keyColumns)
Check if the index contains grouping for the specified key columns.int
hashCode()
void
initializePreviousValue()
Initializes our previous value from the current value.void
insert(long key)
Add a single key to this index if it's not already present.void
insert(LongChunk<Attributes.OrderedKeyIndices> keys, int offset, int length)
Add all of the (ordered) keys in a slice ofkeys
to this index if they are not already present.void
insert(ReadOnlyIndex added)
Add all of the keys inadded
to this index if they are not already present.void
insertRange(long startKey, long endKey)
Add all keys in a closed range to this index if they are not already present.void
insertWithShift(long shiftAmount, ReadOnlyIndex other)
For each key in the provided index, shift it by shiftAmount and insert it in the current index.Index
intersect(ReadOnlyIndex range)
Returns a new index representing the intersection of the current index with the input indexIndex
invert(ReadOnlyIndex keys)
Returns an Index with the positions of keys in this Index.Index
invert(ReadOnlyIndex keys, long maximumPosition)
Returns the positions of keys in the current set as an Index, stopping at maximumPosition.boolean
isFlat()
Returns whether or not this index is flat.boolean
isSorted()
ReadOnlyIndex.Iterator
iterator()
long
lastKey()
Get the last key in thisOrderedKeys
.long
lastKeyPrev()
Index
minus(ReadOnlyIndex indexToRemove)
Returns a new index representing the keys of the current set not present inside indexToRemove This operation is equivalent to set difference.boolean
overlapsRange(long start, long end)
Returns true if this index has any overlap with the provided range.ReadOnlyIndex.RangeIterator
rangeIterator()
long
rangesCountUpperBound()
void
readExternal(ObjectInput in)
int
refCount()
void
remove(long key)
Remove a single key from this index if it's present.void
remove(LongChunk<Attributes.OrderedKeyIndices> keys, int offset, int length)
Remove all of the (ordered) keys in a slice ofkeys
from this index if they are present.void
remove(ReadOnlyIndex removed)
Remove all of the keys inremoved
that are present in this index.void
removeRange(long start, long end)
Remove all keys in a closed range from this index if they are present.void
retain(ReadOnlyIndex toIntersect)
Modifies the index by removing any keys not in the indexToIntersect argument.void
retainRange(long start, long end)
Modifies the index by keeping only keys in the interval [start, end]ReadOnlyIndex.SearchIterator
reverseIterator()
ReadOnlyIndex.SearchIterator
searchIterator()
Index
shift(long shiftAmount)
Returns a new index representing the keys in this index shifted by the amount indicated.void
shiftInPlace(long shiftAmount)
long
size()
How many keys are in this index.long
sizePrev()
default String
strid()
Override to improve index debug-tracing messages.Index
subindexByKey(long startKey, long endKey)
Get a subset of this index within this range of keys.Index
subindexByPos(long startPos, long endPos)
Get a subset of this index within this range of positionsboolean
subsetOf(ReadOnlyIndex other)
Returns true if this index is a (possibly improper) subset of other.String
toString()
Index
union(ReadOnlyIndex indexToAdd)
Returns a new index representing the keys present in both this index and the argument index.void
update(ReadOnlyIndex added, ReadOnlyIndex removed)
Simultaneously adds the keys from the first index and removes the keys from the second one.void
validate(String failMsg)
void
writeExternal(ObjectOutput out)
Methods inherited from class com.illumon.iris.db.v2.utils.OrderedKeysAsChunkImpl
asKeyIndicesChunk, asKeyRangesChunk, closeOrderedKeysAsChunkImpl, invalidateOrderedKeysAsChunkImpl, runsUpperBound
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.utils.OrderedKeys
asKeyIndicesChunk, asKeyRangesChunk, forAllLongRanges, isContiguous
Methods inherited from interface com.illumon.iris.db.v2.utils.ReadOnlyIndex
forAllLongs, isEmpty, nonempty, overlaps, subindexByPos, toLongArray, toLongArray, validate
-
Constructor Details
-
CurrentOnlyIndex
public CurrentOnlyIndex() -
CurrentOnlyIndex
-
-
Method Details
-
getImpl
-
close
public void close()Description copied from interface:OrderedKeys
Free any resources associated with this object.
Using any
OrderedKeys
methods afterclose()
is an error and may produce exceptions or undefined results.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceOrderedKeys
- Specified by:
close
in interfaceReadOnlyIndex
- Specified by:
close
in interfaceSafeCloseable
- Overrides:
close
in classOrderedKeysAsChunkImpl
-
refCount
public int refCount()- Specified by:
refCount
in interfaceReadOnlyIndex
-
insert
public void insert(long key)Description copied from interface:Index
Add a single key to this index if it's not already present. -
insertRange
public void insertRange(long startKey, long endKey)Description copied from interface:Index
Add all keys in a closed range to this index if they are not already present.- Specified by:
insertRange
in interfaceIndex
- Parameters:
startKey
- The first key to addendKey
- The last key to add (inclusive)
-
insert
Description copied from interface:Index
Add all of the (ordered) keys in a slice ofkeys
to this index if they are not already present.- Specified by:
insert
in interfaceIndex
- Parameters:
keys
- TheLongChunk
ofAttributes.OrderedKeyIndices
to insertoffset
- The offset inkeys
to begin inserting keys fromlength
- The number of keys to insert
-
insert
Description copied from interface:Index
Add all of the keys inadded
to this index if they are not already present. -
remove
public void remove(long key)Description copied from interface:Index
Remove a single key from this index if it's present. -
removeRange
public void removeRange(long start, long end)Description copied from interface:Index
Remove all keys in a closed range from this index if they are present.- Specified by:
removeRange
in interfaceIndex
- Parameters:
start
- The first key to removeend
- The last key to remove (inclusive)
-
remove
Description copied from interface:Index
Remove all of the (ordered) keys in a slice ofkeys
from this index if they are present.- Specified by:
remove
in interfaceIndex
- Parameters:
keys
- TheLongChunk
ofAttributes.OrderedKeyIndices
to removeoffset
- The offset inkeys
to begin removing keys fromlength
- The number of keys to remove
-
remove
Description copied from interface:Index
Remove all of the keys inremoved
that are present in this index. -
clone
Description copied from interface:ReadOnlyIndex
Create a copy of this index.- Specified by:
clone
in interfaceReadOnlyIndex
- Overrides:
clone
in classObject
- Returns:
- a copy of this index
-
retain
Description copied from interface:Index
Modifies the index by removing any keys not in the indexToIntersect argument. -
retainRange
public void retainRange(long start, long end)Description copied from interface:Index
Modifies the index by keeping only keys in the interval [start, end]- Specified by:
retainRange
in interfaceIndex
- Parameters:
start
- beginning of interval of keys to keep.end
- end of interval of keys to keep (inclusive).
-
update
Description copied from interface:Index
Simultaneously adds the keys from the first index and removes the keys from the second one. API assumption: the intersection of added and removed is empty. -
lastKey
public long lastKey()Description copied from interface:OrderedKeys
Get the last key in thisOrderedKeys
.- Specified by:
lastKey
in interfaceOrderedKeys
- Specified by:
lastKey
in interfaceReadOnlyIndex
- Specified by:
lastKey
in classOrderedKeysAsChunkImpl
- Returns:
- The last key, or
ReadOnlyIndex.NULL_KEY
if there is none.
-
rangesCountUpperBound
public long rangesCountUpperBound()- Specified by:
rangesCountUpperBound
in classOrderedKeysAsChunkImpl
-
getOrderedKeysIterator
Description copied from interface:OrderedKeys
Get anOrderedKeys.Iterator
over thisOrderedKeys
.- Specified by:
getOrderedKeysIterator
in interfaceOrderedKeys
- Returns:
- A new iterator, positioned at the first key
-
getOrderedKeysByPosition
Description copied from interface:OrderedKeys
Get an ordered subset of the keys in this
OrderedKeys
for a position range. The result will contain the set of keys inthis
that lie at positions in the half-open range [startPositionInclusive
,startPositionInclusive + length
). The returned reference is owned by the caller, who should callclose()
when it is done with it.- Specified by:
getOrderedKeysByPosition
in interfaceOrderedKeys
- Parameters:
startPositionInclusive
- The position of the first key to includelength
- The number of keys to include- Returns:
- The subset as an
OrderedKeys
, which may bethis
-
getOrderedKeysByKeyRange
Description copied from interface:OrderedKeys
Get an ordered subset of the keys in this
OrderedKeys
for a key range. The returned set will be the intersection of the keys inthis
with the keys in the closed interval [startKeyInclusive
,endKeyInclusive
]. The returned reference is owned by the caller, who should callclose()
when it is done with it.- Specified by:
getOrderedKeysByKeyRange
in interfaceOrderedKeys
- Parameters:
startKeyInclusive
- The minimum key to includeendKeyInclusive
- The maximum key to include- Returns:
- The subset as an
OrderedKeys
, which may bethis
-
asIndex
Description copied from interface:OrderedKeys
Get anIndex
representation of thisOrderedKeys
.- Specified by:
asIndex
in interfaceOrderedKeys
- Returns:
- An
Index
representation for the same keys in the same order
-
firstKey
public long firstKey()Description copied from interface:ReadOnlyIndex
Get the first key in thisIndex
.- Specified by:
firstKey
in interfaceOrderedKeys
- Specified by:
firstKey
in interfaceReadOnlyIndex
- Returns:
- The first key, or
ReadOnlyIndex.NULL_KEY
if there is none.
-
invert
Description copied from interface:ReadOnlyIndex
Returns an Index with the positions of keys in this Index. This can be thought of as an iterative find() over the values in keys, but all keys must exist within this index, because an Index result can not represent negative values.- Specified by:
invert
in interfaceReadOnlyIndex
- Parameters:
keys
- the keys to find positions for- Returns:
- a new Index containing the positions of the keys in this index
-
invert
Description copied from interface:ReadOnlyIndex
Returns the positions of keys in the current set as an Index, stopping at maximumPosition. This can be thought of as an iterative find() over the values in keys, but all keys must exist within this index, because an Index result can not represent negative values.- Specified by:
invert
in interfaceReadOnlyIndex
- Parameters:
keys
- the keys to find positions formaximumPosition
- the largest position for which we will find a key- Returns:
- a new Index containing the positions of the keys in this index
-
findMissing
Description copied from interface:ReadOnlyIndex
For the given keys Index, under the assertion that none of them are present in the current index, return the tentative insertion points in the current index with the count for each of them- Specified by:
findMissing
in interfaceReadOnlyIndex
- Parameters:
keys
- the keys to identify insertion locations- Returns:
- two TLongArrayLists; [0] contains the positions, [1] contains the counts.
-
intersect
Description copied from interface:ReadOnlyIndex
Returns a new index representing the intersection of the current index with the input index- Specified by:
intersect
in interfaceReadOnlyIndex
-
overlapsRange
public boolean overlapsRange(long start, long end)Description copied from interface:ReadOnlyIndex
Returns true if this index has any overlap with the provided range.- Specified by:
overlapsRange
in interfaceReadOnlyIndex
- Parameters:
start
- Start of range, inclusive.end
- End of range, inclusive.- Returns:
- true if any value x in start <= x <= end is contained in this index.
-
subsetOf
Description copied from interface:ReadOnlyIndex
Returns true if this index is a (possibly improper) subset of other.- Specified by:
subsetOf
in interfaceReadOnlyIndex
- Returns:
- true if every element of this exists within other
-
minus
Description copied from interface:ReadOnlyIndex
Returns a new index representing the keys of the current set not present inside indexToRemove This operation is equivalent to set difference. This index is not modified.- Specified by:
minus
in interfaceReadOnlyIndex
-
union
Description copied from interface:ReadOnlyIndex
Returns a new index representing the keys present in both this index and the argument index.- Specified by:
union
in interfaceReadOnlyIndex
- Parameters:
indexToAdd
- an index whose keys will be joined with our own to produce a new index.- Returns:
- a new index with the union of the keys in both this index and indexToAdd.
-
clear
public void clear() -
shift
Description copied from interface:ReadOnlyIndex
Returns a new index representing the keys in this index shifted by the amount indicated.- Specified by:
shift
in interfaceReadOnlyIndex
- Parameters:
shiftAmount
- the amount to shift the keys in the index- Returns:
- a new index with the keys shifted by shiftAmount
-
shiftInPlace
public void shiftInPlace(long shiftAmount)- Specified by:
shiftInPlace
in interfaceIndex
-
insertWithShift
Description copied from interface:Index
For each key in the provided index, shift it by shiftAmount and insert it in the current index.- Specified by:
insertWithShift
in interfaceIndex
- Parameters:
shiftAmount
- the amount to add to each key in the index argument before insertion.other
- the index with the keys to shift and insert.
-
compact
public void compact()Description copied from interface:Index
May reclaim some unused memory. -
getGrouping
Description copied from interface:ReadOnlyIndex
Get the current groupings for the specified column- Specified by:
getGrouping
in interfaceReadOnlyIndex
- Parameters:
tupleSource
- the column to find groupings for- Returns:
- the map of groups for the provided index
-
getPrevGrouping
Description copied from interface:ReadOnlyIndex
Get the previous groupings for the specified column- Specified by:
getPrevGrouping
in interfaceReadOnlyIndex
- Parameters:
tupleSource
- the column to find previous groupings for- Returns:
- the map of previous groups for the provided index
-
copyImmutableGroupings
- Specified by:
copyImmutableGroupings
in interfaceReadOnlyIndex
-
getGroupingForKeySet
Description copied from interface:ReadOnlyIndex
Return a grouping that contains keys that match the values in keySet.- Specified by:
getGroupingForKeySet
in interfaceReadOnlyIndex
- Parameters:
keys
- a set of values that keyColumns should match. For a single keyColumns, the values within the set are the values that we would like to find. For multiple keyColumns, the values are SmartKeys.tupleSource
- the tuple factory for the keyColumns- Returns:
- an Map from keys to Indices, for each of the keys in keySet and this Index.
-
getSubIndexForKeySet
Description copied from interface:ReadOnlyIndex
Return a subIndex that contains indices that match the values in keySet.- Specified by:
getSubIndexForKeySet
in interfaceReadOnlyIndex
- Parameters:
keySet
- a set of values that keyColumns should match. For a single keyColumns, the values within the set are the values that we would like to find. For multiple keyColumns, the values are SmartKeys.tupleSource
- the tuple factory for the keyColumn- Returns:
- an Index containing only keys that match keySet.
-
hasGrouping
Description copied from interface:ReadOnlyIndex
Check if the index contains grouping for the specified key columns.- Specified by:
hasGrouping
in interfaceReadOnlyIndex
- Parameters:
keyColumns
- the keys to find groupings for- Returns:
- true if there are groupings for the specified keys.
-
validate
- Specified by:
validate
in interfaceReadOnlyIndex
-
forEachLong
Description copied from interface:ReadOnlyIndex
Provide each value contained in this index, in increased sorted order to the consumer. If the consumer returns false for a key, stops after that key (does not provide any keys after that key).- Specified by:
forEachLong
in interfaceOrderedKeys
- Specified by:
forEachLong
in interfaceReadOnlyIndex
- Parameters:
lc
- the consumer.- Returns:
- false if the consumer returned false at some point, true if the consumer always returned true and all values in the index were consumed.
-
forEachLongRange
Description copied from interface:OrderedKeys
For as long as the consumer wants more ranges, call accept on the consumer with the individual key ranges in this OrderedKeys, in increasing order.- Specified by:
forEachLongRange
in interfaceOrderedKeys
- Parameters:
larc
- a consumer to feed the individual key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
subindexByPos
Description copied from interface:ReadOnlyIndex
Get a subset of this index within this range of positions- Specified by:
subindexByPos
in interfaceReadOnlyIndex
- Parameters:
startPos
- The first position to included in the output (inclusive)endPos
- The last position to included in the output (exclusive)- Returns:
- A new index, containing only positions >= startPos and < endPos
-
subindexByKey
Description copied from interface:ReadOnlyIndex
Get a subset of this index within this range of keys.- Specified by:
subindexByKey
in interfaceReadOnlyIndex
- Parameters:
startKey
- The first key to include in the output.endKey
- The last key (inclusive) to include in the output.- Returns:
- A new index, containing only values >= startKey and <= endKey.
-
get
public long get(long pos)Description copied from interface:ReadOnlyIndex
Returns the key at the given rank position.- Specified by:
get
in interfaceReadOnlyIndex
- Parameters:
pos
- a position in this index between 0 and size() - 1- Returns:
- the key at that rank.
-
getKeysForPositions
Description copied from interface:ReadOnlyIndex
Returns the sequence of (increasing) keys corresponding to the positions provided as input.- Specified by:
getKeysForPositions
in interfaceReadOnlyIndex
- Parameters:
positions
- an iterator providing index positions in increasing order.outputKeys
- a consumer of corresponding keys for the positions provided as input.
-
getPrev
public long getPrev(long pos)- Specified by:
getPrev
in interfaceReadOnlyIndex
-
sizePrev
public long sizePrev()- Specified by:
sizePrev
in interfaceReadOnlyIndex
-
getPrevIndex
- Specified by:
getPrevIndex
in interfaceReadOnlyIndex
-
firstKeyPrev
public long firstKeyPrev()- Specified by:
firstKeyPrev
in interfaceReadOnlyIndex
-
lastKeyPrev
public long lastKeyPrev()- Specified by:
lastKeyPrev
in interfaceReadOnlyIndex
-
initializePreviousValue
public void initializePreviousValue()Description copied from interface:Index
Initializes our previous value from the current value. This call is used by operations that manipulate an Index while constructing it, but need to set the state at the end of the initial operation to the current state. Calling this in other circumstances will yield undefined results.- Specified by:
initializePreviousValue
in interfaceIndex
-
find
public long find(long key)Description copied from interface:ReadOnlyIndex
Returns the position in [0..(size-1)] where the key is found. If not found, then return (-(position it would be) - 1), a la Array.binarySearch.- Specified by:
find
in interfaceReadOnlyIndex
- Parameters:
key
- the key to search for- Returns:
- a position from [0..(size-1)] if the key was found. If the key was not found, then (-position - 1) as in Array.binarySearch.
-
findPrev
public long findPrev(long key)Description copied from interface:ReadOnlyIndex
Returns the position in [0..(size-1)] where the key is found in the previous index. If not found, then return (-(position it would be) - 1), as in Array.binarySearch.- Specified by:
findPrev
in interfaceReadOnlyIndex
- Parameters:
key
- the key to search for- Returns:
- a position from [0..(size-1)] if the key was found. If the key was not found, then (-position - 1) as in Array.binarySearch.
-
isSorted
public boolean isSorted()- Specified by:
isSorted
in interfaceReadOnlyIndex
-
iterator
- Specified by:
iterator
in interfaceIterable<Long>
- Specified by:
iterator
in interfaceReadOnlyIndex
-
searchIterator
- Specified by:
searchIterator
in interfaceReadOnlyIndex
-
reverseIterator
- Specified by:
reverseIterator
in interfaceReadOnlyIndex
-
rangeIterator
- Specified by:
rangeIterator
in interfaceReadOnlyIndex
-
size
public long size()Description copied from interface:ReadOnlyIndex
How many keys are in this index.- Specified by:
size
in interfaceLongSizedDataStructure
- Specified by:
size
in interfaceOrderedKeys
- Specified by:
size
in interfaceReadOnlyIndex
- Returns:
- the number of keys in this index.
-
getAverageRunLengthEstimate
public long getAverageRunLengthEstimate()Description copied from interface:OrderedKeys
Get an estimate of the average (mean) length of runs of adjacent keys in this
OrderedKeys
.Implementations should strive to keep this method efficient (O(1) preferred) at the expense of accuracy.
Empty
OrderedKeys
should return an arbitrary valid value, usually 1.- Specified by:
getAverageRunLengthEstimate
in interfaceOrderedKeys
- Returns:
- An estimate of the average run length in this
OrderedKeys
, in [1,size()
]
-
isFlat
public final boolean isFlat()Description copied from interface:ReadOnlyIndex
Returns whether or not this index is flat. Unlike a table, this is a mutable property; which may change from step to step.- Specified by:
isFlat
in interfaceReadOnlyIndex
- Returns:
- true if the index keys are continguous and start at zero.
-
empty
public boolean empty()Description copied from interface:ReadOnlyIndex
Queries whether this index is empty (i.e. has no keys).- Specified by:
empty
in interfaceReadOnlyIndex
- Returns:
- true if the size() of this Index is zero, false if the size is greater than zero
-
containsRange
public boolean containsRange(long start, long end)Description copied from interface:ReadOnlyIndex
Queries whether this index contains every element in the range provided.- Specified by:
containsRange
in interfaceReadOnlyIndex
- Parameters:
start
- Start of the range, inclusive.end
- End of the range, inclusive.- Returns:
- true if this index contains every element x in start <= x <= end.
-
append
public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput)- Specified by:
append
in interfacecom.fishlib.base.log.LogOutputAppendable
-
fillKeyIndicesChunk
Description copied from interface:OrderedKeys
Fill the supplied
WritableLongChunk
with individual keys from thisOrderedKeys
.The chunk's capacity is assumed to be big enough.
- Specified by:
fillKeyIndicesChunk
in interfaceOrderedKeys
- Parameters:
chunkToFill
- A chunk to fill with individual keys
-
fillKeyRangesChunk
Description copied from interface:OrderedKeys
Fill the supplied
WritableLongChunk
with key ranges from thisOrderedKeys
.The chunk's capacity is assumed to be big enough.
- Specified by:
fillKeyRangesChunk
in interfaceOrderedKeys
- Parameters:
chunkToFill
- A chunk to fill with key ranges
-
toString
-
equals
-
hashCode
public int hashCode() -
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
strid
Override to improve index debug-tracing messages.
-