You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2019/01/23 09:06:42 UTC

[GitHub] hit-lacus commented on a change in pull request #443: KYLIN-3759 & KYLIN-3744

hit-lacus commented on a change in pull request #443: KYLIN-3759 & KYLIN-3744
URL: https://github.com/apache/kylin/pull/443#discussion_r250105474
 
 

 ##########
 File path: stream-coordinator/src/main/java/org/apache/kylin/stream/coordinator/Coordinator.java
 ##########
 @@ -132,14 +143,37 @@ private Coordinator() {
         this.zkClient = ZKUtils.getZookeeperClient();
         this.selector = new CoordinatorLeaderSelector();
         this.jobStatusChecker = new StreamingBuildJobStatusChecker();
-        this.streamingJobCheckExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory(
-                "streaming_job_status_checker"));
+        this.streamingJobCheckExecutor = Executors.newScheduledThreadPool(1,
+                new NamedThreadFactory("streaming_job_status_checker"));
         if (ServerMode.SERVER_MODE.canServeStreamingCoordinator()) {
             start();
         }
     }
 
-    public static Coordinator getInstance() {
+    @VisibleForTesting
+    protected Coordinator(StreamMetadataStore metadataStore, ReceiverAdminClient receiverClient) {
+        this.streamMetadataStore = metadataStore;
+        this.receiverAdminClient = receiverClient;
+        this.assigner = new DefaultAssigner();
+        this.zkClient = ZKUtils.getZookeeperClient();
+        this.selector = new CoordinatorLeaderSelector();
+        this.jobStatusChecker = new StreamingBuildJobStatusChecker();
+        this.streamingJobCheckExecutor = Executors.newScheduledThreadPool(1,
+                new NamedThreadFactory("streaming_job_status_checker"));
+        if (ServerMode.SERVER_MODE.canServeStreamingCoordinator()) {
+            start();
+        }
+        this.isLead = true;
+    }
+
+    public static synchronized Coordinator getInstance() {
 
 Review comment:
   OK, I understand.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services