@Override
  public void alter_table_with_environmentContext(String dbname, String tbl_name, Table new_tbl,
      EnvironmentContext envContext) throws TException {
    HiveMetaHook hook = getHook(new_tbl);
    if (hook != null) {
      hook.preAlterTable(new_tbl, envContext);
    }
    AlterTableRequest req = new AlterTableRequest(dbname, tbl_name, new_tbl);
    req.setCatName(MetaStoreUtils.getDefaultCatalog(conf));
    req.setEnvironmentContext(envContext);
    if (processorCapabilities != null) {
      req.setProcessorCapabilities(new ArrayList<String>(Arrays.asList(processorCapabilities)));
      req.setProcessorIdentifier(processorIdentifier);
    }
    boolean success = false;
    try {
      client.alter_table_req(req);
      if (hook != null) {
        hook.commitAlterTable(new_tbl, envContext);
      }
      success = true;
    } finally {
      if (!success && (hook != null)) {
        hook.rollbackAlterTable(new_tbl, envContext);
      }
    }
  }
Swaps the first element of the metastoreUris array with a random element from the
remainder of the array.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java