You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2018/10/29 23:21:28 UTC

[2/3] helix git commit: [HELIX-768] TASK: Fix a bug in WorkflowAccessor

[HELIX-768] TASK: Fix a bug in WorkflowAccessor

There was a bug in WorkflowAccessor where a JSON was submitted to for PUT requests, it would created a WorkflowConfig based on the JSON but fails to create a workflow with the config. This was preventing users to create workflows via REST APIs properly.
Changelist:
1. Ensure that the configs submitted are reflected in the workflow being created


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/65bb3509
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/65bb3509
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/65bb3509

Branch: refs/heads/master
Commit: 65bb35090a90679cc0973d142a1d9a27d1522bbe
Parents: 1d32172
Author: Hunter Lee <hu...@linkedin.com>
Authored: Mon Oct 29 15:54:04 2018 -0700
Committer: Hunter Lee <hu...@linkedin.com>
Committed: Mon Oct 29 15:54:04 2018 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/helix/task/WorkflowConfig.java       | 3 +--
 .../helix/rest/server/resources/helix/WorkflowAccessor.java       | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/65bb3509/helix-core/src/main/java/org/apache/helix/task/WorkflowConfig.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/task/WorkflowConfig.java b/helix-core/src/main/java/org/apache/helix/task/WorkflowConfig.java
index 0f8a48c..6136175 100644
--- a/helix-core/src/main/java/org/apache/helix/task/WorkflowConfig.java
+++ b/helix-core/src/main/java/org/apache/helix/task/WorkflowConfig.java
@@ -493,8 +493,7 @@ public class WorkflowConfig extends ResourceConfig {
     @Deprecated
     public static Builder fromMap(Map<String, String> cfg) {
       Builder builder = new Builder();
-      builder.setConfigMap(cfg);
-      return builder;
+      return builder.setConfigMap(cfg);
     }
 
     // TODO: Add user customized simple field clone.

http://git-wip-us.apache.org/repos/asf/helix/blob/65bb3509/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/WorkflowAccessor.java
----------------------------------------------------------------------
diff --git a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/WorkflowAccessor.java b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/WorkflowAccessor.java
index 679b3cc..7cfbe85 100644
--- a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/WorkflowAccessor.java
+++ b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/WorkflowAccessor.java
@@ -138,6 +138,7 @@ public class WorkflowAccessor extends AbstractHelixResource {
       }
 
       Workflow.Builder workflow = new Workflow.Builder(workflowId);
+      workflow.setWorkflowConfig(workflowConfig);
 
       if (root.get(WorkflowProperties.Jobs.name()) != null) {
         Map<String, JobConfig.Builder> jobConfigs =