@Override public void run() { invokeServer.serve(); } }).start();
/** * Is ThriftServer listening to requests? * * @return */ public boolean isServing() { if (_server == null) return false; return _server.isServing(); }
public boolean isRunning() { if (server == null) { return false; } else { return server.isServing(); } }
public void simple(JstormAM.Processor processor) { try { TServerTransport serverTransport = new TServerSocket(port); TServer server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(processor)); LOG.info("Starting the simple server..."); server.serve(); } catch (Exception e) { e.printStackTrace(); } }
private TServer getTThreadPoolServer() { TServerTransport serverTransport; if (isSslEnabled()) { serverTransport = getSSLServerTransport(); } else { serverTransport = getTServerTransport(); } TThreadPoolServer.Args serverArgs = new TThreadPoolServer.Args(serverTransport); serverArgs.maxWorkerThreads(maxThreads); populateServerParams(serverArgs); return new TThreadPoolServer(serverArgs); }
@Override public void run() { server.serve(); } }
public void stop() { if (_server != null) _server.stop(); }
public void onComplete(Void o) { open_result result = new open_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
protected TServer getTNonBlockingServer(TNonblockingServerTransport serverTransport, TProtocolFactory protocolFactory, TProcessor processor, TTransportFactory transportFactory, InetSocketAddress inetSocketAddress) { LOG.info("starting HBase Nonblocking Thrift server on " + inetSocketAddress.toString()); TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport); serverArgs.processor(processor); serverArgs.transportFactory(transportFactory); serverArgs.protocolFactory(protocolFactory); return new TNonblockingServer(serverArgs); }
private THsHaServer initInvokeServer(Map conf, final Drpc service) throws Exception { int port = JStormUtils.parseInt(conf.get(Config.DRPC_INVOCATIONS_PORT)); LOG.info("Begin to init DRPC invoke server at port: " + port); TNonblockingServerSocket socket = new TNonblockingServerSocket(port); THsHaServer.Args targsInvoke = new THsHaServer.Args(socket); targsInvoke.workerThreads(64); targsInvoke.protocolFactory(new TBinaryProtocol.Factory()); targsInvoke.processor(new DistributedRPCInvocations.Processor<DistributedRPCInvocations.Iface>(service)); THsHaServer invokeServer = new THsHaServer(targsInvoke); LOG.info("Successfully inited DRPC invoke server at port: " + port); return invokeServer; }
@Override public void run() { server.serve(); } });
@Override protected void stopServer() { server.stop(); server = null; LOG.info("Thrift server has stopped"); }
public void onComplete(List<InterpreterCompletion> o) { completion_result result = new completion_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
@Override public void run() { server.serve(); } });
public void stop() { server.stop(); }
public void onComplete(RemoteApplicationResult o) { runApplication_result result = new runApplication_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
public void onComplete(Void o) { updateOutput_result result = new updateOutput_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
public void onComplete(Void o) { addAngularObject_result result = new addAngularObject_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
public void onComplete(ByteBuffer o) { getResource_result result = new getResource_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {