Interface RowRedirection
- All Superinterfaces:
ChunkSource<RowKeys>,ChunkSource.WithPrev<RowKeys>,DefaultChunkSource<RowKeys>,DefaultChunkSource.WithPrev<RowKeys>,FillContextMaker,FillUnordered<RowKeys>,GetContextMaker
- All Known Subinterfaces:
WritableRowRedirection
- All Known Implementing Classes:
ContiguousWritableRowRedirection,GroupedWritableRowRedirection,IntColumnSourceRowRedirection,IntColumnSourceWritableRowRedirection,InverseWrappedRowSetRowRedirection,LongColumnSourceRowRedirection,LongColumnSourceWritableRowRedirection,SingleValueRowRedirection,WrappedRowSetRowRedirection,WritableRowRedirectionLockFree,WritableSingleValueRowRedirection
public interface RowRedirection
extends DefaultChunkSource.WithPrev<RowKeys>, FillUnordered<RowKeys>
Data structure for mapping one "outer" row key space to another "inner" row key space. Query engine components use
this when a
RowSet must be flattened or re-ordered.-
Nested Class Summary
Nested 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> -
Field Summary
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_ARRAY -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanIf this RowRedirection is guaranteed to map outer keys in ascending order to inner keys in ascending order; then return true; all other redirections must return false.default voidfillChunk(@NotNull ChunkSource.FillContext fillContext, @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull RowSequence outerRowKeys) Lookup each element in aRowSequenceand write the result to aWritableLongChunk.default voidfillChunkUnordered(@NotNull ChunkSource.FillContext fillContext, @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull LongChunk<? extends RowKeys> outerRowKeys) Lookup each element in aLongChunkand write the result to aWritableLongChunk.default voidfillPrevChunk(@NotNull ChunkSource.FillContext fillContext, @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull RowSequence outerRowKeys) Lookup each element in aRowSequenceusing previous values and write the result to aWritableLongChunk.default voidfillPrevChunkUnordered(@NotNull ChunkSource.FillContext fillContext, @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull LongChunk<? extends RowKeys> outerRowKeys) Lookup each element in aLongChunkusing previous values and write the result to aWritableLongChunk.longget(long outerRowKey) Simple redirected lookup.default ChunkTypeGet the most suitableChunkTypefor use with this ChunkSource.longgetPrev(long outerRowKey) Simple redirected lookup, using previous values.default booleandefault booleanReturns true if this column source can efficiently provide an unordered fill.default WritableRowRedirectionCast this RowRedirection reference to aWritableRowRedirection.Methods 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, getPrevChunkByFilling, getPrevSourceMethods inherited from interface io.deephaven.engine.table.FillContextMaker
makeFillContextMethods inherited from interface io.deephaven.engine.table.GetContextMaker
makeGetContext
-
Method Details
-
get
long get(long outerRowKey) Simple redirected lookup.- Parameters:
outerRowKey- The "outer" row key- Returns:
- The corresponding "inner" row key, or
RowSequence.NULL_ROW_KEYif no mapping exists
-
getPrev
long getPrev(long outerRowKey) Simple redirected lookup, using previous values.- Parameters:
outerRowKey- The "outer" row key- Returns:
- The corresponding "inner" row key, or
RowSequence.NULL_ROW_KEYif no mapping exists
-
getChunkType
Description copied from interface:ChunkSourceGet the most suitableChunkTypefor use with this ChunkSource.- Specified by:
getChunkTypein interfaceChunkSource<RowKeys>- Returns:
- The ChunkType
-
providesFillUnordered
default boolean providesFillUnordered()Description copied from interface:FillUnorderedReturns true if this column source can efficiently provide an unordered fill. If this method returns false, then fillChunkUnordered and fillPrevChunkUnordered may throw an UnsupportedOperationException.- Specified by:
providesFillUnorderedin interfaceFillUnordered<RowKeys>- Returns:
- if this column source can provide an unordered fill
-
fillChunk
default void fillChunk(@NotNull @NotNull ChunkSource.FillContext fillContext, @NotNull @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull @NotNull RowSequence outerRowKeys) Lookup each element in aRowSequenceand write the result to aWritableLongChunk.- Specified by:
fillChunkin interfaceChunkSource<RowKeys>- Parameters:
fillContext- Thefill contextinnerRowKeys- The resultWritableLongChunkouterRowKeys- The row keys to lookup in this RowRedirection
-
fillChunkUnordered
default void fillChunkUnordered(@NotNull @NotNull ChunkSource.FillContext fillContext, @NotNull @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull @NotNull LongChunk<? extends RowKeys> outerRowKeys) Lookup each element in aLongChunkand write the result to aWritableLongChunk.- Specified by:
fillChunkUnorderedin interfaceFillUnordered<RowKeys>- Parameters:
fillContext- The FillContextinnerRowKeys- The result chunkouterRowKeys- The row keys to lookup in this RowRedirection
-
fillPrevChunk
default void fillPrevChunk(@NotNull @NotNull ChunkSource.FillContext fillContext, @NotNull @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull @NotNull RowSequence outerRowKeys) Lookup each element in aRowSequenceusing previous values and write the result to aWritableLongChunk.- Specified by:
fillPrevChunkin interfaceChunkSource.WithPrev<RowKeys>- Parameters:
fillContext- Thefill contextinnerRowKeys- The resultWritableLongChunkouterRowKeys- The row keys to lookup in this RowRedirection
-
fillPrevChunkUnordered
default void fillPrevChunkUnordered(@NotNull @NotNull ChunkSource.FillContext fillContext, @NotNull @NotNull WritableChunk<? super RowKeys> innerRowKeys, @NotNull @NotNull LongChunk<? extends RowKeys> outerRowKeys) Lookup each element in aLongChunkusing previous values and write the result to aWritableLongChunk.- Specified by:
fillPrevChunkUnorderedin interfaceFillUnordered<RowKeys>- Parameters:
fillContext- The FillContextinnerRowKeys- The result chunkouterRowKeys- The row keys to lookup in this RowRedirection
-
ascendingMapping
default boolean ascendingMapping()If this RowRedirection is guaranteed to map outer keys in ascending order to inner keys in ascending order; then return true; all other redirections must return false.- Returns:
- if our output maintains ascending order
-
isWritable
default boolean isWritable()- Returns:
- Whether this RowRedirection is actually
writable
-
writableCast
Cast this RowRedirection reference to a
WritableRowRedirection.- Returns:
thiscast to aWritableRowRedirection- Throws:
ClassCastException- Ifthisis not aWritableRowRedirection
-