Package io.trino.spi.resourcegroups
Interface ResourceGroupConfigurationManager<C>
- Type Parameters:
C- the type of the manager-specific data structure
public interface ResourceGroupConfigurationManager<C>
The engine calls the
match(SelectionCriteria) method whenever a query is submitted,
and receives a SelectionContext in return which
contains a fully-qualified ResourceGroupId,
and a manager-specific data structure of type C.
At a later time, the engine may decide to construct a resource group with that ID. To do so, it will walk the tree to find the right position for the group, and then create it. It also creates any necessary parent groups. Every time the engine creates a group it will immediately call the configure method with the original context, allowing the manager to set the required properties on the group.
-
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(ResourceGroup group, SelectionContext<C> criteria) Implementations may retain a reference to the group, and re-configure it asynchronously.match(SelectionCriteria criteria) This method is called for every query that is submitted, so it should be fast.parentGroupContext(SelectionContext<C> context) This method is called when parent group of the one specified bymatch(SelectionCriteria)'sSelectionContext.getResourceGroupId()does not exist yet.
-
Method Details
-
configure
Implementations may retain a reference to the group, and re-configure it asynchronously. This method is called, once, when the group is created. -
match
This method is called for every query that is submitted, so it should be fast. -
parentGroupContext
This method is called when parent group of the one specified bymatch(SelectionCriteria)'sSelectionContext.getResourceGroupId()does not exist yet. It should return aSelectionContextappropriate forconfigurationof the parent group.- Parameters:
context- a selection context returned frommatch(SelectionCriteria)- Returns:
- a selection context suitable for
configure(ResourceGroup, SelectionContext)for the parent group
-