Class SortOperation

java.lang.Object
io.deephaven.engine.table.impl.SortOperation
All Implemented Interfaces:
QueryTable.MemoizableOperation<QueryTable>, QueryTable.Operation<QueryTable>

public class SortOperation extends Object implements QueryTable.MemoizableOperation<QueryTable>
  • Constructor Details

  • Method Details

    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface QueryTable.Operation<QueryTable>
      Returns:
      the description of this operation
    • getLogPrefix

      public String getLogPrefix()
      Specified by:
      getLogPrefix in interface QueryTable.Operation<QueryTable>
      Returns:
      the log prefix of this operation
    • getMemoizedOperationKey

      public MemoizedOperationKey getMemoizedOperationKey()
      Specified by:
      getMemoizedOperationKey in interface QueryTable.MemoizableOperation<QueryTable>
      Returns:
      the key that should be used to memoize off of
    • newSnapshotControl

      public OperationSnapshotControl newSnapshotControl(QueryTable queryTable)
      Specified by:
      newSnapshotControl in interface QueryTable.Operation<QueryTable>
    • initialize

      public QueryTable.Operation.Result<QueryTable> initialize(boolean usePrev, long beforeClock)
      Description copied from interface: QueryTable.Operation
      Initialize this operation.
      Specified by:
      initialize in interface QueryTable.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

      public static RowRedirection getRowRedirection(@NotNull @NotNull Table sortResult)
      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 the null row key. This is effectively the reverse of the mapping provided by the sort's RowRedirection.

      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 produce sortResult
      sortResult - The sort result table; must be the direct result of a sort on parent
      Returns:
      The reverse lookup