hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject [39/50] [abbrv] hadoop git commit: YARN-4151. Fix findbugs errors in hadoop-yarn-server-common module. (Meng Ding via wangda)
Date Tue, 15 Sep 2015 19:12:24 GMT
YARN-4151. Fix findbugs errors in hadoop-yarn-server-common module. (Meng Ding via wangda)


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

Branch: refs/heads/HADOOP-11890
Commit: e2a02702178db60150cc0c2253d48b8532a474c2
Parents: 53bad4e
Author: Wangda Tan <wangda@apache.org>
Authored: Mon Sep 14 16:00:35 2015 -0700
Committer: Wangda Tan <wangda@apache.org>
Committed: Mon Sep 14 16:00:43 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                             | 3 +++
 .../yarn/server/api/records/impl/pb/NodeStatusPBImpl.java   | 8 ++++----
 .../org/apache/hadoop/yarn/server/webapp/WebPageUtils.java  | 3 +--
 .../org/apache/hadoop/yarn/server/webapp/WebServices.java   | 9 +++++++++
 4 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e2a02702/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 7a9d156..766d4ef 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -826,6 +826,9 @@ Release 2.8.0 - UNRELEASED
     YARN-4115. Reduce loglevel of ContainerManagementProtocolProxy to Debug
     (adhoot via rkanter)
 
+    YARN-4151. Fix findbugs errors in hadoop-yarn-server-common module.
+    (Meng Ding via wangda)
+
 Release 2.7.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e2a02702/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeStatusPBImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeStatusPBImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeStatusPBImpl.java
index 2d139fe..7d4e83f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeStatusPBImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/records/impl/pb/NodeStatusPBImpl.java
@@ -293,7 +293,7 @@ public class NodeStatusPBImpl extends NodeStatus {
   }
 
   @Override
-  public ResourceUtilization getContainersUtilization() {
+  public synchronized ResourceUtilization getContainersUtilization() {
     NodeStatusProtoOrBuilder p =
         this.viaProto ? this.proto : this.builder;
     if (!p.hasContainersUtilization()) {
@@ -303,7 +303,7 @@ public class NodeStatusPBImpl extends NodeStatus {
   }
 
   @Override
-  public void setContainersUtilization(
+  public synchronized void setContainersUtilization(
       ResourceUtilization containersUtilization) {
     maybeInitBuilder();
     if (containersUtilization == null) {
@@ -315,7 +315,7 @@ public class NodeStatusPBImpl extends NodeStatus {
   }
 
   @Override
-  public ResourceUtilization getNodeUtilization() {
+  public synchronized ResourceUtilization getNodeUtilization() {
     NodeStatusProtoOrBuilder p =
         this.viaProto ? this.proto : this.builder;
     if (!p.hasNodeUtilization()) {
@@ -325,7 +325,7 @@ public class NodeStatusPBImpl extends NodeStatus {
   }
 
   @Override
-  public void setNodeUtilization(
+  public synchronized void setNodeUtilization(
       ResourceUtilization nodeUtilization) {
     maybeInitBuilder();
     if (nodeUtilization == null) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e2a02702/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java
index ffc5637..f32dd0c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebPageUtils.java
@@ -51,8 +51,7 @@ public class WebPageUtils {
     sb.append("[\n")
       .append("{'sType':'string', 'aTargets': [0]")
       .append(", 'mRender': parseHadoopID }")
-      .append("\n, {'sType':'numeric', 'aTargets': " +
-          (isFairSchedulerPage ? "[6, 7]": "[6, 7]"))
+      .append("\n, {'sType':'numeric', 'aTargets': [6, 7]")
       .append(", 'mRender': renderHadoopDate }")
       .append("\n, {'sType':'numeric', bSearchable:false, 'aTargets':");
     if (isFairSchedulerPage) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e2a02702/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
index 8c28263..40e40c9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
@@ -167,6 +167,9 @@ public class WebServices {
     } catch (Exception e) {
       rewrapAndThrowException(e);
     }
+    if (appReports == null) {
+      return allApps;
+    }
     for (ApplicationReport appReport : appReports) {
 
       if (checkAppStates &&
@@ -266,6 +269,9 @@ public class WebServices {
       rewrapAndThrowException(e);
     }
     AppAttemptsInfo appAttemptsInfo = new AppAttemptsInfo();
+    if (appAttemptReports == null) {
+      return appAttemptsInfo;
+    }
     for (ApplicationAttemptReport appAttemptReport : appAttemptReports) {
       AppAttemptInfo appAttemptInfo = new AppAttemptInfo(appAttemptReport);
       appAttemptsInfo.add(appAttemptInfo);
@@ -336,6 +342,9 @@ public class WebServices {
       rewrapAndThrowException(e);
     }
     ContainersInfo containersInfo = new ContainersInfo();
+    if (containerReports == null) {
+      return containersInfo;
+    }
     for (ContainerReport containerReport : containerReports) {
       ContainerInfo containerInfo = new ContainerInfo(containerReport);
       containersInfo.add(containerInfo);


Mime
View raw message