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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLocation(@NotNull TableLocation tableLocation) Add a table location to the list to be checked in run().final Collection<TableLocation>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.Returns the "real"LivenessNodeinstance.voiddeliverError(@NotNull Throwable error, TableListener.Entry entry) Advise this ColumnSourceManager that an error has occurred, and that it will no longer berefreshed.voidestimatePushdownFilterCost(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, JobScheduler jobScheduler, LongConsumer onComplete, Consumer<Exception> onError) Estimate the cost of pushing down the next pushdown filter.final Map<String,? extends ColumnSource<?>> Get a map of name toColumnSourcefor the column sources maintained by this manager.getTableAttributes(@NotNull TableUpdateMode tableUpdateMode, @NotNull TableUpdateMode tableLocationUpdateMode) 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.final Collection<TableLocation>Get the added locations that have been found to exist and have non-zero size.Observe initial sizes for the previously added table locations, and update the managed column sources accordingly.final booleanisEmpty()Report whether this ColumnSourceManager has no locations that have been "included" (i.e.Get the name of the column that contains theTableLocationvalues fromColumnSourceManager.locationTable().Get the added locations that have been found to exist and have non-zero size as a table containing therow setsfor each location.makePushdownFilterContext(WhereFilter filter, List<ColumnSource<?>> filterSources) Create a pushdown filter context for this entity.voidpushdownFilter(WhereFilter filter, RowSet selection, boolean usePrev, PushdownFilterContext context, long costCeiling, JobScheduler jobScheduler, Consumer<PushdownResult> onComplete, Consumer<Exception> onError) Push down the given filter to the underlying table and pass the result to the consumer.refresh()Observe size changes in the previously added table locations, and update the managed column sources accordingly.voidremoveLocationKey(@NotNull ImmutableTableLocationKey locationKey) Remove a table location key from the sources.Get the name of the column that contains theRowSetvalues fromColumnSourceManager.locationTable().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.DelegatingLivenessNode
asLivenessReferent, tryManage, tryUnmanage, tryUnmanageMethods inherited from interface io.deephaven.engine.liveness.DelegatingLivenessReferent
dropReference, getWeakReference, tryRetainReferenceMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
getReferentDescription, retainReference
-
Method Details
-
addLocation
Description copied from interface:ColumnSourceManagerAdd a table location to the list to be checked in run().- Specified by:
addLocationin interfaceColumnSourceManager- Parameters:
tableLocation- The table location to be added
-
removeLocationKey
Description copied from interface:ColumnSourceManagerRemove a table location key from the sources.- Specified by:
removeLocationKeyin interfaceColumnSourceManager- Parameters:
locationKey- the location key being removed
-
initialize
Description copied from interface:ColumnSourceManagerObserve initial sizes for the previously added table locations, and update the managed column sources accordingly. Create anydata indexesthat may be derived from the locations.- Specified by:
initializein interfaceColumnSourceManager- Returns:
- The initial set of initially-available row keys, to be owned by the caller. This row set will have a
data indexerpopulated with any data indexes that were created.
-
refresh
Description copied from interface:ColumnSourceManagerObserve size changes in the previously added table locations, and update the managed column sources accordingly.- Specified by:
refreshin interfaceColumnSourceManager- Returns:
- The set of added row keys, to be owned by the caller
-
deliverError
Description copied from interface:ColumnSourceManagerAdvise this ColumnSourceManager that an error has occurred, and that it will no longer berefreshed. This method should ensure that the error is delivered to downstreamlistenersif appropriate.- Specified by:
deliverErrorin interfaceColumnSourceManager- Parameters:
error- The error that occurredentry- The failing node's entry, if known
-
allLocations
Description copied from interface:ColumnSourceManagerGet 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:
allLocationsin interfaceColumnSourceManager- Returns:
- All known locations, ordered as described
-
includedLocations
Description copied from interface:ColumnSourceManagerGet the added locations that have been found to exist and have non-zero size.- Specified by:
includedLocationsin interfaceColumnSourceManager- Returns:
- The added locations that have been found to exist and have non-zero size
-
locationTable
Description copied from interface:ColumnSourceManagerGet the added locations that have been found to exist and have non-zero size as a table containing therow setsfor each location. May only be called afterColumnSourceManager.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:
locationTablein interfaceColumnSourceManager- Returns:
- The added locations that have been found to exist and have non-zero size
-
locationColumnName
Description copied from interface:ColumnSourceManagerGet the name of the column that contains theTableLocationvalues fromColumnSourceManager.locationTable().- Specified by:
locationColumnNamein interfaceColumnSourceManager- Returns:
- The name of the location column
-
rowSetColumnName
Description copied from interface:ColumnSourceManagerGet the name of the column that contains theRowSetvalues fromColumnSourceManager.locationTable().- Specified by:
rowSetColumnNamein interfaceColumnSourceManager- Returns:
- The name of the row set column
-
isEmpty
public final boolean isEmpty()Description copied from interface:ColumnSourceManagerReport whether this ColumnSourceManager has no locations that have been "included" (i.e. found to exist with non-zero size).- Specified by:
isEmptyin interfaceColumnSourceManager- Returns:
- True if there are no included locations
-
getColumnSources
Description copied from interface:ColumnSourceManagerGet a map of name toColumnSourcefor the column sources maintained by this manager.- Specified by:
getColumnSourcesin interfaceColumnSourceManager- Returns:
- An unmodifiable view of the column source map maintained by this manager.
-
asLivenessNode
Description copied from interface:DelegatingLivenessNodeReturns the "real"LivenessNodeinstance. When implementing this, care should be taken to match lifecycle of theDelegatingLivenessNodeinstance with this instance, as the returnedLivenessNodebehaves as a proxy forthis.- Specified by:
asLivenessNodein interfaceDelegatingLivenessNode- 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:ColumnSourceManagerGet 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:
getTableAttributesin interfaceColumnSourceManager- Parameters:
tableUpdateMode- The update mode of the table location settableLocationUpdateMode- 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:PushdownFilterMatcherEstimate 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 inPushdownResult(such asPushdownResult.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:
estimatePushdownFilterCostin interfacePushdownFilterMatcher- Parameters:
filter- Thefilterto test.selection- The set of rows to tests.usePrev- Whether to use the previous resultcontext- ThePushdownFilterContextto use for the pushdown operation.jobScheduler- The job scheduler to use for scheduling child jobsonComplete- 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:PushdownFilterMatcherPush 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 thanPushdownFilterContext.executedFilterCost()and less than or equal tocostCeiling.The resulting
PushdownResult(toonComplete) must only contain rows fromselection. Thematch row setare rows that are guaranteed to match. The implicitly "missing" rowsselection - match - maybeMatchare rows that are guaranteed to not match. The remainingmaybe match row setare rows that may, or may not, match. The pushdown result ownership passes toonComplete.A no-op implementation should simply complete with
PushdownResult.maybeMatch(selection).- Specified by:
pushdownFilterin interfacePushdownFilterMatcher- Parameters:
filter- Thefilterto apply.selection- The set of rows to test.usePrev- Whether to use the previous resultcontext- ThePushdownFilterContextto 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 jobsonComplete- Consumer of the output rowsets for added and modified rows that pass the filteronError- Consumer of any exceptions that occur during the pushdown operation
-
makePushdownFilterContext
public PushdownFilterContext makePushdownFilterContext(WhereFilter filter, List<ColumnSource<?>> filterSources) Description copied from interface:PushdownFilterMatcherCreate a pushdown filter context for this entity.- Specified by:
makePushdownFilterContextin interfacePushdownFilterMatcher- Parameters:
filter- the filter to use while making the contextfilterSources- the column sources that match the filter column names- Returns:
- the created filter context
-