Class RegionedColumnSourceManager

java.lang.Object
io.deephaven.engine.table.impl.sources.regioned.RegionedColumnSourceManager
All Implemented Interfaces:
DelegatingLivenessNode, DelegatingLivenessReferent, LivenessManager, LivenessNode, LivenessReferent, ColumnSourceManager, PushdownFilterMatcher, PushdownPredicateManager

public class RegionedColumnSourceManager extends Object implements ColumnSourceManager, DelegatingLivenessNode, PushdownPredicateManager
Manage column sources made up of regions in their own row key address space.
  • Method Details

    • addLocation

      public void addLocation(@NotNull @NotNull TableLocation tableLocation)
      Description copied from interface: ColumnSourceManager
      Add a table location to the list to be checked in run().
      Specified by:
      addLocation in interface ColumnSourceManager
      Parameters:
      tableLocation - The table location to be added
    • removeLocationKey

      public void removeLocationKey(@NotNull @NotNull ImmutableTableLocationKey locationKey)
      Description copied from interface: ColumnSourceManager
      Remove a table location key from the sources.
      Specified by:
      removeLocationKey in interface ColumnSourceManager
      Parameters:
      locationKey - the location key being removed
    • initialize

      public TrackingWritableRowSet initialize()
      Description copied from interface: ColumnSourceManager
      Observe initial sizes for the previously added table locations, and update the managed column sources accordingly. Create any data indexes that may be derived from the locations.
      Specified by:
      initialize in interface ColumnSourceManager
      Returns:
      The initial set of initially-available row keys, to be owned by the caller. This row set will have a data indexer populated with any data indexes that were created.
    • refresh

      public TableUpdate refresh()
      Description copied from interface: ColumnSourceManager
      Observe size changes in the previously added table locations, and update the managed column sources accordingly.
      Specified by:
      refresh in interface ColumnSourceManager
      Returns:
      The set of added row keys, to be owned by the caller
    • deliverError

      public void deliverError(@NotNull @NotNull Throwable error, @Nullable TableListener.Entry entry)
      Description copied from interface: ColumnSourceManager
      Advise this ColumnSourceManager that an error has occurred, and that it will no longer be refreshed. This method should ensure that the error is delivered to downstream listeners if appropriate.
      Specified by:
      deliverError in interface ColumnSourceManager
      Parameters:
      error - The error that occurred
      entry - The failing node's entry, if known
    • allLocations

      public final Collection<TableLocation> allLocations()
      Description copied from interface: ColumnSourceManager
      Get the added locations, first the ones that have been "included" (found to exist with non-zero size) in order of inclusion, then the remainder in order of discovery.
      Specified by:
      allLocations in interface ColumnSourceManager
      Returns:
      All known locations, ordered as described
    • includedLocations

      public final Collection<TableLocation> includedLocations()
      Description copied from interface: ColumnSourceManager
      Get the added locations that have been found to exist and have non-zero size.
      Specified by:
      includedLocations in interface ColumnSourceManager
      Returns:
      The added locations that have been found to exist and have non-zero size
    • locationTable

      public Table locationTable()
      Description copied from interface: ColumnSourceManager
      Get the added locations that have been found to exist and have non-zero size as a table containing the row sets for each location. May only be called after ColumnSourceManager.initialize(). The returned table will also have columns corresponding to the partitions found in the locations, for the convenience of many downstream operations.
      Specified by:
      locationTable in interface ColumnSourceManager
      Returns:
      The added locations that have been found to exist and have non-zero size
    • locationColumnName

      public String locationColumnName()
      Description copied from interface: ColumnSourceManager
      Get the name of the column that contains the TableLocation values from ColumnSourceManager.locationTable().
      Specified by:
      locationColumnName in interface ColumnSourceManager
      Returns:
      The name of the location column
    • rowSetColumnName

      public String rowSetColumnName()
      Description copied from interface: ColumnSourceManager
      Get the name of the column that contains the RowSet values from ColumnSourceManager.locationTable().
      Specified by:
      rowSetColumnName in interface ColumnSourceManager
      Returns:
      The name of the row set column
    • isEmpty

      public final boolean isEmpty()
      Description copied from interface: ColumnSourceManager
      Report whether this ColumnSourceManager has no locations that have been "included" (i.e. found to exist with non-zero size).
      Specified by:
      isEmpty in interface ColumnSourceManager
      Returns:
      True if there are no included locations
    • getColumnSources

      public final Map<String,? extends ColumnSource<?>> getColumnSources()
      Description copied from interface: ColumnSourceManager
      Get a map of name to ColumnSource for the column sources maintained by this manager.
      Specified by:
      getColumnSources in interface ColumnSourceManager
      Returns:
      An unmodifiable view of the column source map maintained by this manager.
    • asLivenessNode

      public LivenessNode asLivenessNode()
      Description copied from interface: DelegatingLivenessNode
      Returns the "real" LivenessNode instance. When implementing this, care should be taken to match lifecycle of the DelegatingLivenessNode instance with this instance, as the returned LivenessNode behaves as a proxy for this.
      Specified by:
      asLivenessNode in interface DelegatingLivenessNode
      Returns:
      a LivenessNode to use to manage this object's liveness.
    • getTableAttributes

      public Map<String,Object> getTableAttributes(@NotNull @NotNull TableUpdateMode tableUpdateMode, @NotNull @NotNull TableUpdateMode tableLocationUpdateMode)
      Description copied from interface: ColumnSourceManager
      Get a map of Table attributes that can be applied to the output source table, given the update modes of the underlying table location provider.
      Specified by:
      getTableAttributes in interface ColumnSourceManager
      Parameters:
      tableUpdateMode - The update mode of the table location set
      tableLocationUpdateMode - The update mode of the table location rows
    • estimatePushdownFilterCost

      public void estimatePushdownFilterCost(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, JobScheduler jobScheduler, LongConsumer onComplete, Consumer<Exception> onError)
      Description copied from interface: PushdownFilterMatcher
      Estimate the cost of pushing down the next pushdown filter. This returns a unitless value to compare the cost of executing different filters. Common costs are listed in PushdownResult (such as PushdownResult.METADATA_STATS_COST) and should be used as a baseline for estimating the cost of newly implemented pushdown operations.

      A no-op implementation should simply complete with Long.MAX_VALUE.

      Specified by:
      estimatePushdownFilterCost in interface PushdownFilterMatcher
      Parameters:
      filter - The filter to test.
      selection - The set of rows to tests.
      usePrev - Whether to use the previous result
      context - The PushdownFilterContext to use for the pushdown operation.
      jobScheduler - The job scheduler to use for scheduling child jobs
      onComplete - Consumer of the estimated cost of the pushdown operation. 9223372036854775807L indicates that the filter cannot be pushed down.
      onError - Consumer of any exceptions that occur during the estimate operation
    • pushdownFilter

      public void pushdownFilter(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, long costCeiling, JobScheduler jobScheduler, Consumer<PushdownResult> onComplete, Consumer<Exception> onError)
      Description copied from interface: PushdownFilterMatcher
      Push down the given filter to the underlying table and pass the result to the consumer. This method is expected to execute all pushdown filter steps that are greater than PushdownFilterContext.executedFilterCost() and less than or equal to costCeiling.

      The resulting PushdownResult (to onComplete) must only contain rows from selection. The match row set are rows that are guaranteed to match. The implicitly "missing" rows selection - match - maybeMatch are rows that are guaranteed to not match. The remaining maybe match row set are rows that may, or may not, match. The pushdown result ownership passes to onComplete.

      A no-op implementation should simply complete with PushdownResult.maybeMatch(selection).

      Specified by:
      pushdownFilter in interface PushdownFilterMatcher
      Parameters:
      filter - The filter to apply.
      selection - The set of rows to test.
      usePrev - Whether to use the previous result
      context - The PushdownFilterContext to use for the pushdown operation.
      costCeiling - Execute all possible filters with a cost less than or equal this value.
      jobScheduler - The job scheduler to use for scheduling child jobs
      onComplete - Consumer of the output rowsets for added and modified rows that pass the filter
      onError - Consumer of any exceptions that occur during the pushdown operation
    • makePushdownFilterContext

      public PushdownFilterContext makePushdownFilterContext(WhereFilter filter, List<ColumnSource<?>> filterSources)
      Description copied from interface: PushdownFilterMatcher
      Create a pushdown filter context for this entity.
      Specified by:
      makePushdownFilterContext in interface PushdownFilterMatcher
      Parameters:
      filter - the filter to use while making the context
      filterSources - the column sources that match the filter column names
      Returns:
      the created filter context