Package org.apache.thrift.server

Examples of org.apache.thrift.server.TServer.serve()


        serverEngine = new TNonblockingServer(testProcessor, tServerSocket);
      }

      // Run it
      System.out.println("Starting the server on port " + port + "...");
      serverEngine.serve();

    } catch (Exception x) {
      x.printStackTrace();
    }
    System.out.println("done.");
View Full Code Here


    final TServer tserver = server;
    realUser.doAs(
      new PrivilegedAction<Object>() {
        @Override
        public Object run() {
          tserver.serve();
          return null;
        }
      });
  }
}
View Full Code Here

            args.transportFactory(new TFramedTransport.Factory());
            args.protocolFactory(new TBinaryProtocol.Factory(true, true));
            TServer server = new THsHaServer(args);
   
            log.info("Starting the packetstreamer hsha server on port {} ...", port);
            server.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
View Full Code Here

                    TServerSocket serverTransport = new TServerSocket(SuggestorServer.this.port);
                    Suggestor.Processor processor = new Suggestor.Processor(new SuggestorImpl(SuggestorServer.this.suggestor));
                    Factory protFactory = new TBinaryProtocol.Factory(true, true);
                    TServer server = new TThreadPoolServer(processor, serverTransport, protFactory);
                    System.out.println("Starting suggestor server on port " + SuggestorServer.this.port + " ...");
                    server.serve();
                } catch( TTransportException tte ){
                    tte.printStackTrace();
                }
            }
        };
View Full Code Here

                    TServerSocket serverTransport = new TServerSocket(IndexerServer.this.port);
                    Indexer.Processor processor = new Indexer.Processor(new IndexerImpl(ie, IndexerServer.this.indexer));
                    Factory protFactory = new TBinaryProtocol.Factory(true, true);
                    TServer server = new TThreadPoolServer(processor, serverTransport, protFactory);
                    System.out.println("Starting indexer server on port " +  IndexerServer.this.port + " ...");
                    server.serve();
                } catch( TTransportException tte ){
                    tte.printStackTrace();
                }
            }
        } ;
View Full Code Here

                    TServerSocket serverTransport = new TServerSocket(SearcherServer.this.port);
                    Searcher.Processor processor = new Searcher.Processor(new SearcherImpl(SearcherServer.this.searcher));
                    Factory protFactory = new TBinaryProtocol.Factory(true, true);
                    TServer server = new TThreadPoolServer(processor, serverTransport, protFactory);
                    System.out.println("Starting searcher server on port " + SearcherServer.this.port + " ...");
                    server.serve();
                } catch( TTransportException tte ){
                    tte.printStackTrace();
                }
            }
        };
View Full Code Here

                try {
                    TServerSocket serverTransport = new TServerSocket(port);
                    Factory protFactory = new TBinaryProtocol.Factory(true, true);
                    TServer server = new TThreadPoolServer(processor, serverTransport, protFactory);
                    System.out.println("Starting " + name + " server on port " + port + " ...");
                    server.serve();
                } catch( TTransportException tte ){
                    tte.printStackTrace();
                }
            }
        };
View Full Code Here

      if (cli.isVerbose()) {
        System.err.println(msg);
      }

      server.serve();
    } catch (Exception x) {
      x.printStackTrace();
    }
  }
}
View Full Code Here

    } else if (hsha) {
      server = getTHsHaServer(protocolFactory, processor, transportFactory, inetSocketAddress, metrics);
    } else {
      server = getTThreadPoolServer(protocolFactory, processor, transportFactory, inetSocketAddress);
    }
    server.serve();
  }
}
View Full Code Here

      HMSHandler.LOG.info("Options.minWorkerThreads = "
          + options.minWorkerThreads);
      HMSHandler.LOG.info("Options.maxWorkerThreads = "
          + options.maxWorkerThreads);
      HMSHandler.LOG.info("TCP keepalive = " + tcpKeepAlive);
      tServer.serve();
    } catch (Throwable x) {
      x.printStackTrace();
      HMSHandler.LOG.error(StringUtils.stringifyException(x));
      throw x;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.