Class DeferredViewTable

All Implemented Interfaces:
TableOperations<Table,Table>, TableOperationsDefaults<Table,Table>, LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, AttributeMap<Table>, GridAttributes<Table>, HasParentPerformanceIds, NotificationStepReceiver, NotificationStepSource, TableDefaults, Table, DynamicNode, NotificationQueue.Dependency, SystemicObject<Table>, LongSizedDataStructure, Serializable

public class DeferredViewTable extends RedefinableTable<DeferredViewTable>
An uncoalesced table with view and where operations to be applied after UncoalescedTableImpl.coalesce() is forced.

Each DeferredViewTable defers at most one kind of operation: dropped columns, view columns, a rename or filters. A further operation wraps the table in another DeferredViewTable. The static factories, one per kind of operation, are the only way to create a DeferredViewTable.

See Also:
  • Field Details

    • deferredDropColumns

      protected final String[] deferredDropColumns
    • deferredViewColumns

      protected final SelectColumn[] deferredViewColumns
    • deferredFilters

      protected final WhereFilter[] deferredFilters
  • Method Details

    • where

      public Table where(Filter filter)
      Specified by:
      where in interface TableOperations<Table,Table>
      Overrides:
      where in class UncoalescedTable<DeferredViewTable>
    • doCoalesce

      protected Table doCoalesce()
      Description copied from class: UncoalescedTableImpl
      Produce the actual coalesced result table, suitable for caching.

      Note that if this table must have listeners registered, etc, setting these up is the implementation's responsibility.

      Also note that the implementation should copy attributes, as in copyAttributes(resultTable, CopyAttributeOperation.Coalesce).

      This is never invoked concurrently for the same table. For a refreshing table, a thread that may wait for its update graph first invokes this within its own LivenessScope while forbidden to wait for any update graph. If the attempt succeeds, the liveness referents it produced are transferred to the caller's liveness manager. If it would wait, it is abandoned, the liveness referents it produced are released, and this is invoked again while the thread holds the shared lock.

      Specified by:
      doCoalesce in class UncoalescedTableImpl<DeferredViewTable>
      Returns:
      The coalesced result table, suitable for caching
    • selectDistinct

      public Table selectDistinct(Collection<? extends Selectable> columns)
      Specified by:
      selectDistinct in interface TableOperations<Table,Table>
      Overrides:
      selectDistinct in class UncoalescedTable<DeferredViewTable>
    • copy

      protected DeferredViewTable copy(@NotNull @NotNull Map<String,Object> attributes)
      Description copied from class: LiveAttributeMap
      Create a copy of this that is constructed with attributes as its initial attributes.
      Specified by:
      copy in class LiveAttributeMap<Table,DeferredViewTable>
      Parameters:
      attributes - The attributes for the copy, which implementations must pass to its constructor without modifying
      Returns:
      The copy
    • redefineImpl

      protected DeferredViewTable redefineImpl(TableDefinition newDefinition)
      Description copied from class: RedefinableTable
      Redefine this table with a proper-subset, or re-ordering, of its current columns.
      Specified by:
      redefineImpl in class RedefinableTable<DeferredViewTable>
      Parameters:
      newDefinition - A TableDefinition with a proper-subset of this RedefinableTable's ColumnDefinitions.
      Returns:
      the redefined table
    • redefine

      protected Table redefine(TableDefinition newDefinitionExternal, TableDefinition newDefinitionInternal, SelectColumn[] viewColumns)
      Description copied from class: RedefinableTable
      Redefine this table with a subset of its current columns, with a potentially-differing definition to present to external interfaces and one or more select columns to apply.
      Specified by:
      redefine in class RedefinableTable<DeferredViewTable>
      Parameters:
      newDefinitionExternal - A TableDefinition that represents the results of redefine(newDefinitionInternal).view(viewColumns).
      newDefinitionInternal - A TableDefinition with a subset of this RedefinableTable's ColumnDefinitions.
      viewColumns - A set of SelectColumns to apply in order to transform a table with newDefinitionInternal to a table with newDefinitionExternal. Each column may read the result of an earlier column, as in TableOperations.view(Collection).
      Returns:
      the redefined table
    • redefineWithRename

      protected Table redefineWithRename(TableDefinition newDefinitionExternal, SourceColumn[] renameColumns)
      Description copied from class: RedefinableTable
      Redefine this table by renaming the table's columns. Unlike the view columns of RedefinableTable.redefine(TableDefinition, TableDefinition, SelectColumn[]), which apply in order, the rename columns apply simultaneously, as Table.renameColumns(Collection) requires: every rename column reads a column of this table, never the result of another rename column. Applied in order, a swap would read a column that the swap had already replaced.
      Specified by:
      redefineWithRename in class RedefinableTable<DeferredViewTable>
      Parameters:
      newDefinitionExternal - A TableDefinition that represents the result of the rename.
      renameColumns - One SourceColumn per column of newDefinitionExternal, in the same order, each naming a column of this table to read.
      Returns:
      the renamed table