private void promoteRandomMetaStoreURI() {
    if (metastoreUris.length <= 1) {
      return;
    }
    Random rng = new Random();
    int index = rng.nextInt(metastoreUris.length - 1) + 1;
    URI tmp = metastoreUris[0];
    metastoreUris[0] = metastoreUris[index];
    metastoreUris[index] = tmp;
  }
Swaps the first element of the metastoreUris array with a random element from the remainder of
the array.
amoro-format-mixed/amoro-mixed-trino/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java