Created
May 19, 2010 21:24
-
-
Save ryanobjc/406853 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -801,8 +985,26 @@ public class ThriftServer { | |
Hbase.Processor processor = new Hbase.Processor(handler); | |
TServerTransport serverTransport = new TServerSocket(port); | |
TProtocolFactory protFactory = new TBinaryProtocol.Factory(true, true); | |
- TServer server = new TThreadPoolServer(processor, serverTransport, | |
- protFactory); | |
+ TThreadPoolServer.Options options = new TThreadPoolServer.Options(); | |
+ options.maxWorkerThreads = 10000; // 10k | |
+ TServer server = new TThreadPoolServer( | |
+ processor, | |
+ serverTransport, | |
+ new TTransportFactory(), | |
+ new TTransportFactory(), | |
+ protFactory, | |
+ protFactory, | |
+ options); | |
+ /* TProcessor processor processor | |
+ TServerTransport serverTransport serverTransport | |
+ TTransportFactory inputFactory (new TTransportFactory()) // from tthreadpoolserver | |
+ TTransportFactory outputFactory (new TTransportFactory()) | |
+ TProtocolFactory inputFactory protFactory | |
+ TProtocolFactory outputFactory protFactory | |
+ Options options | |
+ */ | |
+ | |
+ // , outputTransportFactory, inputProtocolFactory, outputProtocolFactory, Options | |
server.serve(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment