pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jerrypeng commented on a change in pull request #3109: Consolidate timer threads in functions
Date Mon, 03 Dec 2018 17:49:32 GMT
jerrypeng commented on a change in pull request #3109: Consolidate timer threads in functions
URL: https://github.com/apache/pulsar/pull/3109#discussion_r238371071
 
 

 ##########
 File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/InstanceCache.java
 ##########
 @@ -18,17 +18,24 @@
  */
 package org.apache.pulsar.functions.instance;
 
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import lombok.Getter;
+
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
 
 public class InstanceCache {
 
     private static InstanceCache instance;
 
-    public final ScheduledExecutorService executor;
+    @Getter
+    private final ScheduledExecutorService scheduledExecutorService;
 
     private InstanceCache() {
-        executor = Executors.newSingleThreadScheduledExecutor();;
+        ThreadFactory namedThreadFactory =
+                new ThreadFactoryBuilder().setNameFormat("function-timer-thread").build();
 
 Review comment:
   ok

----------------------------------------------------------------
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

Mime
View raw message