添加Capacity调度器的源码注释
This commit is contained in:
parent
b43901c271
commit
fbd6e04709
@ -232,6 +232,12 @@ public static Resource clone(Resource res) {
|
|||||||
return Resource.newInstance(res);
|
return Resource.newInstance(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* lhs = lhs + ths
|
||||||
|
* @param lhs
|
||||||
|
* @param rhs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static Resource addTo(Resource lhs, Resource rhs) {
|
public static Resource addTo(Resource lhs, Resource rhs) {
|
||||||
int maxLength = ResourceUtils.getNumberOfCountableResourceTypes();
|
int maxLength = ResourceUtils.getNumberOfCountableResourceTypes();
|
||||||
for (int i = 0; i < maxLength; i++) {
|
for (int i = 0; i < maxLength; i++) {
|
||||||
|
@ -755,6 +755,15 @@ private boolean canAssign(Resource clusterResource, FiCaSchedulerNode node) {
|
|||||||
return accept;
|
return accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取子队列的队列限制,计算公式:
|
||||||
|
* <p>子队列的限制 = min(父队列的可用资源 + 子队列的已使用资源, 子队列的限制)<p/>
|
||||||
|
* @param child
|
||||||
|
* @param clusterResource
|
||||||
|
* @param parentLimits
|
||||||
|
* @param nodePartition
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
private ResourceLimits getResourceLimitsOfChild(CSQueue child,
|
private ResourceLimits getResourceLimitsOfChild(CSQueue child,
|
||||||
Resource clusterResource, Resource parentLimits,
|
Resource clusterResource, Resource parentLimits,
|
||||||
String nodePartition) {
|
String nodePartition) {
|
||||||
|
Loading…
Reference in New Issue
Block a user