Class InternalResourceGroup
- java.lang.Object
-
- io.trino.execution.resourcegroups.InternalResourceGroup
-
- All Implemented Interfaces:
ResourceGroup
@ThreadSafe public class InternalResourceGroup extends Object implements ResourceGroup
Resource groups form a tree, and all access to a group is guarded by the root of the tree. Queries are submitted to leaf groups. Never to intermediate groups. Intermediate groups aggregate resource consumption from their children, and may have their own limitations that are enforced.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_WEIGHT
-
Constructor Summary
Constructors Modifier Constructor Description InternalResourceGroup(String name, BiConsumer<InternalResourceGroup,Boolean> jmxExportListener, Executor executor)protectedInternalResourceGroup(Optional<InternalResourceGroup> parent, String name, BiConsumer<InternalResourceGroup,Boolean> jmxExportListener, Executor executor)
-
Method Summary
-
-
-
Field Detail
-
DEFAULT_WEIGHT
public static final int DEFAULT_WEIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InternalResourceGroup
public InternalResourceGroup(String name, BiConsumer<InternalResourceGroup,Boolean> jmxExportListener, Executor executor)
-
InternalResourceGroup
protected InternalResourceGroup(Optional<InternalResourceGroup> parent, String name, BiConsumer<InternalResourceGroup,Boolean> jmxExportListener, Executor executor)
-
-
Method Detail
-
getFullInfo
public ResourceGroupInfo getFullInfo()
-
getInfo
public ResourceGroupInfo getInfo()
-
getPathToRoot
public List<ResourceGroupInfo> getPathToRoot()
-
getId
public ResourceGroupId getId()
- Specified by:
getIdin interfaceResourceGroup
-
getRunningQueries
public int getRunningQueries()
-
getQueuedQueries
public int getQueuedQueries()
-
getWaitingQueuedQueries
public int getWaitingQueuedQueries()
-
getSoftMemoryLimitBytes
public long getSoftMemoryLimitBytes()
- Specified by:
getSoftMemoryLimitBytesin interfaceResourceGroup
-
setSoftMemoryLimitBytes
public void setSoftMemoryLimitBytes(long limit)
- Specified by:
setSoftMemoryLimitBytesin interfaceResourceGroup
-
getSoftCpuLimit
public Duration getSoftCpuLimit()
- Specified by:
getSoftCpuLimitin interfaceResourceGroup
-
setSoftCpuLimit
public void setSoftCpuLimit(Duration limit)
- Specified by:
setSoftCpuLimitin interfaceResourceGroup
-
getHardCpuLimit
public Duration getHardCpuLimit()
- Specified by:
getHardCpuLimitin interfaceResourceGroup
-
setHardCpuLimit
public void setHardCpuLimit(Duration limit)
- Specified by:
setHardCpuLimitin interfaceResourceGroup
-
getCpuQuotaGenerationMillisPerSecond
public long getCpuQuotaGenerationMillisPerSecond()
- Specified by:
getCpuQuotaGenerationMillisPerSecondin interfaceResourceGroup
-
setCpuQuotaGenerationMillisPerSecond
public void setCpuQuotaGenerationMillisPerSecond(long rate)
- Specified by:
setCpuQuotaGenerationMillisPerSecondin interfaceResourceGroup
-
getSoftConcurrencyLimit
public int getSoftConcurrencyLimit()
- Specified by:
getSoftConcurrencyLimitin interfaceResourceGroup
-
setSoftConcurrencyLimit
public void setSoftConcurrencyLimit(int softConcurrencyLimit)
- Specified by:
setSoftConcurrencyLimitin interfaceResourceGroup
-
getHardConcurrencyLimit
public int getHardConcurrencyLimit()
- Specified by:
getHardConcurrencyLimitin interfaceResourceGroup
-
setHardConcurrencyLimit
public void setHardConcurrencyLimit(int hardConcurrencyLimit)
- Specified by:
setHardConcurrencyLimitin interfaceResourceGroup
-
getMaxQueuedQueries
public int getMaxQueuedQueries()
- Specified by:
getMaxQueuedQueriesin interfaceResourceGroup
-
setMaxQueuedQueries
public void setMaxQueuedQueries(int maxQueuedQueries)
- Specified by:
setMaxQueuedQueriesin interfaceResourceGroup
-
getTimeBetweenStartsSec
public io.airlift.stats.CounterStat getTimeBetweenStartsSec()
-
getSchedulingWeight
public int getSchedulingWeight()
- Specified by:
getSchedulingWeightin interfaceResourceGroup
-
setSchedulingWeight
public void setSchedulingWeight(int weight)
- Specified by:
setSchedulingWeightin interfaceResourceGroup
-
getSchedulingPolicy
public SchedulingPolicy getSchedulingPolicy()
- Specified by:
getSchedulingPolicyin interfaceResourceGroup
-
setSchedulingPolicy
public void setSchedulingPolicy(SchedulingPolicy policy)
- Specified by:
setSchedulingPolicyin interfaceResourceGroup
-
getJmxExport
public boolean getJmxExport()
- Specified by:
getJmxExportin interfaceResourceGroup
-
setJmxExport
public void setJmxExport(boolean export)
- Specified by:
setJmxExportin interfaceResourceGroup
-
getOrCreateSubGroup
public InternalResourceGroup getOrCreateSubGroup(String name)
-
run
public void run(ManagedQueryExecution query)
-
updateGroupsAndProcessQueuedQueries
public void updateGroupsAndProcessQueuedQueries()
-
generateCpuQuota
public void generateCpuQuota(long elapsedSeconds)
-
triggerProcessQueuedQueries
public void triggerProcessQueuedQueries()
-
updateResourceUsageAndGetDelta
protected io.trino.execution.resourcegroups.ResourceUsage updateResourceUsageAndGetDelta()
-
internalGenerateCpuQuota
protected void internalGenerateCpuQuota(long elapsedSeconds)
-
internalStartNext
protected boolean internalStartNext()
-
subGroups
public Collection<InternalResourceGroup> subGroups()
-
-