Class UniqueLongArrayIndex
- java.lang.Object
-
- org.apache.druid.segment.join.table.UniqueLongArrayIndex
-
- All Implemented Interfaces:
IndexedTable.Index
public class UniqueLongArrayIndex extends Object implements IndexedTable.Index
AnIndexedTable.Indexbacked by an int array. This is for nonnull long-typed keys whose values all fall in a "reasonable" range. Built byRowBasedIndexBuilder.build()when these conditions are met.
-
-
Field Summary
-
Fields inherited from interface org.apache.druid.segment.join.table.IndexedTable.Index
NOT_FOUND
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareKeysUnique(boolean includeNull)Returns whether keys are unique in this index.it.unimi.dsi.fastutil.ints.IntSortedSetfind(Object key)Returns the list of row numbers corresponding to "key" in this index.intfindUniqueLong(long key)Returns the row number corresponding to "key" in this index, orIndexedTable.Index.NOT_FOUNDif the key does not exist in the index.ColumnTypekeyType()Returns the natural key type for the index.
-
-
-
Method Detail
-
keyType
public ColumnType keyType()
Description copied from interface:IndexedTable.IndexReturns the natural key type for the index.- Specified by:
keyTypein interfaceIndexedTable.Index
-
areKeysUnique
public boolean areKeysUnique(boolean includeNull)
Description copied from interface:IndexedTable.IndexReturns whether keys are unique in this index. If this returns true, thenIndexedTable.Index.find(Object)will only ever return a zero- or one-element list.- Specified by:
areKeysUniquein interfaceIndexedTable.Index- Parameters:
includeNull- whether null is considered a valid key
-
find
public it.unimi.dsi.fastutil.ints.IntSortedSet find(@Nullable Object key)
Description copied from interface:IndexedTable.IndexReturns the list of row numbers corresponding to "key" in this index. If "key" is some type other than the natural typeIndexedTable.Index.keyType(), it will be converted before checking the index.- Specified by:
findin interfaceIndexedTable.Index
-
findUniqueLong
public int findUniqueLong(long key)
Description copied from interface:IndexedTable.IndexReturns the row number corresponding to "key" in this index, orIndexedTable.Index.NOT_FOUNDif the key does not exist in the index. It is only valid to call this method ifIndexedTable.Index.keyType()isValueType.LONGandIndexedTable.Index.areKeysUnique(boolean)returns true.- Specified by:
findUniqueLongin interfaceIndexedTable.Index
-
-