YARN-6778. In ResourceWeights, weights and setWeights() should be final. 
(Daniel Templeton via Yufei Gu)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/daaf530f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/daaf530f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/daaf530f

Branch: refs/heads/HDFS-7240
Commit: daaf530fce4b91cf9f568b9b0c5e8b20e6774134
Parents: 5aa2bf2
Author: Yufei Gu <yu...@apache.org>
Authored: Tue Jul 18 16:38:07 2017 -0700
Committer: Yufei Gu <yu...@apache.org>
Committed: Tue Jul 18 16:38:07 2017 -0700

----------------------------------------------------------------------
 .../yarn/server/resourcemanager/resource/ResourceWeights.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/daaf530f/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceWeights.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceWeights.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceWeights.java
index 4c62318..3ce1517 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceWeights.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceWeights.java
@@ -27,7 +27,7 @@ import org.apache.hadoop.util.StringUtils;
 public class ResourceWeights {
   public static final ResourceWeights NEUTRAL = new ResourceWeights(1.0f);
 
-  private float[] weights = new float[ResourceType.values().length];
+  private final float[] weights = new float[ResourceType.values().length];
 
   public ResourceWeights(float memoryWeight, float cpuWeight) {
     weights[ResourceType.MEMORY.ordinal()] = memoryWeight;
@@ -40,7 +40,7 @@ public class ResourceWeights {
 
   public ResourceWeights() { }
 
-  public void setWeight(float weight) {
+  public final void setWeight(float weight) {
     for (int i = 0; i < weights.length; i++) {
       weights[i] = weight;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to