Created
November 25, 2014 04:53
-
-
Save dcapwell/815046e22c1bd4e0cd48 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
package tach_demo; | |
import java.net.InetSocketAddress; | |
import tachyon.org.apache.thrift.TProcessor; | |
import tachyon.org.apache.thrift.server.TServer; | |
import tachyon.org.apache.thrift.server.TThreadedSelectorServer; | |
import tachyon.org.apache.thrift.transport.TNonblockingServerSocket; | |
import tachyon.org.apache.thrift.transport.TTransportException; | |
import tachyon.master.MasterServiceHandler; | |
import tachyon.thrift.MasterService; | |
public class TachyonHelper { | |
private TachyonHelper() {}; | |
public static TServer createServer() throws Exception { | |
return new TThreadedSelectorServer(args()); | |
} | |
private static TThreadedSelectorServer.Args args() throws Exception { | |
MasterService.Processor<MasterServiceHandler> p = | |
//TProcessor p = | |
new MasterService.Processor<MasterServiceHandler>(new MasterServiceHandler(null)); | |
InetSocketAddress address = new InetSocketAddress(12345); | |
return new TThreadedSelectorServer.Args(new TNonblockingServerSocket(address)) | |
.processor(p) | |
.selectorThreads(10) | |
.acceptQueueSizePerThread(10) | |
.workerThreads(10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment