code: public static TServer createThreadedSelectorServer(TProcessorFactory processorFactory,
              TProtocolFactory protocolFactory, int port, int numSelectorThreads,
              int numWorkerThreads, int clientTimeoutMillisecs, int maxFrameSize,
              long maxReadBufferSize) throws TTransportException {
          if (numSelectorThreads < 1) {
              numSelectorThreads = 2;
          }
          if (numWorkerThreads < 1) {
              numWorkerThreads = 8;
          }
          TNonblockingServerTransport transport = new TNonblockingServerSocket(port,
                  clientTimeoutMillisecs);
          TTransportFactory transportFactory = new TFramedTransport.Factory(maxFrameSize);
          TThreadedSelectorServer.Args args = new TThreadedSelectorServer.Args(transport)
                  .processorFactory(processorFactory).protocolFactory(protocolFactory)
                  .transportFactory(transportFactory).workerThreads(numWorkerThreads)
                  .acceptPolicy(AcceptPolicy.FAIR_ACCEPT).acceptQueueSizePerThread(10000)
                  .selectorThreads(numSelectorThreads);
          args.maxReadBufferBytes = maxReadBufferSize;
          TThreadedSelectorServer server = new TThreadedSelectorServer(args);
          return server;
      }
docs: Helper method to create a new framed-transport, threaded-selector
  {@link TServer}.
  
  <p>
  Note: if {@code numSelectorThreads < 1}, the {@link TServer} is created
  with 2 selector threads.
  </p>
  
  <p>
  Note: if {@code numWorkerThreads < 1}, the {@link TServer} is created
  with 8 worker threads.
  </p>
  
  @param processorFactory
  @param protocolFactory
  @param port
  @param numSelectorThreads
  @param numWorkerThreads
  @param clientTimeoutMillisecs
  @param maxFrameSize
  @param maxReadBufferSize
  @return
  @throws TTransportException