docs: @Override
      public HiveMetastoreClient createMetastoreClient()
              throws TException
      {
          List<HostAndPort> metastores = new ArrayList<>(addresses);
          Collections.shuffle(metastores.subList(1, metastores.size()));
  
          TException lastException = null;
          for (HostAndPort metastore : metastores) {
              try {
                  HiveMetastoreClient client = clientFactory.create(metastore);
                  if (!isNullOrEmpty(metastoreUsername)) {
                      client.setUGI(metastoreUsername);
                  }
                  return client;
              }
              catch (TException e) {
                  lastException = e;
              }
          }
          throw new TException("Failed connecting to Hive metastore: " + addresses, lastException);
      }