flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject git commit: FLUME-2243. Avro Source should name threads instead of using generic names.
Date Tue, 11 Mar 2014 20:07:32 GMT
Repository: flume
Updated Branches:
  refs/heads/flume-1.5 5a06871c7 -> aacd016a9


FLUME-2243. Avro Source should name threads instead of using generic names.

(Ashish Paliwal via Hari Shreedharan)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/aacd016a
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/aacd016a
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/aacd016a

Branch: refs/heads/flume-1.5
Commit: aacd016a9dadd70cc5d3ce49c21c95f7c3483268
Parents: 5a06871
Author: Hari Shreedharan <hshreedharan@apache.org>
Authored: Tue Mar 11 13:05:51 2014 -0700
Committer: Hari Shreedharan <hshreedharan@apache.org>
Committed: Tue Mar 11 13:05:51 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/flume/source/AvroSource.java | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/aacd016a/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
----------------------------------------------------------------------
diff --git a/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java b/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
index c1ee3a9..3eef687 100644
--- a/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
+++ b/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
@@ -35,7 +35,10 @@ import java.util.concurrent.TimeUnit;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.avro.ipc.NettyServer;
+import org.apache.avro.ipc.NettyTransceiver;
 import org.apache.avro.ipc.Responder;
 import org.apache.avro.ipc.Server;
 import org.apache.avro.ipc.specific.SpecificResponder;
@@ -246,11 +249,21 @@ public class AvroSource extends AbstractSource implements EventDrivenSource,
     NioServerSocketChannelFactory socketChannelFactory;
     if (maxThreads <= 0) {
       socketChannelFactory = new NioServerSocketChannelFactory
-          (Executors .newCachedThreadPool(), Executors.newCachedThreadPool());
+        (Executors.newCachedThreadPool(new ThreadFactoryBuilder().
+          setNameFormat("Avro " + NettyTransceiver.class.getSimpleName()
+            + " Boss-%d").build()),
+          Executors.newCachedThreadPool(new ThreadFactoryBuilder().
+            setNameFormat("Avro " + NettyTransceiver.class.getSimpleName()
+              + "  I/O Worker-%d").build()));
     } else {
       socketChannelFactory = new NioServerSocketChannelFactory(
-          Executors.newCachedThreadPool(),
-          Executors.newFixedThreadPool(maxThreads));
+        Executors.newCachedThreadPool(new ThreadFactoryBuilder().
+          setNameFormat(
+            "Avro " + NettyTransceiver.class.getSimpleName()
+              + " Boss-%d").build()),
+        Executors.newFixedThreadPool(maxThreads, new ThreadFactoryBuilder().
+          setNameFormat("Avro " + NettyTransceiver.class.getSimpleName() +
+            "  I/O Worker-%d").build()));
     }
     return socketChannelFactory;
   }


Mime
View raw message