merlimat commented on a change in pull request #3109: Consolidate timer threads
in functions
URL: https://github.com/apache/pulsar/pull/3109#discussion_r238361135
##########
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:
By preference, use `new DefaultThreadFactory("function-timer-thread")`
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services