Reamer commented on code in PR #4804:
URL: https://github.com/apache/zeppelin/pull/4804#discussion_r1732475675
##########
zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/NamedThreadFactory.java:
##########
@@ -21,19 +21,17 @@
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicLong;
-public class SchedulerThreadFactory implements ThreadFactory {
+public class NamedThreadFactory implements ThreadFactory {
- private String namePrefix;
- private AtomicLong count = new AtomicLong(1);
+ private final String name;
+ private final AtomicLong count = new AtomicLong(1);
- public SchedulerThreadFactory(String namePrefix) {
- this.namePrefix = namePrefix;
+ public NamedThreadFactory(String name) {
+ this.name = name;
}
@Override
public Thread newThread(Runnable r) {
- Thread thread = new Thread(r);
- thread.setName(namePrefix + count.getAndIncrement());
- return thread;
+ return new Thread(r, name + "-" + count.getAndIncrement() + "-");
Review Comment:
It is not needed at all, thank you for your review.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]