public static boolean checkIfDbNeedsToBeSkipped(Database db) {
    assert (db != null);
    if (isBackgroundThreadsEnabledForRepl(db)) {
      return false;
    } else if (isDbBeingPlannedFailedOver(db)) {
      LOG.info("Skipping all the tables which belong to database: {} as it is being failed over", db.getName());
      return true;
    } else if (isTargetOfReplication(db)) {
      LOG.info("Skipping all the tables which belong to replicated database: {}", db.getName());
      return true;
    }
    return false;
  }
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