This is an automated email from the ASF dual-hosted git repository.

journey pushed a commit to branch dev-1.2.1
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev-1.2.1 by this push:
     new fdbf7c8  Fixed tasks_queue and tasks_kill did not exist in zookeeper 
#1696 (#1734)
fdbf7c8 is described below

commit fdbf7c8a9ccd8ff25656ee8b33f5c2ad69470bb1
Author: lgcareer <[email protected]>
AuthorDate: Mon Jan 6 18:21:17 2020 +0800

    Fixed tasks_queue and tasks_kill did not exist in zookeeper #1696 (#1734)
    
    Co-authored-by: elonlo <[email protected]>
---
 .../common/queue/TaskQueueZkImpl.java               | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git 
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java
 
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java
index 03a6064..537dcf1 100644
--- 
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java
+++ 
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java
@@ -37,8 +37,27 @@ public class TaskQueueZkImpl implements ITaskQueue {
 
     private static final Logger logger = 
LoggerFactory.getLogger(TaskQueueZkImpl.class);
 
+    private final ZookeeperOperator zookeeperOperator;
+
     @Autowired
-    private ZookeeperOperator zookeeperOperator;
+    public TaskQueueZkImpl(ZookeeperOperator zookeeperOperator) {
+        this.zookeeperOperator = zookeeperOperator;
+
+        try {
+            String tasksQueuePath = 
getTasksPath(Constants.DOLPHINSCHEDULER_TASKS_QUEUE);
+            String tasksCancelPath = 
getTasksPath(Constants.DOLPHINSCHEDULER_TASKS_KILL);
+
+            for(String key : new String[]{tasksQueuePath,tasksCancelPath}){
+                if(!zookeeperOperator.isExisted(key)){
+                    zookeeperOperator.persist(key, "");
+                    logger.info("create tasks queue parent node success : {}", 
key);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("create tasks queue parent node failure", e);
+        }
+    }
+
 
     /**
      * get all tasks from tasks queue

Reply via email to