public static List<String> matchesDb(Hive db, String dbPattern) throws HiveException {
    if (dbPattern == null) {
      return db.getAllDatabases();
    } else {
      return db.getDatabasesByPattern(dbPattern);
    }
  }
Given a ReplChangeManger's encoded uri, it replaces the nameservice and returns the modified encoded uri.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java