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:
parent
4046751939
commit
dffb505725
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 +
|
||||
'}';
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user