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 TypeMethodDescriptionvoid
addLocation
(@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"LivenessNode
instance.void
deliverError
(@NotNull Throwable error, TableListener.Entry entry) Advise this ColumnSourceManager that an error has occurred, and that it will no longer berefreshed
.void
estimatePushdownFilterCost
(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 toColumnSource
for 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 boolean
isEmpty()
Report whether this ColumnSourceManager has no locations that have been "included" (i.e.Get the name of the column that contains theTableLocation
values fromColumnSourceManager.locationTable()
.Get the added locations that have been found to exist and have non-zero size as a table containing therow sets
for each location.makePushdownFilterContext
(WhereFilter filter, List<ColumnSource<?>> filterSources) Create a pushdown filter context for this entity.void
pushdownFilter
(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.void
removeLocationKey
(@NotNull ImmutableTableLocationKey locationKey) Remove a table location key from the sources.Get the name of the column that contains theRowSet
values fromColumnSourceManager.locationTable()
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.DelegatingLivenessNode
asLivenessReferent, tryManage, tryUnmanage, tryUnmanage
Methods inherited from interface io.deephaven.engine.liveness.DelegatingLivenessReferent
dropReference, getWeakReference, tryRetainReference
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
getReferentDescription, retainReference
-
Method Details
-
addLocation
Description copied from interface:ColumnSourceManager
Add a table location to the list to be checked in run().- Specified by:
addLocation
in interfaceColumnSourceManager
- Parameters:
tableLocation
- The table location to be added
-
removeLocationKey
Description copied from interface:ColumnSourceManager
Remove a table location key from the sources.- Specified by:
removeLocationKey
in interfaceColumnSourceManager
- Parameters:
locationKey
- the location key being removed
-
initialize
Description copied from interface:ColumnSourceManager
Observe initial sizes for the previously added table locations, and update the managed column sources accordingly. Create anydata indexes
that may be derived from the locations.- Specified by:
initialize
in interfaceColumnSourceManager
- 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
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 interfaceColumnSourceManager
- Returns:
- The set of added row keys, to be owned by the caller
-
deliverError
Description copied from interface:ColumnSourceManager
Advise this ColumnSourceManager that an error has occurred, and that it will no longer berefreshed
. This method should ensure that the error is delivered to downstreamlisteners
if appropriate.- Specified by:
deliverError
in interfaceColumnSourceManager
- Parameters:
error
- The error that occurredentry
- The failing node's entry, if known
-
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 interfaceColumnSourceManager
- Returns:
- All known locations, ordered as described
-
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 interfaceColumnSourceManager
- Returns:
- The added locations that have been found to exist and have non-zero size
-
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 therow sets
for 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:
locationTable
in interfaceColumnSourceManager
- Returns:
- The added locations that have been found to exist and have non-zero size
-
locationColumnName
Description copied from interface:ColumnSourceManager
Get the name of the column that contains theTableLocation
values fromColumnSourceManager.locationTable()
.- Specified by:
locationColumnName
in interfaceColumnSourceManager
- Returns:
- The name of the location column
-
rowSetColumnName
Description copied from interface:ColumnSourceManager
Get the name of the column that contains theRowSet
values fromColumnSourceManager.locationTable()
.- Specified by:
rowSetColumnName
in interfaceColumnSourceManager
- 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 interfaceColumnSourceManager
- Returns:
- True if there are no included locations
-
getColumnSources
Description copied from interface:ColumnSourceManager
Get a map of name toColumnSource
for the column sources maintained by this manager.- Specified by:
getColumnSources
in interfaceColumnSourceManager
- Returns:
- An unmodifiable view of the column source map maintained by this manager.
-
asLivenessNode
Description copied from interface:DelegatingLivenessNode
Returns the "real"LivenessNode
instance. When implementing this, care should be taken to match lifecycle of theDelegatingLivenessNode
instance with this instance, as the returnedLivenessNode
behaves as a proxy forthis
.- Specified by:
asLivenessNode
in 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: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 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: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 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:
estimatePushdownFilterCost
in interfacePushdownFilterMatcher
- Parameters:
filter
- Thefilter
to test.selection
- The set of rows to tests.usePrev
- Whether to use the previous resultcontext
- ThePushdownFilterContext
to 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: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 thanPushdownFilterContext.executedFilterCost()
and less than or equal tocostCeiling
.The resulting
PushdownResult
(toonComplete
) must only contain rows fromselection
. Thematch row set
are rows that are guaranteed to match. The implicitly "missing" rowsselection - match - maybeMatch
are rows that are guaranteed to not match. The remainingmaybe match row set
are 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:
pushdownFilter
in interfacePushdownFilterMatcher
- Parameters:
filter
- Thefilter
to apply.selection
- The set of rows to test.usePrev
- Whether to use the previous resultcontext
- ThePushdownFilterContext
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 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:PushdownFilterMatcher
Create a pushdown filter context for this entity.- Specified by:
makePushdownFilterContext
in 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
-