public interface ColumnSource<T> extends TupleSource<T>
Note for implementors: All ColumnSource implementations must map Index.NULL_KEY to a null value
for all get and getPrev methods.
| Modifier and Type | Field and Description |
|---|---|
static ColumnSource[] |
ZERO_LENGTH_COLUMN_SOURCE_ARRAY |
| Modifier and Type | Method and Description |
|---|---|
<ALTERNATE_DATA_TYPE> |
allowsReinterpret(Class<ALTERNATE_DATA_TYPE> alternateDataType)
Test if a reinterpret call will succeed.
|
default T |
createPreviousTuple(long indexKey)
Create a tuple for previous key column values at the supplied index key.
|
default T |
createTuple(long indexKey)
Create a tuple for key column values at the supplied index key.
|
default T |
createTupleFromValues(Object... values)
Create a tuple for the supplied (boxed) values.
|
default Object |
exportElement(T tuple,
int elementIndex)
Export a single element from the tuple, identified by its element index, to an Object
|
default <ELEMENT_TYPE> |
exportElement(T tuple,
int elementIndex,
WritableSource<ELEMENT_TYPE> writableSource,
long destinationIndexKey)
Export a single element from the tuple, identified by its element index, to the destination index key of the
supplied writable source.
|
default Object |
exportToExternalKey(T tuple)
Export this tuple's element list as a key suitable for the
TableMaps resulting
from Table.byExternal(com.illumon.iris.db.tables.Table.ByStrategy, boolean, java.lang.String...). |
T |
get(long index) |
Boolean |
getBoolean(long index) |
byte |
getByte(long index) |
byte[] |
getBytes(long index,
int length,
byte[] dest) |
char |
getChar(long index) |
default List<ColumnSource> |
getColumnSources()
Get the
ColumnSources backing this tuple source. |
Class<?> |
getComponentType() |
double |
getDouble(long index) |
float |
getFloat(long index) |
Map<T,Index> |
getGroupToRange()
Compute grouping information for all keys present in this column source.
|
Map<T,Index> |
getGroupToRange(Index index)
Compute grouping information for (at least) all keys present in index.
|
int |
getInt(long index) |
long |
getLong(long index) |
T |
getPrev(long index) |
Boolean |
getPrevBoolean(long index) |
byte |
getPrevByte(long index) |
char |
getPrevChar(long index) |
double |
getPrevDouble(long index) |
float |
getPrevFloat(long index) |
int |
getPrevInt(long index) |
long |
getPrevLong(long index) |
short |
getPrevShort(long index) |
long[] |
getPrevSortMapping(Index sourceIndex,
SortingOrder sortingOrder) |
short |
getShort(long index) |
long[] |
getSortMapping(Index sourceIndex,
SortingOrder sortingOrder) |
Class<T> |
getType() |
Map<T,Index> |
getValuesMapping(Index subRange) |
boolean |
isImmutable() |
Index |
match(boolean invertMatch,
boolean usePrev,
boolean caseInsensitive,
Index mapper,
Object... keys) |
<ALTERNATE_DATA_TYPE> |
reinterpret(Class<ALTERNATE_DATA_TYPE> alternateDataType)
Provide an alternative view into the data underlying this column source.
|
void |
releaseCachedResources()
Release any resources held for caching purposes.
|
default void |
startTrackingPrevValues()
ColumnSource implementations that track previous values have the option to not actually start tracking previous
values until this method is called.
|
static final ColumnSource[] ZERO_LENGTH_COLUMN_SOURCE_ARRAY
T get(long index)
Boolean getBoolean(long index)
byte getByte(long index)
byte[] getBytes(long index,
int length,
byte[] dest)
char getChar(long index)
double getDouble(long index)
float getFloat(long index)
int getInt(long index)
long getLong(long index)
short getShort(long index)
T getPrev(long index)
Boolean getPrevBoolean(long index)
byte getPrevByte(long index)
char getPrevChar(long index)
double getPrevDouble(long index)
float getPrevFloat(long index)
int getPrevInt(long index)
long getPrevLong(long index)
short getPrevShort(long index)
Class<?> getComponentType()
Index match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, Index mapper, Object... keys)
long[] getSortMapping(Index sourceIndex, SortingOrder sortingOrder)
long[] getPrevSortMapping(Index sourceIndex, SortingOrder sortingOrder)
default void startTrackingPrevValues()
Map<T,Index> getGroupToRange()
Map<T,Index> getGroupToRange(Index index)
index - The index to considerboolean isImmutable()
void releaseCachedResources()
<ALTERNATE_DATA_TYPE> boolean allowsReinterpret(@NotNull
Class<ALTERNATE_DATA_TYPE> alternateDataType)
alternateDataType - The alternative type to consider<ALTERNATE_DATA_TYPE> ColumnSource<ALTERNATE_DATA_TYPE> reinterpret(@NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) throws IllegalArgumentException
alternateDataType - The alternative type to exposeIllegalArgumentException - If the alternativeDataType supplied is not supporteddefault List<ColumnSource> getColumnSources()
TupleSourceColumnSources backing this tuple source.getColumnSources in interface TupleSource<T>default T createTuple(long indexKey)
TupleSourcecreateTuple in interface TupleSource<T>indexKey - The index keydefault T createPreviousTuple(long indexKey)
TupleSourcecreatePreviousTuple in interface TupleSource<T>indexKey - The index keydefault T createTupleFromValues(@NotNull Object... values)
TupleSourcecreateTupleFromValues in interface TupleSource<T>values - The valuesdefault <ELEMENT_TYPE> void exportElement(T tuple, int elementIndex, @NotNull WritableSource<ELEMENT_TYPE> writableSource, long destinationIndexKey)
TupleExporterFor the empty tuple, this is unsupported.
For singles, this will copy the sole element, possibly in boxed form.
For doubles and longer, this will copy the specified element without any unnecessary boxing.
exportElement in interface TupleExporter<T>tuple - The tuple to export an element fromelementIndex - The element index to exportwritableSource - The destinationdestinationIndexKey - The destination index keydefault Object exportElement(T tuple, int elementIndex)
TupleExporterFor the empty tuple, this is unsupported.
For singles, this will copy the sole element, possibly in boxed form.
For doubles and longer, this will copy the specified element without any unnecessary boxing.
exportElement in interface TupleExporter<T>tuple - The tuple to export an element fromelementIndex - The element index to exportdefault Object exportToExternalKey(T tuple)
TupleExporterExport this tuple's element list as a key suitable for the TableMaps resulting
from Table.byExternal(com.illumon.iris.db.tables.Table.ByStrategy, boolean, java.lang.String...).
For the empty tuple this is a unsupported.
For singles, this is the (boxed) sole element itself.
For doubles and longer, this is a newly-allocated "SmartKey".
exportToExternalKey in interface TupleExporter<T>tuple - The tuple to export all elements from