Class UncoalescedTableImpl<IMPL_TYPE extends UncoalescedTable<IMPL_TYPE>>

Type Parameters:
IMPL_TYPE - the specific type of UncoalescedTable that this class implements, used for covariant return types
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
Direct Known Subclasses:
RedefinableTable

public abstract class UncoalescedTableImpl<IMPL_TYPE extends UncoalescedTable<IMPL_TYPE>> extends UncoalescedTable<IMPL_TYPE>
The standard implementation of an UncoalescedTable.

When the Table is coalesced, a hard reference is stored to the result. Any future coalesce() call reuses the same result if it is static or remains live. If the coalesce operation is context dependent, then you must directly extend UncoalescedTable instead of extending UncoalescedTableImpl.

See Also:
  • Constructor Details

    • UncoalescedTableImpl

      protected UncoalescedTableImpl(@NotNull @NotNull TableDefinition definition, @NotNull @NotNull String description)
  • Method Details

    • doCoalesce

      protected abstract Table doCoalesce()
      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).

      Returns:
      The coalesced result table, suitable for caching
    • coalesce

      public final Table coalesce()
      Description copied from interface: Table
      Explicitly ensure that any work needed to make a table addressable, iterable, or queryable has been done, and return the coalesced child table if appropriate.
      Specified by:
      coalesce in interface Table
      Specified by:
      coalesce in interface TableDefaults
      Specified by:
      coalesce in class UncoalescedTable<IMPL_TYPE extends UncoalescedTable<IMPL_TYPE>>
      Returns:
      This table, or a fully-coalesced child
    • coalescedIfAvailable

      public final Optional<Table> coalescedIfAvailable()
      Description copied from class: UncoalescedTable
      Get the memoized result of a previous UncoalescedTable.coalesce(), if one exists and is still usable, without forcing coalescing. This allows callers to take advantage of work that has already been done, while leaving the table uncoalesced (and thus able to benefit from deferred-operation optimizations, e.g. PartitionAwareSourceTable's location filtering) when it has not.

      A present result is managed by the enclosing liveness scope if it requires management.

      The default implementation never offers a result for reuse; subclasses that memoize their coalesced result should override.
      Overrides:
      coalescedIfAvailable in class UncoalescedTable<IMPL_TYPE extends UncoalescedTable<IMPL_TYPE>>
      Returns:
      The existing coalesced result, or Optional.empty() if there is none available for reuse
    • setCoalesced

      protected final void setCoalesced(Table coalesced)
      Proactively set the coalesced result table. See doCoalesce() for the caller's responsibilities. Note that it is an error to call this more than once with a non-null input.
      Parameters:
      coalesced - The coalesced result table, suitable for caching
    • getCoalesced

      @Nullable protected final @Nullable Table getCoalesced()