Search in sources :

Example 1 with Nimbus

use of backtype.storm.generated.Nimbus in project jstorm by alibaba.

the class NimbusServer method initThrift.

@SuppressWarnings("rawtypes")
private void initThrift(Map conf) throws TTransportException {
    Integer thrift_port = JStormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_PORT));
    TNonblockingServerSocket socket = new TNonblockingServerSocket(thrift_port);
    Integer maxReadBufSize = JStormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_MAX_BUFFER_SIZE));
    THsHaServer.Args args = new THsHaServer.Args(socket);
    args.workerThreads(ServiceHandler.THREAD_NUM);
    args.protocolFactory(new TBinaryProtocol.Factory(false, true, maxReadBufSize, -1));
    args.processor(new Nimbus.Processor<Iface>(serviceHandler));
    args.maxReadBufferBytes = maxReadBufSize;
    thriftServer = new THsHaServer(args);
    LOG.info("Successfully started nimbus: started Thrift server...");
    thriftServer.serve();
}
Also used : Iface(backtype.storm.generated.Nimbus.Iface) THsHaServer(org.apache.thrift.server.THsHaServer) TBinaryProtocol(org.apache.thrift.protocol.TBinaryProtocol) TNonblockingServerSocket(org.apache.thrift.transport.TNonblockingServerSocket) Nimbus(backtype.storm.generated.Nimbus) INimbus(backtype.storm.scheduler.INimbus)

Aggregations

Nimbus (backtype.storm.generated.Nimbus)1 Iface (backtype.storm.generated.Nimbus.Iface)1 INimbus (backtype.storm.scheduler.INimbus)1 TBinaryProtocol (org.apache.thrift.protocol.TBinaryProtocol)1 THsHaServer (org.apache.thrift.server.THsHaServer)1 TNonblockingServerSocket (org.apache.thrift.transport.TNonblockingServerSocket)1