@Override public void reconnect() throws MetaException { if (localMetaStore) { // For direct DB connections we don't yet support reestablishing connections. throw new MetaException("For direct MetaStore DB connections, we don't support retries" + " at the client level."); } else { close(); if (uriResolverHook != null) { //for dynamic uris, re-lookup if there are new metastore locations resolveUris(); } if (MetastoreConf.getVar(conf, ConfVars.THRIFT_URI_SELECTION).equalsIgnoreCase("RANDOM")) { // Swap the first element of the metastoreUris[] with a random element from the rest // of the array. Rationale being that this method will generally be called when the default // connection has died and the default connection is likely to be the first array element. promoteRandomMetaStoreURI(); } open(); } }