static boolean updateConnectionURL(Configuration originalConf, Configuration activeConf,
    String badUrl, MetaStoreInitData updateData)
      throws MetaException {
    String connectUrl = null;
    String currentUrl = MetaStoreInit.getConnectionURL(activeConf);
    try {
      // We always call init because the hook name in the configuration could
      // have changed.
      initConnectionUrlHook(originalConf, updateData);
      if (updateData.urlHook != null) {
        if (badUrl != null) {
          updateData.urlHook.notifyBadConnectionUrl(badUrl);
        }
        connectUrl = updateData.urlHook.getJdoConnectionUrl(originalConf);
      }
    } catch (Exception e) {
      LOG.error("Exception while getting connection URL from the hook: " +
          e);
    }

    if (connectUrl != null && !connectUrl.equals(currentUrl)) {
      LOG.error(
          String.format("Overriding %s with %s",
              MetastoreConf.ConfVars.CONNECT_URL_KEY.toString(),
              connectUrl));
      MetastoreConf.setVar(activeConf, ConfVars.CONNECT_URL_KEY, connectUrl);
      return true;
    }
    return false;
  }
Updates the connection URL in hiveConf using the hook (if a hook has been
set using hive.metastore.ds.connection.url.hook property)
@param originalConf - original configuration used to look up hook settings
@param activeConf - the configuration file in use for looking up db url
@param badUrl
@param updateData - hook information
@return true if a new connection URL was loaded into the thread local
        configuration
@throws MetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreInit.java