falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject [3/4] falcon git commit: FALCON-1715 IllegalStateException in MetadataMappingService when entity is scheduled via native scheduler (by Pallavi Rao)
Date Mon, 18 Jan 2016 06:12:08 GMT
FALCON-1715 IllegalStateException in MetadataMappingService when entity is scheduled via native
scheduler (by Pallavi Rao)


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

Branch: refs/heads/master
Commit: 32d23639f8fdf97451d2b30f9cccf2c5aead7afa
Parents: a923059
Author: Pallavi Rao <pallavi.rao@inmobi.com>
Authored: Mon Jan 18 11:02:45 2016 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Mon Jan 18 11:02:45 2016 +0530

----------------------------------------------------------------------
 CHANGES.txt                                      |  2 ++
 .../falcon/workflow/engine/OozieDAGEngine.java   | 19 +++++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/32d23639/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3169891..0b0a585 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -112,6 +112,8 @@ Proposed Release Version: 0.9
   OPTIMIZATIONS
 
   BUG FIXES
+    FALCON-1715 IllegalStateException in MetadataMappingService when entity is scheduled
via native scheduler (Pallavi Rao)
+
     FALCON-1732 Folders not getting deleted after testing (Praveen Adlakha via Pallavi Rao)
 
     FALCON-1675 Lifecycle stage is not honoured when only cluster level lifecycle is implemented
(Ajay Yadava via Pallavi Rao)

http://git-wip-us.apache.org/repos/asf/falcon/blob/32d23639/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
----------------------------------------------------------------------
diff --git a/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
b/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
index 1d0e126..4266118 100644
--- a/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
+++ b/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
@@ -99,8 +99,8 @@ public class OozieDAGEngine implements DAGEngine {
         try {
             Properties properties = getRunProperties(instance);
             Path buildPath = EntityUtil.getLatestStagingPath(cluster, instance.getEntity());
-            switchUser();
-            properties.setProperty(OozieClient.USER_NAME, CurrentUser.getUser());
+            switchUserTo(instance.getEntity().getACL().getOwner());
+            properties.setProperty(OozieClient.USER_NAME, instance.getEntity().getACL().getOwner());
             properties.setProperty(OozieClient.APP_PATH, buildPath.toString());
             return client.run(properties);
         } catch (OozieClientException e) {
@@ -112,6 +112,10 @@ public class OozieDAGEngine implements DAGEngine {
         }
     }
 
+    private void switchUserTo(String user) {
+        CurrentUser.authenticate(user);
+    }
+
     private void prepareEntityBuildPath(Entity entity) throws FalconException {
         Path stagingPath = EntityUtil.getBaseStagingPath(cluster, entity);
         Path logPath = EntityUtil.getLogPath(cluster, entity);
@@ -129,13 +133,13 @@ public class OozieDAGEngine implements DAGEngine {
     private void dryRunInternal(Properties properties, Path buildPath, Entity entity)
         throws OozieClientException, DAGEngineException {
         if (properties == null) {
-            LOG.info("Entity {} is not scheduled on cluster {}", entity.getName(), cluster);
+            LOG.info("Entity {} is not scheduled on cluster {} with user {}", entity.getName(),
cluster,
+                    entity.getACL().getOwner());
             throw new DAGEngineException("Properties for entity " + entity.getName() + "
is empty");
         }
 
-        switchUser();
-        LOG.debug("Logged in user is " + CurrentUser.getUser());
-        properties.setProperty(OozieClient.USER_NAME, CurrentUser.getUser());
+        switchUserTo(entity.getACL().getOwner());
+        properties.setProperty(OozieClient.USER_NAME, entity.getACL().getOwner());
         properties.setProperty(OozieClient.APP_PATH, buildPath.toString());
         properties.putAll(getDryRunProperties(entity));
         //Do dryrun before run as run is asynchronous
@@ -144,8 +148,7 @@ public class OozieDAGEngine implements DAGEngine {
     }
 
     private void switchUser() {
-        String user = System.getProperty("user.name");
-        CurrentUser.authenticate(user);
+        switchUserTo(System.getProperty("user.name"));
     }
 
     @Override


Mime
View raw message