private void clearHMSTxnHandlerStaticResource() {
    try {
      // Clear the static connection pool resource in
      // org.apache.hadoop.hive.metastore.txn.TxnHandler
      // in case using the old connection pool in the new Hive Metastore server.
      Class<?> handlerClass = Class.forName("org.apache.hadoop.hive.metastore.txn.TxnHandler");
      Field coonPoolField = handlerClass.getDeclaredField("connPool");
      coonPoolField.setAccessible(true);
      coonPoolField.set(null, null);
    } catch (Exception e) {
      LOG.warn("Fail to clear static resource in HMS TxnHandler", e);
    }
  }
Starts a TestHiveMetastore with a provided connection pool size.

@param poolSize The number of threads in the executor pool
amoro-common/src/test/java/org/apache/amoro/hive/HMSMockServer.java