public static boolean isDbBeingPlannedFailedOver(Database db) {
    assert (db != null);
    Map<String, String> dbParameters = db.getParameters();
    if (dbParameters == null) {
      return false;
    }
    String dbFailoverEndPoint = dbParameters.get(ReplConst.REPL_FAILOVER_ENDPOINT);
    return FailoverEndpoint.SOURCE.toString().equalsIgnoreCase(dbFailoverEndPoint)
            || FailoverEndpoint.TARGET.toString().equalsIgnoreCase(dbFailoverEndPoint);
  }
Determines whether a table is an external table.

@param table table of interest

@return true if external
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java