hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1562217 - in /hadoop/common/branches/branch-2/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ hadoop-yarn/hadoop-yar...
Date Tue, 28 Jan 2014 20:17:27 GMT
Author: vinodkv
Date: Tue Jan 28 20:17:27 2014
New Revision: 1562217

URL: http://svn.apache.org/r1562217
Log:
YARN-1597. Fixed Findbugs warnings on branch YARN-321. Contributed by Vinod Kumar Vavilapalli.
svn merge --ignore-ancestry -c 1557958 ../YARN-321

Modified:
    hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/RMApplicationHistoryWriter.java

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt?rev=1562217&r1=1562216&r2=1562217&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt Tue Jan 28 20:17:27 2014
@@ -81,6 +81,9 @@ Branch YARN-321: Generic ApplicationHist
   YARN-1596. Fixed Javadoc warnings on branch YARN-321. (Vinod Kumar Vavilapalli
   via zjshen)
 
+  YARN-1597. Fixed Findbugs warnings on branch YARN-321. (Vinod Kumar Vavilapalli
+  via zjshen)
+
 Release 2.4.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java?rev=1562217&r1=1562216&r2=1562217&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
Tue Jan 28 20:17:27 2014
@@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.server.ap
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -94,9 +95,10 @@ public class ApplicationHistoryManagerIm
     Map<ApplicationId, ApplicationHistoryData> histData = historyStore
         .getAllApplications();
     HashMap<ApplicationId, ApplicationReport> applicationsReport = new HashMap<ApplicationId,
ApplicationReport>();
-    for (ApplicationId appId : histData.keySet()) {
-      applicationsReport.put(appId, convertToApplicationReport(histData
-          .get(appId)));
+    for (Entry<ApplicationId, ApplicationHistoryData> entry : histData
+      .entrySet()) {
+      applicationsReport.put(entry.getKey(),
+        convertToApplicationReport(entry.getValue()));
     }
     return applicationsReport;
   }
@@ -171,9 +173,10 @@ public class ApplicationHistoryManagerIm
     Map<ApplicationAttemptId, ApplicationAttemptHistoryData> histData = historyStore
         .getApplicationAttempts(appId);
     HashMap<ApplicationAttemptId, ApplicationAttemptReport> applicationAttemptsReport
= new HashMap<ApplicationAttemptId, ApplicationAttemptReport>();
-    for (ApplicationAttemptId appAttemptId : histData.keySet()) {
-      applicationAttemptsReport.put(appAttemptId,
-          convertToApplicationAttemptReport(histData.get(appAttemptId)));
+    for (Entry<ApplicationAttemptId, ApplicationAttemptHistoryData> entry : histData
+      .entrySet()) {
+      applicationAttemptsReport.put(entry.getKey(),
+        convertToApplicationAttemptReport(entry.getValue()));
     }
     return applicationAttemptsReport;
   }
@@ -201,9 +204,9 @@ public class ApplicationHistoryManagerIm
     Map<ContainerId, ContainerHistoryData> histData = historyStore
         .getContainers(appAttemptId);
     HashMap<ContainerId, ContainerReport> containersReport = new HashMap<ContainerId,
ContainerReport>();
-    for (ContainerId container : histData.keySet()) {
-      containersReport.put(container, convertToContainerReport(histData
-          .get(container)));
+    for (Entry<ContainerId, ContainerHistoryData> entry : histData.entrySet()) {
+      containersReport.put(entry.getKey(),
+        convertToContainerReport(entry.getValue()));
     }
     return containersReport;
   }

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java?rev=1562217&r1=1562216&r2=1562217&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java
Tue Jan 28 20:17:27 2014
@@ -739,7 +739,6 @@ public class FileSystemApplicationHistor
       }
     }
 
-    private FSDataInputStream fsdis;
     private TFile.Reader reader;
     private TFile.Reader.Scanner scanner;
 
@@ -773,7 +772,7 @@ public class FileSystemApplicationHistor
     }
 
     public void close() {
-      IOUtils.cleanup(LOG, scanner, reader, fsdis);
+      IOUtils.cleanup(LOG, scanner, reader);
     }
 
   }

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/RMApplicationHistoryWriter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/RMApplicationHistoryWriter.java?rev=1562217&r1=1562216&r2=1562217&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/RMApplicationHistoryWriter.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ahs/RMApplicationHistoryWriter.java
Tue Jan 28 20:17:27 2014
@@ -319,7 +319,7 @@ public class RMApplicationHistoryWriter 
         // dispatcher, such that all the writing events of one application will
         // be handled by one thread, the scheduled order of the these events
         // will be preserved
-        int index = Math.abs(event.hashCode()) % dispatchers.size();
+        int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size();
         dispatchers.get(index).getEventHandler().handle(event);
       }
 



Mime
View raw message