falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: FALCON-2272 Check if extension is enabled during an update of an extension job
Date Wed, 01 Feb 2017 09:34:17 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 29cbcd79b -> 3c4957f6e


FALCON-2272 Check if extension is enabled during an update of an extension job

Author: sandeep <sandysmdl@gmail.com>

Reviewers: @PracheerAgarwal, @pallavi-rao

Closes #351 from sandeepSamudrala/FALCON-2272 and squashes the following commits:

882854b [sandeep] FALCON-2272 Added comment
f95848b [sandeep] FALCON-2272 Formatted error message
417269a [sandeep] FALCON-2272 Check if extension is enabled during an update of an extension
job
cb2b00d [sandeep] Merge branch 'master' of https://github.com/apache/falcon
79e8d64 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
7de7798 [sandeep] go -b FALCON-2263Merge branch 'master' of https://github.com/apache/falcon
c5da0a2 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
7e16263 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
a234d94 [sandeep] FALCON-2231 Incoporated review comments and small fixes for duplicate submission
and colo addition to schedule command
26e3350 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
73fbf75 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
cc28658 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
089b10d [sandeep] Merge branch 'master' of https://github.com/apache/falcon
456d4ee [sandeep] Merge branch 'master' of https://github.com/apache/falcon
0cf9af6 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
4a2e23e [sandeep] Merge branch 'master' of https://github.com/apache/falcon
b1546ed [sandeep] Merge branch 'master' of https://github.com/apache/falcon
0a433fb [sandeep] Merge branch 'master' of https://github.com/apache/falcon
194f36a [sandeep] Merge branch 'master' of https://github.com/apache/falcon
e0ad358 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
f96a084 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
9cf36e9 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
bbca081 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
48f6afa [sandeep] Merge branch 'master' of https://github.com/apache/falcon
250cc46 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
d0393e9 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
a178805 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
d6dc8bf [sandeep] Merge branch 'master' of https://github.com/apache/falcon
1bb8d3c [sandeep] Merge branch 'master' of https://github.com/apache/falcon
c065566 [sandeep] reverting last line changes made
1a4dcd2 [sandeep] rebased and resolved the conflicts from master
271318b [sandeep] FALCON-2097. Adding UT to the new method for getting next instance time
with Delay.
a94d4fe [sandeep] rebasing from master
9e68a57 [sandeep] FALCON-298. Feed update with replication delay creates holes


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

Branch: refs/heads/master
Commit: 3c4957f6e5bc758f33dce20a8a7396f16a1bd2c0
Parents: 29cbcd7
Author: sandeep <sandysmdl@gmail.com>
Authored: Wed Feb 1 15:04:10 2017 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Wed Feb 1 15:04:10 2017 +0530

----------------------------------------------------------------------
 .../falcon/resource/proxy/ExtensionManagerProxy.java     |  1 +
 .../java/org/apache/falcon/unit/FalconUnitClient.java    |  2 +-
 .../org/apache/falcon/unit/LocalExtensionManager.java    |  2 ++
 .../test/java/org/apache/falcon/unit/TestFalconUnit.java | 11 +++++++++++
 4 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/3c4957f6/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
b/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
index b6f405e..684ff89 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/ExtensionManagerProxy.java
@@ -564,6 +564,7 @@ public class ExtensionManagerProxy extends AbstractExtensionManager {
 
         SortedMap<EntityType, List<Entity>> entityMap;
         String extensionName = getExtensionName(jobName);
+        checkIfExtensionIsEnabled(extensionName);
         try {
             entityMap = getEntityList(extensionName, jobName, feedForms, processForms, config);
             if (entityMap.get(EntityType.FEED).isEmpty() && entityMap.get(EntityType.PROCESS).isEmpty())
{

http://git-wip-us.apache.org/repos/asf/falcon/blob/3c4957f6/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java
----------------------------------------------------------------------
diff --git a/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java b/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java
index 3150bbd..6148979 100644
--- a/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java
+++ b/unit/src/main/java/org/apache/falcon/unit/FalconUnitClient.java
@@ -333,7 +333,7 @@ public class FalconUnitClient extends AbstractFalconClient {
             entities = ExtensionHandler.loadAndPrepare(extensionName, jobName, configStream,
                     packagePath);
         } catch (FalconException | IOException | URISyntaxException e) {
-            throw new FalconCLIException("Failed in generating entities" + jobName);
+            throw new FalconCLIException("Failed in generating entities for job:" + jobName);
         }
         return entities;
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/3c4957f6/unit/src/main/java/org/apache/falcon/unit/LocalExtensionManager.java
----------------------------------------------------------------------
diff --git a/unit/src/main/java/org/apache/falcon/unit/LocalExtensionManager.java b/unit/src/main/java/org/apache/falcon/unit/LocalExtensionManager.java
index addb333..8936225 100644
--- a/unit/src/main/java/org/apache/falcon/unit/LocalExtensionManager.java
+++ b/unit/src/main/java/org/apache/falcon/unit/LocalExtensionManager.java
@@ -130,6 +130,8 @@ public class LocalExtensionManager extends AbstractExtensionManager {
                                  SortedMap<EntityType, List<Entity>> entityMap)
throws FalconException, IOException {
         List<String> feedNames = new ArrayList<>();
         List<String> processNames = new ArrayList<>();
+        checkIfExtensionIsEnabled(extensionName);
+        checkIfExtensionJobNameExists(jobName, extensionName);
         for (Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet())
{
             for (Entity entity : entry.getValue()) {
                 update(entity, entity.getEntityType().toString(), entity.getName(), true);

http://git-wip-us.apache.org/repos/asf/falcon/blob/3c4957f6/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java
----------------------------------------------------------------------
diff --git a/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java b/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java
index 8030f20..a45d083 100644
--- a/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java
+++ b/unit/src/test/java/org/apache/falcon/unit/TestFalconUnit.java
@@ -483,6 +483,17 @@ public class TestFalconUnit extends FalconUnitTestBase {
         assertStatus(apiResult);
         Assert.assertEquals(apiResult.getMessage(), "RUNNING");
 
+        // update will fail in case of an extension being disabled
+        disableExtension(TEST_EXTENSION);
+        try {
+            updateExtensionJob(TEST_JOB, getAbsolutePath(EXTENSION_PROPERTIES), null);
+            Assert.fail("Should have thrown a FalconWebException");
+        } catch (FalconWebException e) {
+            Assert.assertEquals(((APIResult) e.getResponse().getEntity()).getMessage(), "Extension:
"
+                    + TEST_EXTENSION + " is in disabled state.");
+        }
+        enableExtension(TEST_EXTENSION);
+
         apiResult = updateExtensionJob(TEST_JOB, getAbsolutePath(EXTENSION_PROPERTIES), null);
         assertStatus(apiResult);
 


Mime
View raw message