You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by lx...@apache.org on 2016/08/17 04:27:01 UTC
[05/33] helix git commit: Add methods in TaskDriver for getting
Workflow/Job configuration and context. External users should call these
methods instead of TaskUtil.
Add methods in TaskDriver for getting Workflow/Job configuration and context. External users should call these methods instead of TaskUtil.
Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/d213c1a7
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/d213c1a7
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/d213c1a7
Branch: refs/heads/helix-0.6.x
Commit: d213c1a7b3fc310d38749f9555e5660858c37c3b
Parents: 7a47070
Author: Lei Xia <lx...@linkedin.com>
Authored: Fri Feb 12 15:12:06 2016 -0800
Committer: Lei Xia <lx...@linkedin.com>
Committed: Tue Jul 5 14:42:18 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/helix/task/TaskDriver.java | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/helix/blob/d213c1a7/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java b/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
index 193526f..ce7bbf0 100644
--- a/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
+++ b/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
@@ -605,8 +605,8 @@ public class TaskDriver {
// Set the job configuration
PropertyKey.Builder keyBuilder = _accessor.keyBuilder();
- HelixProperty resourceConfig = new HelixProperty(jobName);
- resourceConfig.getRecord().getSimpleFields().putAll(jobConfig.getResourceConfigMap());
+ ResourceConfig resourceConfig = new ResourceConfig(jobName);
+ resourceConfig.putSimpleConfigs(jobConfig.getResourceConfigMap());
Map<String, TaskConfig> taskConfigMap = jobConfig.getTaskConfigMap();
if (taskConfigMap != null) {
for (TaskConfig taskConfig : taskConfigMap.values()) {
@@ -695,6 +695,22 @@ public class TaskDriver {
}
}
+ public WorkflowConfig getWorkflowConfig(String workflow) {
+ return TaskUtil.getWorkflowCfg(_cfgAccessor, _accessor, _clusterName, workflow);
+ }
+
+ public WorkflowContext getWorkflowContext(String workflow) {
+ return TaskUtil.getWorkflowContext(_propertyStore, workflow);
+ }
+
+ public JobConfig getJobConfig(String job) {
+ return TaskUtil.getJobCfg(_accessor, job);
+ }
+
+ public JobContext getJobContext(String job) {
+ return TaskUtil.getJobContext(_propertyStore, job);
+ }
+
public void list(String resource) {
WorkflowConfig wCfg = TaskUtil.getWorkflowCfg(_cfgAccessor, _accessor, _clusterName, resource);
if (wCfg == null) {