YARN-11650. Refactoring variable names related multiNodePolicy in MultiNodePolicySpec, FiCaSchedulerApp and AbstractCSQueue (#6490) Contributed by Jiandan Yang.

Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
Yang Jiandan 2024-01-29 21:37:32 +08:00 committed by GitHub
parent 4046751939
commit dffb505725
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 22 additions and 22 deletions

View File

@ -98,7 +98,7 @@ public abstract class AbstractCSQueue implements CSQueue {
final ResourceCalculator resourceCalculator;
Set<String> resourceTypes;
final RMNodeLabelsManager labelManager;
private String multiNodeSortingPolicyName = null;
private String multiNodeSortingPolicyClassName = null;
Map<AccessType, AccessControlList> acls =
new HashMap<AccessType, AccessControlList>();
@ -423,7 +423,7 @@ protected void setupQueueConfigs(Resource clusterResource) throws
getQueuePathObject());
// Update multi-node sorting algorithm for scheduling as configured.
setMultiNodeSortingPolicyName(
setMultiNodeSortingPolicyClassName(
configuration.getMultiNodesSortingAlgorithmPolicy(getQueuePathObject()));
// Setup application related limits
@ -1197,12 +1197,12 @@ public void recoverDrainingState() {
}
@Override
public String getMultiNodeSortingPolicyName() {
return this.multiNodeSortingPolicyName;
public String getMultiNodeSortingPolicyClassName() {
return this.multiNodeSortingPolicyClassName;
}
public void setMultiNodeSortingPolicyName(String policyName) {
this.multiNodeSortingPolicyName = policyName;
public void setMultiNodeSortingPolicyClassName(String policyName) {
this.multiNodeSortingPolicyClassName = policyName;
}
public long getMaximumApplicationLifetime() {

View File

@ -529,7 +529,7 @@ public void validateSubmitApplication(ApplicationId applicationId,
* Get Multi Node scheduling policy name.
* @return policy name
*/
String getMultiNodeSortingPolicyName();
String getMultiNodeSortingPolicyClassName();
/**
* Get the maximum lifetime in seconds of an application which is submitted to

View File

@ -187,17 +187,17 @@ private void updateMultiNodeSortingPolicy(RMApp rmApp) {
return;
}
String queueName = null;
String policyClassName = null;
if (scheduler instanceof CapacityScheduler) {
queueName = getCSLeafQueue().getMultiNodeSortingPolicyName();
policyClassName = getCSLeafQueue().getMultiNodeSortingPolicyClassName();
}
if (!appSchedulingInfo.getApplicationSchedulingEnvs().containsKey(
ApplicationSchedulingConfig.ENV_MULTI_NODE_SORTING_POLICY_CLASS)
&& queueName != null) {
&& policyClassName != null) {
appSchedulingInfo.getApplicationSchedulingEnvs().put(
ApplicationSchedulingConfig.ENV_MULTI_NODE_SORTING_POLICY_CLASS,
queueName);
policyClassName);
}
}

View File

@ -22,12 +22,12 @@
*/
public class MultiNodePolicySpec {
private String policyName;
private String policyClassName;
private long sortingInterval;
public MultiNodePolicySpec(String policyName, long timeout) {
public MultiNodePolicySpec(String policyClassName, long timeout) {
this.setSortingInterval(timeout);
this.setPolicyName(policyName);
this.setPolicyClassName(policyClassName);
}
public long getSortingInterval() {
@ -38,18 +38,18 @@ public void setSortingInterval(long timeout) {
this.sortingInterval = timeout;
}
public String getPolicyName() {
return policyName;
public String getPolicyClassName() {
return policyClassName;
}
public void setPolicyName(String policyName) {
this.policyName = policyName;
public void setPolicyClassName(String policyClassName) {
this.policyClassName = policyClassName;
}
@Override
public String toString() {
return "MultiNodePolicySpec {" +
"policyName='" + policyName + '\'' +
"policyClassName='" + policyClassName + '\'' +
", sortingInterval=" + sortingInterval +
'}';
}

View File

@ -74,9 +74,9 @@ public synchronized MultiNodeLookupPolicy<N> getMultiNodeLookupPolicy() {
}
public void serviceInit(Configuration conf) throws Exception {
LOG.info("Initializing MultiNodeSorter=" + policySpec.getPolicyName()
LOG.info("Initializing MultiNodeSorter=" + policySpec.getPolicyClassName()
+ ", with sorting interval=" + policySpec.getSortingInterval());
initPolicy(policySpec.getPolicyName());
initPolicy(policySpec.getPolicyClassName());
super.serviceInit(conf);
}

View File

@ -89,7 +89,7 @@ private void createAllPolicies() {
MultiNodeSorter<N> mon = new MultiNodeSorter<N>(rmContext, policy);
mon.init(conf);
mon.start();
runningMultiNodeSorters.put(policy.getPolicyName(), mon);
runningMultiNodeSorters.put(policy.getPolicyClassName(), mon);
}
}