code: public static TServer createHsHaServer(TProcessorFactory processorFactory,
              TProtocolFactory protocolFactory, int port, int maxWorkerThreads,
              int clientTimeoutMillisecs, int maxFrameSize, long maxReadBufferSize)
              throws TTransportException {
          if (maxWorkerThreads < 1) {
              maxWorkerThreads = Math.max(2, Runtime.getRuntime().availableProcessors());
          }
          TNonblockingServerTransport transport = new TNonblockingServerSocket(port,
                  clientTimeoutMillisecs);
          TTransportFactory transportFactory = new TFramedTransport.Factory(maxFrameSize);
          THsHaServer.Args args = new THsHaServer.Args(transport).processorFactory(processorFactory)
                  .protocolFactory(protocolFactory).transportFactory(transportFactory)
                  .minWorkerThreads(1).maxWorkerThreads(maxWorkerThreads).stopTimeoutVal(60)
                  .stopTimeoutUnit(TimeUnit.SECONDS);
          args.maxReadBufferBytes = maxReadBufferSize;
          THsHaServer server = new THsHaServer(args);
          return server;
      }
docs: Helper method to create a new framed-transport, HsHa {@link TServer}.
  
  <p>
  Note: if {@code maxWorkerThreads < 1}, the {@link TServer} is created
  with {@code maxWorkerThreads} =
  {@code Math.max(2, Runtime.getRuntime().availableProcessors())}
  </p>
  
  @param processorFactory
  @param protocolFactory
  @param port
  @param maxWorkerThreads
  @param clientTimeoutMillisecs
  @param maxFrameSize
  @param maxReadBufferSize
  @return
  @throws TTransportException