falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject [3/3] falcon git commit: FALCON-1327 When using triage on a server for a process which does not exist on that server, a NullPointerException is encountered. Contributed by Ajay Yadava.
Date Wed, 29 Jul 2015 11:04:15 GMT
FALCON-1327 When using triage on a server for a process which does not exist on that server,
a NullPointerException is encountered. Contributed by Ajay Yadava.


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

Branch: refs/heads/master
Commit: 1416f5e704251b4174f1549e6f0546212ab0a842
Parents: 27c9a1f
Author: Ajay Yadava <ajaynsit@gmail.com>
Authored: Wed Jul 29 16:18:55 2015 +0530
Committer: Ajay Yadava <ajaynsit@gmail.com>
Committed: Wed Jul 29 16:18:55 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  3 ++
 .../resource/AbstractInstanceManager.java       |  2 +-
 .../falcon/resource/InstanceManagerTest.java    | 33 ++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/1416f5e7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f1ee843..2fbafe7 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -67,6 +67,9 @@ Trunk (Unreleased)
     (Suhas Vasu)
 
   BUG FIXES
+    FALCON-1327 When using triage on a server for a process which does not exist on that
server,
+    a NullPointerException is encountered(Ajay Yadava)
+
     FALCON-1325 Triage API on prism, for an instance at which a process does not exist sends
incorrect message(Ajay Yadava)
 
     FALCON-1328 Error in Triage documentation(Karishma Gulati via Ajay Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/1416f5e7/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java b/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
index adbad0e..248ee7b 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
@@ -644,7 +644,7 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager
{
         checkName(entityName);
         try {
             EntityType type = EntityType.valueOf(entityType.toUpperCase());
-            Entity entity = ConfigurationStore.get().get(type, entityName);
+            Entity entity = EntityUtil.getEntity(type, entityName);
             TriageResult result = new TriageResult(APIResult.Status.SUCCEEDED, "Success");
             List<LineageGraphResult> triageGraphs = new LinkedList<>();
             for (String clusterName : DeploymentUtil.getCurrentClusters()) {

http://git-wip-us.apache.org/repos/asf/falcon/blob/1416f5e7/prism/src/test/java/org/apache/falcon/resource/InstanceManagerTest.java
----------------------------------------------------------------------
diff --git a/prism/src/test/java/org/apache/falcon/resource/InstanceManagerTest.java b/prism/src/test/java/org/apache/falcon/resource/InstanceManagerTest.java
new file mode 100644
index 0000000..29762ab
--- /dev/null
+++ b/prism/src/test/java/org/apache/falcon/resource/InstanceManagerTest.java
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.falcon.resource;
+
+import org.apache.falcon.FalconWebException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ */
+public class InstanceManagerTest extends AbstractInstanceManager {
+
+    @Test(expectedExceptions = FalconWebException.class)
+    public void test() {
+        super.triageInstance("process", "random", "2014-05-07T00:00Z", "default");
+    }
+}


Mime
View raw message