pkuwm commented on a change in pull request #357: [WIP] Add getWorkflows(long 
timeout) to TaskDriver.
URL: https://github.com/apache/helix/pull/357#discussion_r307947633
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
 ##########
 @@ -115,14 +155,58 @@ public TaskDriver(HelixAdmin admin, HelixDataAccessor 
accessor, ConfigAccessor c
     this(admin, accessor, propertyStore, clusterName);
   }
 
+  public TaskDriver(HelixAdmin admin,
+                    HelixDataAccessor accessor,
+                    HelixPropertyStore<ZNRecord> propertyStore,
+                    String clusterName) {
+    this(admin, accessor, propertyStore, clusterName, DEFAULT_POOL_SIZE);
+  }
+
   public TaskDriver(HelixAdmin admin, HelixDataAccessor accessor,
-      HelixPropertyStore<ZNRecord> propertyStore, String clusterName) {
+      HelixPropertyStore<ZNRecord> propertyStore, String clusterName, int 
poolSize) {
     _admin = admin;
     _accessor = accessor;
     _propertyStore = propertyStore;
     _clusterName = clusterName;
+    _poolSize = poolSize;
+  }
+
+
+  /**
+   *  Start TaskDriver's thread-pool.
+   */
+  public void startPool() {
 
 Review comment:
   Has been thinking about this. 
   It seems it might be better to give callers to pass in its own threadpool. 
The caller would have its ownership to create and shutdown the theadpool. And 
also set the threadpool size based on its needs.
   Would offer below methods:
   ```java
   public ExecutorService getExecutorService() {}
   public void setExecutorService(ExecutorService pool) {}
   ``` 
   
   @i3wangyi @jiajunwang @narendly  How do you like this idea?

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


With regards,
Apache Git Services

Reply via email to