Repository: falcon
Updated Branches:
  refs/heads/master 568156e51 -> 5e270741b


FALCON-1683 Inconsistent behavior when user tries to switch schedulers. 
Contributed 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/24fd717a
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/24fd717a
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/24fd717a

Branch: refs/heads/master
Commit: 24fd717a9b01061ff6b53a51ad873747b0df577c
Parents: 568156e
Author: Ajay Yadava <[email protected]>
Authored: Wed Dec 23 09:30:01 2015 +0530
Committer: Ajay Yadava <[email protected]>
Committed: Wed Dec 23 09:30:01 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                               |  2 ++
 .../org/apache/falcon/workflow/WorkflowEngineFactory.java | 10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/24fd717a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1ba134e..4fc8d59 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -41,6 +41,8 @@ Trunk (Unreleased)
     FALCON-1213 Base framework of the native scheduler(Pallavi Rao)
 
   IMPROVEMENTS
+    FALCON-1683 Inconsistent behavior when user tries to switch 
schedulers(Pallavi Rao via Ajay Yadava)
+
     FALCON-1669 Falcon should show more helpful message when it is unable to 
initialize Falcon Client object(Baishuo via Ajay Yadava)
 
     FALCON-1635 Migration of EntityManagerJerseySmokeIT to use falcon 
unit(Narayan Periwal via Ajay Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/24fd717a/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
----------------------------------------------------------------------
diff --git 
a/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java 
b/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
index 6555906..c713712 100644
--- a/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
+++ b/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
@@ -69,13 +69,17 @@ public final class WorkflowEngineFactory {
     public static AbstractWorkflowEngine getWorkflowEngine(Entity entity, 
Map<String, String> props)
         throws FalconException {
         // If entity is null or not schedulable and the engine property is not 
specified, return the configured WE.
-        if (entity == null || !entity.getEntityType().isSchedulable()
-                || props == null || props.isEmpty() || 
!props.containsKey(ENGINE_PROP)) {
+        if (entity == null || !entity.getEntityType().isSchedulable()) {
             LOG.debug("Returning configured workflow engine for entity {}.", 
entity);
             return getWorkflowEngine();
         }
 
-        String engineName = props.get(ENGINE_PROP);
+        // Default to configured workflow engine when no properties are 
specified.
+        String engineName = getWorkflowEngine().getName();
+        if (props != null && props.containsKey(ENGINE_PROP)) {
+            engineName = props.get(ENGINE_PROP);
+        }
+
         if (engineName.equalsIgnoreCase(getWorkflowEngine().getName())) {
             // If already active on native
             if (getNativeWorkflowEngine().isActive(entity)) {

Reply via email to