use of com.facebook.presto.spi.resourceGroups.ResourceGroupState in project presto by prestodb.
the class InternalResourceGroup method getInfo.
public ResourceGroupInfo getInfo() {
synchronized (root) {
checkState(!subGroups.isEmpty() || (descendantRunningQueries == 0 && descendantQueuedQueries == 0), "Leaf resource group has descendant queries.");
List<ResourceGroupInfo> infos = subGroups.values().stream().map(InternalResourceGroup::getInfo).collect(toImmutableList());
ResourceGroupState resourceGroupState;
if (canRunMore()) {
resourceGroupState = CAN_RUN;
} else if (canQueueMore()) {
resourceGroupState = CAN_QUEUE;
} else {
resourceGroupState = FULL;
}
return new ResourceGroupInfo(id, new DataSize(softMemoryLimitBytes, BYTE), maxRunningQueries, maxQueuedQueries, resourceGroupState, eligibleSubGroups.size(), new DataSize(cachedMemoryUsageBytes, BYTE), runningQueries.size() + descendantRunningQueries, queuedQueries.size() + descendantQueuedQueries, infos);
}
}
Aggregations