You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/18 07:59:52 UTC

[GitHub] jiazhai closed pull request #1274: Ensure we instantiate threads that extend Netty FastThreadLocalThread

jiazhai closed pull request #1274: Ensure we instantiate threads that extend Netty FastThreadLocalThread
URL: https://github.com/apache/bookkeeper/pull/1274
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java
index 463e29281..b24fb95fa 100644
--- a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java
+++ b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java
@@ -22,13 +22,15 @@
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningScheduledExecutorService;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
+
+import io.netty.util.concurrent.DefaultThreadFactory;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Random;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
@@ -134,7 +136,7 @@ public static SchedulerBuilder newSchedulerBuilder() {
         @SuppressWarnings("unchecked")
         public T build() {
             if (null == threadFactory) {
-                threadFactory = Executors.defaultThreadFactory();
+                threadFactory = new DefaultThreadFactory(name);
             }
             return (T) new OrderedScheduler(
                 name,
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java
index 81cae9e9c..16bf35c54 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieThread.java
@@ -17,6 +17,8 @@
  */
 package org.apache.bookkeeper.bookie;
 
+import io.netty.util.concurrent.FastThreadLocalThread;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -25,7 +27,7 @@
  * Any common handing that we require for all bookie threads
  * should be implemented here
  */
-public class BookieThread extends Thread implements
+public class BookieThread extends FastThreadLocalThread implements
         Thread.UncaughtExceptionHandler {
 
     private static final Logger LOG = LoggerFactory


 

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