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;
|
final ResourceCalculator resourceCalculator;
|
||||||
Set<String> resourceTypes;
|
Set<String> resourceTypes;
|
||||||
final RMNodeLabelsManager labelManager;
|
final RMNodeLabelsManager labelManager;
|
||||||
private String multiNodeSortingPolicyName = null;
|
private String multiNodeSortingPolicyClassName = null;
|
||||||
|
|
||||||
Map<AccessType, AccessControlList> acls =
|
Map<AccessType, AccessControlList> acls =
|
||||||
new HashMap<AccessType, AccessControlList>();
|
new HashMap<AccessType, AccessControlList>();
|
||||||
@ -423,7 +423,7 @@ protected void setupQueueConfigs(Resource clusterResource) throws
|
|||||||
getQueuePathObject());
|
getQueuePathObject());
|
||||||
|
|
||||||
// Update multi-node sorting algorithm for scheduling as configured.
|
// Update multi-node sorting algorithm for scheduling as configured.
|
||||||
setMultiNodeSortingPolicyName(
|
setMultiNodeSortingPolicyClassName(
|
||||||
configuration.getMultiNodesSortingAlgorithmPolicy(getQueuePathObject()));
|
configuration.getMultiNodesSortingAlgorithmPolicy(getQueuePathObject()));
|
||||||
|
|
||||||
// Setup application related limits
|
// Setup application related limits
|
||||||
@ -1197,12 +1197,12 @@ public void recoverDrainingState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMultiNodeSortingPolicyName() {
|
public String getMultiNodeSortingPolicyClassName() {
|
||||||
return this.multiNodeSortingPolicyName;
|
return this.multiNodeSortingPolicyClassName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMultiNodeSortingPolicyName(String policyName) {
|
public void setMultiNodeSortingPolicyClassName(String policyName) {
|
||||||
this.multiNodeSortingPolicyName = policyName;
|
this.multiNodeSortingPolicyClassName = policyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getMaximumApplicationLifetime() {
|
public long getMaximumApplicationLifetime() {
|
||||||
|
@ -529,7 +529,7 @@ public void validateSubmitApplication(ApplicationId applicationId,
|
|||||||
* Get Multi Node scheduling policy name.
|
* Get Multi Node scheduling policy name.
|
||||||
* @return policy name
|
* @return policy name
|
||||||
*/
|
*/
|
||||||
String getMultiNodeSortingPolicyName();
|
String getMultiNodeSortingPolicyClassName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the maximum lifetime in seconds of an application which is submitted to
|
* Get the maximum lifetime in seconds of an application which is submitted to
|
||||||
|
@ -187,17 +187,17 @@ private void updateMultiNodeSortingPolicy(RMApp rmApp) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String queueName = null;
|
String policyClassName = null;
|
||||||
if (scheduler instanceof CapacityScheduler) {
|
if (scheduler instanceof CapacityScheduler) {
|
||||||
queueName = getCSLeafQueue().getMultiNodeSortingPolicyName();
|
policyClassName = getCSLeafQueue().getMultiNodeSortingPolicyClassName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!appSchedulingInfo.getApplicationSchedulingEnvs().containsKey(
|
if (!appSchedulingInfo.getApplicationSchedulingEnvs().containsKey(
|
||||||
ApplicationSchedulingConfig.ENV_MULTI_NODE_SORTING_POLICY_CLASS)
|
ApplicationSchedulingConfig.ENV_MULTI_NODE_SORTING_POLICY_CLASS)
|
||||||
&& queueName != null) {
|
&& policyClassName != null) {
|
||||||
appSchedulingInfo.getApplicationSchedulingEnvs().put(
|
appSchedulingInfo.getApplicationSchedulingEnvs().put(
|
||||||
ApplicationSchedulingConfig.ENV_MULTI_NODE_SORTING_POLICY_CLASS,
|
ApplicationSchedulingConfig.ENV_MULTI_NODE_SORTING_POLICY_CLASS,
|
||||||
queueName);
|
policyClassName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,12 +22,12 @@
|
|||||||
*/
|
*/
|
||||||
public class MultiNodePolicySpec {
|
public class MultiNodePolicySpec {
|
||||||
|
|
||||||
private String policyName;
|
private String policyClassName;
|
||||||
private long sortingInterval;
|
private long sortingInterval;
|
||||||
|
|
||||||
public MultiNodePolicySpec(String policyName, long timeout) {
|
public MultiNodePolicySpec(String policyClassName, long timeout) {
|
||||||
this.setSortingInterval(timeout);
|
this.setSortingInterval(timeout);
|
||||||
this.setPolicyName(policyName);
|
this.setPolicyClassName(policyClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getSortingInterval() {
|
public long getSortingInterval() {
|
||||||
@ -38,18 +38,18 @@ public void setSortingInterval(long timeout) {
|
|||||||
this.sortingInterval = timeout;
|
this.sortingInterval = timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPolicyName() {
|
public String getPolicyClassName() {
|
||||||
return policyName;
|
return policyClassName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPolicyName(String policyName) {
|
public void setPolicyClassName(String policyClassName) {
|
||||||
this.policyName = policyName;
|
this.policyClassName = policyClassName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MultiNodePolicySpec {" +
|
return "MultiNodePolicySpec {" +
|
||||||
"policyName='" + policyName + '\'' +
|
"policyClassName='" + policyClassName + '\'' +
|
||||||
", sortingInterval=" + sortingInterval +
|
", sortingInterval=" + sortingInterval +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
@ -74,9 +74,9 @@ public synchronized MultiNodeLookupPolicy<N> getMultiNodeLookupPolicy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void serviceInit(Configuration conf) throws Exception {
|
public void serviceInit(Configuration conf) throws Exception {
|
||||||
LOG.info("Initializing MultiNodeSorter=" + policySpec.getPolicyName()
|
LOG.info("Initializing MultiNodeSorter=" + policySpec.getPolicyClassName()
|
||||||
+ ", with sorting interval=" + policySpec.getSortingInterval());
|
+ ", with sorting interval=" + policySpec.getSortingInterval());
|
||||||
initPolicy(policySpec.getPolicyName());
|
initPolicy(policySpec.getPolicyClassName());
|
||||||
super.serviceInit(conf);
|
super.serviceInit(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ private void createAllPolicies() {
|
|||||||
MultiNodeSorter<N> mon = new MultiNodeSorter<N>(rmContext, policy);
|
MultiNodeSorter<N> mon = new MultiNodeSorter<N>(rmContext, policy);
|
||||||
mon.init(conf);
|
mon.init(conf);
|
||||||
mon.start();
|
mon.start();
|
||||||
runningMultiNodeSorters.put(policy.getPolicyName(), mon);
|
runningMultiNodeSorters.put(policy.getPolicyClassName(), mon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user