accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1455639 - /accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
Date Tue, 12 Mar 2013 17:30:09 GMT
Author: ecn
Date: Tue Mar 12 17:30:08 2013
New Revision: 1455639

URL: http://svn.apache.org/r1455639
Log:
ACCUMULO-1173 ensure that threads serving requests are Daemonized

Modified:
    accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java

Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java?rev=1455639&r1=1455638&r2=1455639&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
(original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
Tue Mar 12 17:30:08 2013
@@ -54,6 +54,7 @@ import org.apache.thrift.transport.TServ
 import org.apache.thrift.transport.TServerTransport;
 import org.apache.thrift.transport.TTransport;
 import org.apache.thrift.transport.TTransportException;
+import org.apache.thrift.transport.TTransportFactory;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.Watcher.Event.EventType;
@@ -168,6 +169,13 @@ public class TraceServer implements Watc
     sock.bind(new InetSocketAddress(port));
     final TServerTransport transport = new TServerSocket(sock);
     TThreadPoolServer.Args options = new TThreadPoolServer.Args(transport);
+    options.transportFactory(new TTransportFactory() {
+      @Override
+      public TTransport getTransport(TTransport trans) {
+        Thread.currentThread().setDaemon(true);
+        return super.getTransport(trans);
+      }
+    });
     options.processor(new SpanReceiver.Processor(new Receiver()));
     server = new TThreadPoolServer(options);
     final InetSocketAddress address = new InetSocketAddress(Accumulo.getLocalAddress(args),
sock.getLocalPort());



Mime
View raw message