goiri commented on a change in pull request #3741:
URL: https://github.com/apache/hadoop/pull/3741#discussion_r763268000
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AppSchedulingInfo.java
##########
@@ -129,8 +132,32 @@ public AppSchedulingInfo(ApplicationAttemptId
appAttemptId, String user,
updateContext = new ContainerUpdateContext(this);
readLock = lock.readLock();
writeLock = lock.writeLock();
+
+ this.defaultResourceRequestAppPlacementType =
+ getDefaultResourceRequestAppPlacementType();
Review comment:
Configuration has this getClass() method, should we use this?
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AppSchedulingInfo.java
##########
@@ -129,8 +132,32 @@ public AppSchedulingInfo(ApplicationAttemptId
appAttemptId, String user,
updateContext = new ContainerUpdateContext(this);
readLock = lock.readLock();
writeLock = lock.writeLock();
+
+ this.defaultResourceRequestAppPlacementType =
+ getDefaultResourceRequestAppPlacementType();
+ }
+
+ /**
+ * Set default App Placement Allocator.
+ */
+ public String getDefaultResourceRequestAppPlacementType() {
+ if (this.rmContext != null
+ && this.rmContext.getYarnConfiguration() != null) {
+
+ String appPlacementClass = applicationSchedulingEnvs.get(
+ ApplicationSchedulingConfig.ENV_APPLICATION_PLACEMENT_TYPE_CLASS);
+ if (null != appPlacementClass) {
+ return appPlacementClass;
+ } else {
+ Configuration conf = rmContext.getYarnConfiguration();
+ return conf.get(
+ YarnConfiguration.APPLICATION_PLACEMENT_TYPE_CLASS);
+ }
+ }
+ return null;
}
+
Review comment:
Avoid
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AppSchedulingInfo.java
##########
@@ -129,8 +132,32 @@ public AppSchedulingInfo(ApplicationAttemptId
appAttemptId, String user,
updateContext = new ContainerUpdateContext(this);
readLock = lock.readLock();
writeLock = lock.writeLock();
+
+ this.defaultResourceRequestAppPlacementType =
+ getDefaultResourceRequestAppPlacementType();
+ }
+
+ /**
+ * Set default App Placement Allocator.
+ */
Review comment:
Yetus now complains about javadocs, let's fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]