You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/03 17:49:32 UTC
[GitHub] jerrypeng commented on a change in pull request #3109: Consolidate
timer threads in functions
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