添加Capacity调度器的源码注释

This commit is contained in:
LingZhaoHui 2024-11-09 22:14:47 +08:00
parent b43901c271
commit fbd6e04709
Signed by: zeekling
GPG Key ID: D96E4E75267CA2CC
2 changed files with 15 additions and 0 deletions

View File

@ -232,6 +232,12 @@ public static Resource clone(Resource res) {
return Resource.newInstance(res);
}
/**
* lhs = lhs + ths
* @param lhs
* @param rhs
* @return
*/
public static Resource addTo(Resource lhs, Resource rhs) {
int maxLength = ResourceUtils.getNumberOfCountableResourceTypes();
for (int i = 0; i < maxLength; i++) {

View File

@ -755,6 +755,15 @@ private boolean canAssign(Resource clusterResource, FiCaSchedulerNode node) {
return accept;
}
/**
* 获取子队列的队列限制,计算公式:
* <p>子队列的限制 = min(父队列的可用资源 + 子队列的已使用资源, 子队列的限制)<p/>
* @param child
* @param clusterResource
* @param parentLimits
* @param nodePartition
* @return
*/
private ResourceLimits getResourceLimitsOfChild(CSQueue child,
Resource clusterResource, Resource parentLimits,
String nodePartition) {