Package io.deephaven.engine.table.impl
Class SortOperation
java.lang.Object
io.deephaven.engine.table.impl.SortOperation
- All Implemented Interfaces:
QueryTable.MemoizableOperation<QueryTable>
,QueryTable.Operation<QueryTable>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.QueryTable.Operation
QueryTable.Operation.Result<T extends DynamicNode & NotificationStepReceiver>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LongUnaryOperator
getReverseLookup
(@NotNull Table parent, @NotNull Table sortResult) Get a reverse lookup for a sort result, providing a mapping from input row key (that is, in the parent table's row key space) to output row key (that is, in the sorted table's row space).static RowRedirection
getRowRedirection
(@NotNull Table sortResult) Get the row redirection for a sort result.initialize
(boolean usePrev, long beforeClock) Initialize this operation.newSnapshotControl
(QueryTable queryTable) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.table.impl.QueryTable.Operation
beginOperation, snapshotNeeded
-
Constructor Details
-
SortOperation
-
-
Method Details
-
getDescription
- Specified by:
getDescription
in interfaceQueryTable.Operation<QueryTable>
- Returns:
- the description of this operation
-
getLogPrefix
- Specified by:
getLogPrefix
in interfaceQueryTable.Operation<QueryTable>
- Returns:
- the log prefix of this operation
-
getMemoizedOperationKey
- Specified by:
getMemoizedOperationKey
in interfaceQueryTable.MemoizableOperation<QueryTable>
- Returns:
- the key that should be used to memoize off of
-
newSnapshotControl
- Specified by:
newSnapshotControl
in interfaceQueryTable.Operation<QueryTable>
-
initialize
Description copied from interface:QueryTable.Operation
Initialize this operation.- Specified by:
initialize
in interfaceQueryTable.Operation<QueryTable>
- Parameters:
usePrev
- data from the previous cycle should be used (otherwise use this cycle)beforeClock
- the clock value that we captured before the function began; the function can use this value to bail out early if it notices something has gone wrong.- Returns:
- the result table / listener if successful, null if it should be retried.
-
getRowRedirection
Get the row redirection for a sort result.- Parameters:
sortResult
- The sort result table; must be the direct result of a sort.- Returns:
- The row redirection if at least one column required redirection, otherwise
null
-
getReverseLookup
public static LongUnaryOperator getReverseLookup(@NotNull @NotNull Table parent, @NotNull @NotNull Table sortResult) Get a reverse lookup for a sort result, providing a mapping from input row key (that is, in the parent table's row key space) to output row key (that is, in the sorted table's row space). Unknown input row keys are mapped to thenull row key
. This is effectively the reverse of the mapping provided by the sort'sRowRedirection
.Unsupported if the sort result's parent was a
blink table
.For refreshing tables, using the reverse lookup concurrently requires careful consideration. The mappings are always against "current" data. It is only safe to use before the parent table notifies on a given cycle, or after the sorted table notifies (and during idle phases).
For static tables, do note that the reverse lookup will be produced on-demand within this method.
- Parameters:
parent
- The sort input table; must have been sorted in order to producesortResult
sortResult
- The sort result table; must be the direct result of a sort onparent
- Returns:
- The reverse lookup
-