Package io.deephaven.engine.table.impl
Class AbstractColumnSource<T>
java.lang.Object
io.deephaven.engine.table.impl.AbstractColumnSource<T>
- All Implemented Interfaces:
ChunkSource<Values>,ChunkSource.WithPrev<Values>,ColumnSource<T>,ElementSource<T>,FillContextMaker,GetContextMaker,DefaultChunkSource<Values>,DefaultChunkSource.WithPrev<Values>,PushdownFilterMatcher,Releasable,TupleExporter<T>,TupleSource<T>
- Direct Known Subclasses:
AbstractArrowColumnSource,AbstractColumnSource.DefaultedImmutable,AbstractColumnSource.DefaultedMutable,AlternatingColumnSource,ArrayBackedColumnSource,BaseAggregateSlicedColumnSource,BitMaskingColumnSource,BitShiftingColumnSource,BooleanAsByteColumnSource,BooleanSparseArraySource.ReinterpretedAsByte,ByteAggregateColumnSource,ByteAsBooleanColumnSource,ByteChunkColumnSource,ByteSsmBackedSource,CharAggregateColumnSource,CharChunkColumnSource,CharSsmBackedSource,CrossJoinRightColumnSource,DelegatingColumnSource,DeltaAwareColumnSource,DoubleAggregateColumnSource,DoubleChunkColumnSource,DoubleNullToZeroColumnSource,DoubleSsmBackedSource,FloatAggregateColumnSource,FloatChunkColumnSource,FloatSsmBackedSource,HashTableColumnSource,Immutable2DByteArraySource,Immutable2DCharArraySource,Immutable2DDoubleArraySource,Immutable2DFloatArraySource,Immutable2DIntArraySource,Immutable2DLongArraySource,Immutable2DNanosBasedTimeArraySource,Immutable2DObjectArraySource,Immutable2DShortArraySource,ImmutableByteArraySource,ImmutableCharArraySource,ImmutableConstantByteSource,ImmutableConstantCharSource,ImmutableConstantDoubleSource,ImmutableConstantFloatSource,ImmutableConstantIntSource,ImmutableConstantLongSource,ImmutableConstantNanosBasedTimeSource,ImmutableConstantObjectSource,ImmutableConstantShortSource,ImmutableDoubleArraySource,ImmutableFloatArraySource,ImmutableIntArraySource,ImmutableLongArraySource,ImmutableNanosBasedTimeArraySource,ImmutableObjectArraySource,ImmutableShortArraySource,InstantSsmSourceWrapper,IntAggregateColumnSource,IntChunkColumnSource,IntSsmBackedSource,LocalDateWrapperSource,LocalTimeWrapperSource,LongAggregateColumnSource,LongAsTimeSource,LongChunkColumnSource,LongSsmBackedSource,MergeSortedHelper.SortedMergeColumnSource,NanosBasedTimeArraySource,NanosBasedTimeSparseArraySource,NullValueColumnSource,ObjectAggregateColumnSource,ObjectChunkColumnSource,ObjectSsmBackedSource,PrevColumnSource,RangeAggregateColumnSource,RedirectedColumnSource,ReversedColumnSource,RowKeyColumnSource,RowPositionColumnSource,RowSetColumnSourceWrapper,ShiftedColumnSource,ShortAggregateColumnSource,ShortChunkColumnSource,ShortSsmBackedSource,SingleValueColumnSource,SingleValueObjectColumnSource,SparseArrayColumnSource,SwitchColumnSource,SymbolTableToUniqueIdSource,UnboxedLongBackedColumnSource,UnboxedLongBackedColumnSource,UnboxedTimeBackedColumnSource,UngroupedColumnSource,UnionColumnSource,ViewColumnSource
public abstract class AbstractColumnSource<T>
extends Object
implements ColumnSource<T>, DefaultChunkSource.WithPrev<Values>, PushdownFilterMatcher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface io.deephaven.engine.table.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Any>Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Any>, DefaultChunkSource.WithPrev<ATTR extends Any>Nested classes/interfaces inherited from interface io.deephaven.engine.table.TupleExporter
TupleExporter.ExportElementFunction<TUPLE_TYPE> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Class<?>protected final UpdateGraphstatic final longMinimum average run length in anRowSequencethat should triggerChunk-filling by key ranges instead of individual keys.Fields inherited from interface io.deephaven.engine.table.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAYFields inherited from interface io.deephaven.engine.table.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAYFields inherited from interface io.deephaven.engine.table.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractColumnSource(@NotNull Class<T> type) AbstractColumnSource(@NotNull Class<T> type, @Nullable Class<?> elementType) -
Method Summary
Modifier and TypeMethodDescription<ALTERNATE_DATA_TYPE>
booleanallowsReinterpret(@NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) Test if a reinterpret call will succeed.final voiddefaultFillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> destination, @NotNull RowSequence rowSequence) protected final voiddefaultFillPrevChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> destination, @NotNull RowSequence rowSequence) protected <ALTERNATE_DATA_TYPE>
ColumnSource<ALTERNATE_DATA_TYPE>doReinterpret(@NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) Supply allowed reinterpret results.voidestimatePushdownFilterCost(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, JobScheduler jobScheduler, LongConsumer onComplete, Consumer<Exception> onError) Estimate the cost of pushing down the next pushdown filter.voidfillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> destination, @NotNull RowSequence rowSequence) Populates the given destination chunk with data corresponding to the keys from the givenRowSequence.voidfillPrevChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> destination, @NotNull RowSequence rowSequence) Populates the given destination chunk with data corresponding to the keys from the givenRowSequence.Class<?>getType()makePushdownFilterContext(WhereFilter filter, List<ColumnSource<?>> filterSources) Create a pushdown filter context for this entity.match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, @NotNull RowSet rowsetToFilter, Object... keys) Return arow setwhere the values in the column source match the given keys.voidpushdownFilter(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, long costCeiling, JobScheduler jobScheduler, Consumer<PushdownResult> onComplete, Consumer<Exception> onError) Push down the given filter to the underlying table and pass the result to the consumer.Get the pushdown predicate manager for this column source; returns null if there is no pushdown manager.final <ALTERNATE_DATA_TYPE>
ColumnSource<ALTERNATE_DATA_TYPE>reinterpret(@NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) Provide an alternative view into the data underlying this column source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.ColumnSource
cast, cast, cast, cast, createPreviousTuple, createTuple, createTupleFromValues, exportAllTo, exportElement, exportElement, getChunkType, isImmutable, isStateless, releaseCachedResources, startTrackingPrevValues, tupleLengthMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContextMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFillingMethods inherited from interface io.deephaven.engine.table.ElementSource
get, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getPrev, getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort, getShortMethods inherited from interface io.deephaven.engine.table.FillContextMaker
makeFillContextMethods inherited from interface io.deephaven.engine.table.GetContextMaker
makeGetContextMethods inherited from interface io.deephaven.engine.table.TupleExporter
exportAllReinterpretedTo, exportAllReinterpretedTo, exportAllTo, exportElementReinterpretedMethods inherited from interface io.deephaven.engine.table.TupleSource
createTupleFromReinterpretedValues
-
Field Details
-
USE_RANGES_AVERAGE_RUN_LENGTH
public static final long USE_RANGES_AVERAGE_RUN_LENGTHMinimum average run length in anRowSequencethat should triggerChunk-filling by key ranges instead of individual keys.- See Also:
-
type
-
componentType
-
updateGraph
-
-
Constructor Details
-
AbstractColumnSource
-
AbstractColumnSource
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceColumnSource<T>
-
getComponentType
- Specified by:
getComponentTypein interfaceColumnSource<T>
-
getPrevSource
- Specified by:
getPrevSourcein interfaceChunkSource.WithPrev<T>- Specified by:
getPrevSourcein interfaceColumnSource<T>- Specified by:
getPrevSourcein interfaceDefaultChunkSource.WithPrev<T>- Returns:
- a chunk source which accesses the previous values.
-
match
public WritableRowSet match(boolean invertMatch, boolean usePrev, boolean caseInsensitive, @NotNull @NotNull RowSet rowsetToFilter, Object... keys) Description copied from interface:ColumnSourceReturn arow setwhere the values in the column source match the given keys.- Specified by:
matchin interfaceColumnSource<T>- Parameters:
invertMatch- Whether to invert the match, i.e. return the rows where the values do not match the given keysusePrev- Whether to use the previous values for the ColumnSourcecaseInsensitive- Whether to perform a case insensitive matchrowsetToFilter- Restrict results to this row setkeys- The keys to match in the column- Returns:
- The rows that match the given keys
-
fillChunk
public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSourcePopulates the given destination chunk with data corresponding to the keys from the givenRowSequence.- Specified by:
fillChunkin interfaceChunkSource<T>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according torowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).rowSequence- AnRowSequencerepresenting the keys to be fetched
-
defaultFillChunk
@VisibleForTesting public final void defaultFillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence) -
fillPrevChunk
public void fillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSource.WithPrevPopulates the given destination chunk with data corresponding to the keys from the givenRowSequence.- Specified by:
fillPrevChunkin interfaceChunkSource.WithPrev<T>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according torowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).rowSequence- AnRowSequencerepresenting the keys to be fetched
-
defaultFillPrevChunk
protected final void defaultFillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence) -
pushdownManager
Get the pushdown predicate manager for this column source; returns null if there is no pushdown manager. -
estimatePushdownFilterCost
public void estimatePushdownFilterCost(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, JobScheduler jobScheduler, LongConsumer onComplete, Consumer<Exception> onError) Description copied from interface:PushdownFilterMatcherEstimate the cost of pushing down the next pushdown filter. This returns a unitless value to compare the cost of executing different filters. Common costs are listed inPushdownResult(such asPushdownResult.METADATA_STATS_COST) and should be used as a baseline for estimating the cost of newly implemented pushdown operations.A no-op implementation should simply complete with
Long.MAX_VALUE.- Specified by:
estimatePushdownFilterCostin interfacePushdownFilterMatcher- Parameters:
filter- Thefilterto test.selection- The set of rows to tests.usePrev- Whether to use the previous resultcontext- ThePushdownFilterContextto use for the pushdown operation.jobScheduler- The job scheduler to use for scheduling child jobsonComplete- Consumer of the estimated cost of the pushdown operation. 9223372036854775807L indicates that the filter cannot be pushed down.onError- Consumer of any exceptions that occur during the estimate operation
-
pushdownFilter
public void pushdownFilter(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, long costCeiling, JobScheduler jobScheduler, Consumer<PushdownResult> onComplete, Consumer<Exception> onError) Description copied from interface:PushdownFilterMatcherPush down the given filter to the underlying table and pass the result to the consumer. This method is expected to execute all pushdown filter steps that are greater thanPushdownFilterContext.executedFilterCost()and less than or equal tocostCeiling.The resulting
PushdownResult(toonComplete) must only contain rows fromselection. Thematch row setare rows that are guaranteed to match. The implicitly "missing" rowsselection - match - maybeMatchare rows that are guaranteed to not match. The remainingmaybe match row setare rows that may, or may not, match. The pushdown result ownership passes toonComplete.A no-op implementation should simply complete with
PushdownResult.maybeMatch(selection).- Specified by:
pushdownFilterin interfacePushdownFilterMatcher- Parameters:
filter- Thefilterto apply.selection- The set of rows to test.usePrev- Whether to use the previous resultcontext- ThePushdownFilterContextto use for the pushdown operation.costCeiling- Execute all possible filters with a cost less than or equal this value.jobScheduler- The job scheduler to use for scheduling child jobsonComplete- Consumer of the output rowsets for added and modified rows that pass the filteronError- Consumer of any exceptions that occur during the pushdown operation
-
makePushdownFilterContext
public PushdownFilterContext makePushdownFilterContext(WhereFilter filter, List<ColumnSource<?>> filterSources) Description copied from interface:PushdownFilterMatcherCreate a pushdown filter context for this entity.- Specified by:
makePushdownFilterContextin interfacePushdownFilterMatcher- Parameters:
filter- the filter to use while making the contextfilterSources- the column sources that match the filter column names- Returns:
- the created filter context
-
allowsReinterpret
public <ALTERNATE_DATA_TYPE> boolean allowsReinterpret(@NotNull @NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) Description copied from interface:ColumnSourceTest if a reinterpret call will succeed.- Specified by:
allowsReinterpretin interfaceColumnSource<T>- Parameters:
alternateDataType- The alternative type to consider- Returns:
- If a reinterpret on this column source with the supplied alternateDataType will succeed.
-
reinterpret
public final <ALTERNATE_DATA_TYPE> ColumnSource<ALTERNATE_DATA_TYPE> reinterpret(@NotNull @NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) throws IllegalArgumentException Description copied from interface:ColumnSourceProvide an alternative view into the data underlying this column source.- Specified by:
reinterpretin interfaceColumnSource<T>- Parameters:
alternateDataType- The alternative type to expose- Returns:
- A column source of the alternate data type, backed by the same underlying data.
- Throws:
IllegalArgumentException- If the alternativeDataType supplied is not supported
-
doReinterpret
protected <ALTERNATE_DATA_TYPE> ColumnSource<ALTERNATE_DATA_TYPE> doReinterpret(@NotNull @NotNull Class<ALTERNATE_DATA_TYPE> alternateDataType) Supply allowed reinterpret results. The default implementation handles the most common case to avoid code duplication.- Parameters:
alternateDataType- The alternate data type- Returns:
- The resulting
ColumnSource
-