public TServer buildTServer(Args args) { if (DatabaseDescriptor.getClientEncryptionOptions().enabled) throw new RuntimeException("Client SSL is not supported for non-blocking sockets. Please remove client ssl from the configuration."); final InetSocketAddress addr = args.addr; TNonblockingServerTransport serverTransport; try { serverTransport = new TCustomNonblockingServerSocket(addr, args.keepAlive, args.sendBufferSize, args.recvBufferSize); } catch (TTransportException e) { throw new RuntimeException(String.format("Unable to create thrift socket to %s:%s", addr.getAddress(), addr.getPort()), e); } // This is single threaded hence the invocation will be all // in one thread. TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport).inputTransportFactory(args.inTransportFactory) .outputTransportFactory(args.outTransportFactory) .inputProtocolFactory(args.tProtocolFactory) .outputProtocolFactory(args.tProtocolFactory) .processor(args.processor); return new CustomTNonBlockingServer(serverArgs); } }
@SuppressWarnings("resource") public TServer buildTServer(Args args) { if (DatabaseDescriptor.getClientEncryptionOptions().enabled) throw new RuntimeException("Client SSL is not supported for non-blocking sockets. Please remove client ssl from the configuration."); final InetSocketAddress addr = args.addr; TNonblockingServerTransport serverTransport; try { serverTransport = new TCustomNonblockingServerSocket(addr, args.keepAlive, args.sendBufferSize, args.recvBufferSize); } catch (TTransportException e) { throw new RuntimeException(String.format("Unable to create thrift socket to %s:%s", addr.getAddress(), addr.getPort()), e); } // This is single threaded hence the invocation will be all // in one thread. TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport).inputTransportFactory(args.inTransportFactory) .outputTransportFactory(args.outTransportFactory) .inputProtocolFactory(args.tProtocolFactory) .outputProtocolFactory(args.tProtocolFactory) .processor(args.processor); return new CustomTNonBlockingServer(serverArgs); } }
@SuppressWarnings("resource") public TServer buildTServer(Args args) { if (DatabaseDescriptor.getClientEncryptionOptions().enabled) throw new RuntimeException("Client SSL is not supported for non-blocking sockets. Please remove client ssl from the configuration."); final InetSocketAddress addr = args.addr; TNonblockingServerTransport serverTransport; try { serverTransport = new TCustomNonblockingServerSocket(addr, args.keepAlive, args.sendBufferSize, args.recvBufferSize); } catch (TTransportException e) { throw new RuntimeException(String.format("Unable to create thrift socket to %s:%s", addr.getAddress(), addr.getPort()), e); } // This is single threaded hence the invocation will be all // in one thread. TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport).inputTransportFactory(args.inTransportFactory) .outputTransportFactory(args.outTransportFactory) .inputProtocolFactory(args.tProtocolFactory) .outputProtocolFactory(args.tProtocolFactory) .processor(args.processor); return new CustomTNonBlockingServer(serverArgs); } }