hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject [01/50] [abbrv] hadoop git commit: YARN-3181. FairScheduler: Fix up outdated findbugs issues. (kasha)
Date Mon, 16 Feb 2015 18:31:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7285 e74644311 -> 49204fcf1


YARN-3181. FairScheduler: Fix up outdated findbugs issues. (kasha)


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

Branch: refs/heads/HDFS-7285
Commit: cd4e599297d0b116311f8241d59492d29d1de0c9
Parents: 52eb87b
Author: Karthik Kambatla <kasha@apache.org>
Authored: Thu Feb 12 13:44:47 2015 -0800
Committer: Zhe Zhang <zhz@apache.org>
Committed: Mon Feb 16 10:29:46 2015 -0800

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                 |  2 ++
 .../dev-support/findbugs-exclude.xml            | 27 --------------------
 .../scheduler/fair/AllocationConfiguration.java | 13 +++++++---
 .../fair/AllocationFileLoaderService.java       |  2 +-
 .../scheduler/fair/FSOpDurations.java           |  3 +++
 5 files changed, 16 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/cd4e5992/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index d1b684e..1ff1fcb 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -277,6 +277,8 @@ Release 2.7.0 - UNRELEASED
     YARN-2079. Recover NonAggregatingLogHandler state upon nodemanager
     restart. (Jason Lowe via junping_du) 
 
+    YARN-3181. FairScheduler: Fix up outdated findbugs issues. (kasha)
+
   OPTIMIZATIONS
 
     YARN-2990. FairScheduler's delay-scheduling always waits for node-local and 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/cd4e5992/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml b/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml
index e0bbd7b..09a9d2e 100644
--- a/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml
+++ b/hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml
@@ -142,22 +142,12 @@
     <Class name="org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.LogAggregationService"
/>
     <Bug pattern="IS2_INCONSISTENT_SYNC" />
   </Match>
-  <Match>
-    <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationFileLoaderService"
/>
-    <Field name="allocFile" />
-    <Bug pattern="IS2_INCONSISTENT_SYNC" />
-  </Match>
   <!-- Inconsistent sync warning - minimumAllocation is only initialized once and never
changed -->
   <Match>
     <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler"
/>
     <Field name="minimumAllocation" />
     <Bug pattern="IS2_INCONSISTENT_SYNC" />
   </Match>
-  <Match>
-    <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSSchedulerNode"
/>
-    <Method name="reserveResource" />
-    <Bug pattern="BC_UNCONFIRMED_CAST" /> 
-  </Match>
   <!-- Inconsistent sync warning - reinitialize read from other queue does not need sync-->
   <Match>
     <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue"
/>
@@ -213,18 +203,6 @@
     <Field name="scheduleAsynchronously" />
     <Bug pattern="IS2_INCONSISTENT_SYNC" />
   </Match>
-  <!-- Inconsistent sync warning - updateInterval is only initialized once and never changed
-->
-  <Match>
-    <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler"
/>
-    <Field name="updateInterval" />
-    <Bug pattern="IS2_INCONSISTENT_SYNC" />
-  </Match>
-  <!-- Inconsistent sync warning - callDurationMetrics is only initialized once and never
changed -->
-  <Match>
-    <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler"
/>
-    <Field name="fsOpDurations" />
-    <Bug pattern="IS2_INCONSISTENT_SYNC" />
-  </Match>
 
   <!-- Inconsistent sync warning - numRetries is only initialized once and never changed
-->
   <Match>
@@ -425,11 +403,6 @@
     <Bug pattern="IS2_INCONSISTENT_SYNC" />
   </Match>
   <Match>
-    <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler"
/>
-    <Field name="allocConf" />
-    <Bug pattern="IS2_INCONSISTENT_SYNC" />
-  </Match>
-  <Match>
     <Class name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNode"
/>
     <Field name="numContainers" />
     <Bug pattern="VO_VOLATILE_INCREMENT" />

http://git-wip-us.apache.org/repos/asf/hadoop/blob/cd4e5992/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationConfiguration.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/scheduler/fair/AllocationConfiguration.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationConfiguration.java
index 0ea7314..9cb767d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationConfiguration.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationConfiguration.java
@@ -33,6 +33,9 @@ import org.apache.hadoop.yarn.util.resource.Resources;
 
 import com.google.common.annotations.VisibleForTesting;
 
+import javax.annotation.concurrent.ThreadSafe;
+
+@ThreadSafe
 public class AllocationConfiguration extends ReservationSchedulerConfiguration {
   private static final AccessControlList EVERYBODY_ACL = new AccessControlList("*");
   private static final AccessControlList NOBODY_ACL = new AccessControlList(" ");
@@ -204,12 +207,16 @@ public class AllocationConfiguration extends ReservationSchedulerConfiguration
{
   }
 
   public ResourceWeights getQueueWeight(String queue) {
-    ResourceWeights weight = queueWeights.get(queue);
-    return (weight == null) ? ResourceWeights.NEUTRAL : weight;
+    synchronized (queueWeights) {
+      ResourceWeights weight = queueWeights.get(queue);
+      return (weight == null) ? ResourceWeights.NEUTRAL : weight;
+    }
   }
 
   public void setQueueWeight(String queue, ResourceWeights weight) {
-    queueWeights.put(queue, weight);
+    synchronized (queueWeights) {
+      queueWeights.put(queue, weight);
+    }
   }
   
   public int getUserMaxApps(String user) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/cd4e5992/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationFileLoaderService.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/scheduler/fair/AllocationFileLoaderService.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationFileLoaderService.java
index 76fa588..c19aa51 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationFileLoaderService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/AllocationFileLoaderService.java
@@ -201,7 +201,7 @@ public class AllocationFileLoaderService extends AbstractService {
    * @throws ParserConfigurationException if XML parser is misconfigured.
    * @throws SAXException if config file is malformed.
    */
-  public synchronized void reloadAllocations() throws IOException,
+  public void reloadAllocations() throws IOException,
       ParserConfigurationException, SAXException, AllocationConfigurationException {
     if (allocFile == null) {
       return;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/cd4e5992/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSOpDurations.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/scheduler/fair/FSOpDurations.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSOpDurations.java
index c2282fd..c50f281 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSOpDurations.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSOpDurations.java
@@ -31,6 +31,8 @@ import org.apache.hadoop.metrics2.lib.MetricsRegistry;
 import static org.apache.hadoop.metrics2.lib.Interns.info;
 import org.apache.hadoop.metrics2.lib.MutableRate;
 
+import javax.annotation.concurrent.ThreadSafe;
+
 /**
  * Class to capture the performance metrics of FairScheduler.
  * This should be a singleton.
@@ -38,6 +40,7 @@ import org.apache.hadoop.metrics2.lib.MutableRate;
 @InterfaceAudience.Private
 @InterfaceStability.Unstable
 @Metrics(context="fairscheduler-op-durations")
+@ThreadSafe
 public class FSOpDurations implements MetricsSource {
 
   @Metric("Duration for a continuous scheduling run")


Mime
View raw message