Class SourceTable

All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, NotificationQueue.Dependency, Deflatable<Table>, Table, LivenessManager, LivenessNode, LivenessReferent, LongSizedDataStructure, DynamicNode, DynamicTable, NotificationStepReceiver, NotificationStepSource, SystemicObject, Serializable
Direct Known Subclasses:
PartitionAwareSourceTable, SimpleSourceTable

public abstract class SourceTable
extends RedefinableTable
Basic uncoalesced table that only adds keys.
See Also:
Serialized Form
  • Method Details

    • refresh

      @TestUseOnly public final void refresh()
      This is only for unit tests, at this time.
    • initializeAvailableLocations

      protected final void initializeAvailableLocations()
    • filterLocations

      protected Collection<TableLocation> filterLocations​(@NotNull Collection<TableLocation> foundLocations)
      Hook to allow found locations to be filtered (e.g. according to a where-clause on the partitioning column of a PartitionAwareSourceTable). The default implementation returns its input unmolested.
      Parameters:
      foundLocations - A Collection of TableLocations fetched from the table location provider, but not yet incorporated into the table
      Returns:
      A sub-Collection of the input
    • doCoalesce

      protected final QueryTable doCoalesce()
      Description copied from class: UncoalescedTable
      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).

      Specified by:
      doCoalesce in class UncoalescedTable
      Returns:
      The coalesced result table, suitable for caching
    • destroy

      protected void destroy()

      Attempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().

      This is intended to only ever be used as a side effect of decreasing the reference count to 0.

      Overrides:
      destroy in class BaseTable
    • initializeTransientFieldsForLiveness

      @VisibleForTesting public final void initializeTransientFieldsForLiveness()
      Package-private for Serializable sub-classes to use in readObject only. Public to allow unit tests in another package to work around mock issues where the constructor is never invoked.
    • tryRetainReference

      public final boolean tryRetainReference()
      Description copied from interface: LivenessReferent
      If this referent is "live", behave as LivenessReferent.retainReference() and return true. Otherwise, returns false rather than throwing an exception.
      Specified by:
      tryRetainReference in interface LivenessReferent
      Returns:
      True if this referent was retained, false otherwise
    • dropReference

      public final void dropReference()
      Description copied from interface: LivenessReferent
      Drop a previously-retained reference to this referent.
      Specified by:
      dropReference in interface LivenessReferent
    • getWeakReference

      public WeakReference<? extends LivenessReferent> getWeakReference()
      Description copied from interface: LivenessReferent
      Get a WeakReference to this referent. This may be cached, or newly created.
      Specified by:
      getWeakReference in interface LivenessReferent
      Returns:
      A new or cached reference to this referent
    • tryManage

      public final boolean tryManage​(@NotNull LivenessReferent referent)
      Description copied from interface: LivenessManager
      Attempt to add the specified referent to this manager.
      Specified by:
      tryManage in interface LivenessManager
      Parameters:
      referent - The referent to add
      Returns:
      Whether the referent was in fact added
    • onReferenceCountAtZero

      protected final void onReferenceCountAtZero()
      Description copied from class: ReferenceCounted
      Callback method that will be invoked when the reference count returns to zero.
      Specified by:
      onReferenceCountAtZero in class ReferenceCounted