hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xg...@apache.org
Subject git commit: YARN-2813. Fixed NPE from MemoryTimelineStore.getDomains. Contributed by Zhijie Shen
Date Thu, 06 Nov 2014 02:28:17 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.6 e29e864c5 -> 888fc4af4


YARN-2813. Fixed NPE from MemoryTimelineStore.getDomains. Contributed by Zhijie Shen


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

Branch: refs/heads/branch-2.6
Commit: 888fc4af4e25f6005ae30070a79690a3ab50dbcc
Parents: e29e864
Author: Xuan <xgong@apache.org>
Authored: Wed Nov 5 18:27:41 2014 -0800
Committer: Xuan <xgong@apache.org>
Committed: Wed Nov 5 18:27:41 2014 -0800

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                                  | 2 ++
 .../apache/hadoop/yarn/server/timeline/MemoryTimelineStore.java  | 4 ++++
 .../hadoop/yarn/server/timeline/TimelineStoreTestUtils.java      | 4 ++++
 3 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/888fc4af/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index cc9578c..99e3d9d 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -800,6 +800,8 @@ Release 2.6.0 - UNRELEASED
     FatalEventDispatcher try to transition RM to StandBy at the same time.
     (Rohith Sharmaks via jianhe)
 
+    YARN-2813. Fixed NPE from MemoryTimelineStore.getDomains. (Zhijie Shen via xgong)
+
 Release 2.5.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/888fc4af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/MemoryTimelineStore.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/MemoryTimelineStore.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/MemoryTimelineStore.java
index 2d126b4..af714b1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/MemoryTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/MemoryTimelineStore.java
@@ -241,6 +241,10 @@ public class MemoryTimelineStore
   public TimelineDomains getDomains(String owner)
       throws IOException {
     List<TimelineDomain> domains = new ArrayList<TimelineDomain>();
+    Set<TimelineDomain> domainsOfOneOwner = domainsByOwner.get(owner);
+    if (domainsOfOneOwner == null) {
+      return new TimelineDomains();
+    }
     for (TimelineDomain domain : domainsByOwner.get(owner)) {
       TimelineDomain domainToReturn = createTimelineDomain(
           domain.getId(),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/888fc4af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TimelineStoreTestUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TimelineStoreTestUtils.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TimelineStoreTestUtils.java
index 868838e..242478c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TimelineStoreTestUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/TimelineStoreTestUtils.java
@@ -946,6 +946,10 @@ public class TimelineStoreTestUtils {
     assertEquals(2, actualDomains.getDomains().size());
     verifyDomainInfo(domain3, actualDomains.getDomains().get(0));
     verifyDomainInfo(domain1, actualDomains.getDomains().get(1));
+
+    // owner without any domain
+    actualDomains = store.getDomains("owner_4");
+    assertEquals(0, actualDomains.getDomains().size());
   }
 
   private static void verifyDomainInfo(


Mime
View raw message