@Override
  boolean shouldAccept(final NotificationEvent event) {
    if ((dbPattern == null) || isTxnRelatedEvent(event)) {
      return true;
    }
    if (dbPattern.matcher(event.getDbName()).matches()) {
      if ((tableName == null)
          // if our dbName is equal, but tableName is blank, we're interested in this db-level event
          || (tableName.equalsIgnoreCase(event.getTableName()))
        // table level event that matches us
          ) {
        return true;
      }
    }
    return false;
  }
Utility function that constructs a notification filter to match a given db name and/or table name.
If dbName == null, fetches all warehouse events.
If dnName != null, but tableName == null, fetches all events for the db
If dbName != null &amp;&amp; tableName != null, fetches all events for the specified table
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/messaging/event/filters/DatabaseAndTableFilter.java