Package com.illumon.iris.db.v2.utils
Interface Index.Factory
- All Known Implementing Classes:
AbstractFactory
- Enclosing interface:
- Index
public static interface Index.Factory
A class for creating
Index
s in various ways.-
Method Summary
Modifier and Type Method Description Index.RandomBuilder
getBuilder()
Get a builder capable of inserting keys in any random order.Index
getEmptyIndex()
Get an empty index.Index
getFlatIndex(long size)
Get a flatIndex
containing the range [0, size), or anempty index
if the specified size is <= 0.Index
getIndexByRange(long firstKey, long lastKey)
Create anIndex
containing the continuous range [firstKey, lastKey]Index
getIndexByValues(long key)
Produce an index containing a single key.Index
getIndexByValues(long... keys)
Get anIndex
containing the specified keys.Index
getIndexByValues(gnu.trove.list.array.TLongArrayList list)
Get anIndex
containing the specified keys.Index.RandomBuilder
getRandomBuilder()
Index.SequentialBuilder
getSequentialBuilder()
Get a builder optimized for inserting keys sequentially.
-
Method Details
-
getIndexByValues
Get anIndex
containing the specified keys. All keys must be positive numbers- Parameters:
keys
- The keys to add to the index- Returns:
- An index containing the specified keys
-
getEmptyIndex
Index getEmptyIndex()Get an empty index.- Returns:
- an empty index
-
getIndexByValues
Produce an index containing a single key.- Parameters:
key
- the key that will exist in the new Index- Returns:
- a new Index containing key
-
getIndexByValues
Get anIndex
containing the specified keys. The provided list is sorted, and then passed to a sequential builder.- Parameters:
list
- a Trove long array list; note that this list is mutated within the method- Returns:
- an Index containing the values from list
-
getIndexByRange
Create anIndex
containing the continuous range [firstKey, lastKey]- Parameters:
firstKey
- The first key in the continuous rangelastKey
- The last key in the continuous range- Returns:
- An index containing the specified range
-
getFlatIndex
Get a flatIndex
containing the range [0, size), or anempty index
if the specified size is <= 0.- Parameters:
size
- The size of the index to create- Returns:
- A flat index containing the keys [0, size) or an empty index if the size is <= 0
-
getRandomBuilder
Index.RandomBuilder getRandomBuilder()- Returns:
- An
IndexBuilder
suitable for inserting ranges in no particular order.
-
getSequentialBuilder
Index.SequentialBuilder getSequentialBuilder()Get a builder optimized for inserting keys sequentially.- Returns:
- A builder optimized for inserting ranges sequentially in order.
-
getBuilder
Index.RandomBuilder getBuilder()Get a builder capable of inserting keys in any random order.- Returns:
- a builder capable of inserting keys in any random order.
-