private void waitForThriftServer() throws Exception {
    boolean isServing = false;
    int i = 0;
    while (i++ < 100) {
      if (thriftServer.tserver == null) {
        Thread.sleep(100);
      } else {
        isServing = true;
        break;
      }
    }

    if (!isServing) {
      if (thriftServer != null) {
        thriftServer.stop();
      }
      throw new IOException("Failed to start thrift server ");
    }
  }
create a new thrift server
@param conf configuration
@param type the type of thrift server
@return the instance of ThriftServer
hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java