falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shweth...@apache.org
Subject [1/2] git commit: FALCON-28 unable to submit/delete feed or process which had been attempted submit with wrong cluster. Contributed by Shwetha GS
Date Thu, 20 Mar 2014 09:45:50 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master 1b60ebd1d -> 8f7c0dce3


FALCON-28 unable to submit/delete feed or process which had been attempted submit with wrong
cluster. Contributed by Shwetha GS


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

Branch: refs/heads/master
Commit: 0310e95f141169cef2be8637bb4a59b0a17862d9
Parents: 1b60ebd
Author: Shwetha GS <shwethags@gmail.com>
Authored: Thu Mar 20 14:50:45 2014 +0530
Committer: Shwetha GS <shwethags@gmail.com>
Committed: Thu Mar 20 14:50:45 2014 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  3 +++
 .../proxy/SchedulableEntityManagerProxy.java    | 22 ++++++++++++--------
 .../java/org/apache/falcon/cli/FalconCLIIT.java |  8 +++----
 3 files changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/0310e95f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 419d5cd..91f74da 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -82,6 +82,9 @@ Trunk (Unreleased)
     FALCON-123 Improve build speeds in falcon. (Srikanth Sundarrajan via Shwetha GS)
 
   BUG FIXES
+    FALCON-28 unable to submit/delete feed or process which had been attempted submit 
+    with wrong cluster. (Shwetha GS)
+
     FALCON-269 Mistake in the embedded ActiveMQ port property. (Jean-Baptiste Onofré
     via Shwetha GS)
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/0310e95f/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
index 0200159..6b07877 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
@@ -51,6 +51,7 @@ import java.util.Set;
 @Path("entities")
 public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityManager {
     private static final String PRISM_TAG = "prism";
+    public static final String FALCON_TAG = "falcon";
 
     private final Map<String, Channel> entityManagerChannels = new HashMap<String,
Channel>();
     private final Map<String, Channel> configSyncChannels = new HashMap<String,
Channel>();
@@ -108,17 +109,20 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana
             @Dimension("colo") @QueryParam("colo") final String ignore) {
 
         final HttpServletRequest bufferedRequest = getBufferedRequest(request);
-        if (!embeddedMode) {
-            super.submit(bufferedRequest, type, currentColo);
-        }
 
         final String entity = getEntity(bufferedRequest, type).getName();
-        return new EntityProxy(type, entity) {
+        Map<String, APIResult> results = new HashMap<String, APIResult>();
+        results.put(FALCON_TAG, new EntityProxy(type, entity) {
             @Override
             protected APIResult doExecute(String colo) throws FalconException {
                 return getConfigSyncChannel(colo).invoke("submit", bufferedRequest, type,
colo);
             }
-        }.execute();
+        }.execute());
+
+        if (!embeddedMode) {
+            results.put(PRISM_TAG, super.submit(bufferedRequest, type, currentColo));
+        }
+        return consolidateResult(results);
     }
 
     private Entity getEntity(HttpServletRequest request, String type) {
@@ -154,7 +158,7 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana
         final HttpServletRequest bufferedRequest = new BufferedRequest(request);
         Map<String, APIResult> results = new HashMap<String, APIResult>();
 
-        results.put("falcon", new EntityProxy(type, entity) {
+        results.put(FALCON_TAG, new EntityProxy(type, entity) {
             @Override
             public APIResult execute() {
                 try {
@@ -201,7 +205,7 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana
 
         Map<String, APIResult> results = new HashMap<String, APIResult>();
         if (!oldColos.isEmpty()) {
-            results.put("delete", new EntityProxy(type, entityName) {
+            results.put(FALCON_TAG + "/delete", new EntityProxy(type, entityName) {
                 @Override
                 protected Set<String> getColosToApply() {
                     return oldColos;
@@ -215,7 +219,7 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana
         }
 
         if (!mergedColos.isEmpty()) {
-            results.put("update", new EntityProxy(type, entityName) {
+            results.put(FALCON_TAG + "/update", new EntityProxy(type, entityName) {
                 @Override
                 protected Set<String> getColosToApply() {
                     return mergedColos;
@@ -230,7 +234,7 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana
         }
 
         if (!newColos.isEmpty()) {
-            results.put("submit", new EntityProxy(type, entityName) {
+            results.put(FALCON_TAG + "/submit", new EntityProxy(type, entityName) {
                 @Override
                 protected Set<String> getColosToApply() {
                     return newColos;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/0310e95f/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
index 5cd7beb..83983a4 100644
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
@@ -60,14 +60,14 @@ public class FalconCLIIT {
                 executeWithURL("entity -submit -type cluster -file " + filePath));
         context.setCluster(overlay.get("cluster"));
         Assert.assertEquals(stream.buffer.toString().trim(),
-                "default/Submit successful (cluster) " + context.getClusterName());
+                "falcon/default/Submit successful (cluster) " + context.getClusterName());
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1,
overlay);
         Assert.assertEquals(0,
                 executeWithURL("entity -submit -type feed -file " + filePath));
         Assert.assertEquals(
                 stream.buffer.toString().trim(),
-                "default/Submit successful (feed) "
+                "falcon/default/Submit successful (feed) "
                         + overlay.get("inputFeedName"));
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2,
overlay);
@@ -75,7 +75,7 @@ public class FalconCLIIT {
                 executeWithURL("entity -submit -type feed -file " + filePath));
         Assert.assertEquals(
                 stream.buffer.toString().trim(),
-                "default/Submit successful (feed) "
+                "falcon/default/Submit successful (feed) "
                         + overlay.get("outputFeedName"));
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE,
overlay);
@@ -84,7 +84,7 @@ public class FalconCLIIT {
                 executeWithURL("entity -submit -type process -file " + filePath));
         Assert.assertEquals(
                 stream.buffer.toString().trim(),
-                "default/Submit successful (process) "
+                "falcon/default/Submit successful (process) "
                         + overlay.get("processName"));
     }
 


Mime
View raw message