public static String getTargetEventId(String dbName, Hive hiveDb) throws Exception {
    Database database = hiveDb.getDatabase(dbName);
    String targetLastEventId = getTargetLastReplicatedStateFromParameters(database.getParameters());
    List<NotificationEvent> events =
        hiveDb.getMSC().getNextNotification(Long.parseLong(targetLastEventId) - 1, 1, null).getEvents();
    if (events == null || events.isEmpty() || events.get(0).getEventId() != Long.parseLong(targetLastEventId)) {
      throw new IllegalStateException("Notification events are missing in the meta store.");
    }
    return targetLastEventId;
  }
Fetches the notification id from the database with respect to target database.
@param dbName name of database
@param hiveDb the hive object
@return the corresponding notification event id from target database
@throws Exception
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/OptimisedBootstrapUtils.java