/** * Notify a list of listeners about a specific metastore event. Each listener notified might update * the (ListenerEvent) event by setting a parameter key/value pair. These updated parameters will * be returned to the caller. * * @param listeners List of MetaStoreEventListener listeners. * @param eventType Type of the notification event. * @param event The ListenerEvent with information about the event. * @return A list of key/value pair parameters that the listeners set. The returned object will return an empty * map if no parameters were updated or if no listeners were notified. * @throws MetaException If an error occurred while calling the listeners. */ public static Map<String, String> notifyEvent(List<? extends MetaStoreEventListener> listeners, EventType eventType, ListenerEvent event) throws MetaException { Preconditions.checkNotNull(listeners, "Listeners must not be null."); Preconditions.checkNotNull(event, "The event must not be null."); for (MetaStoreEventListener listener : listeners) { notificationEvents.get(eventType).notify(listener, event); } // Each listener called above might set a different parameter on the event. // This write permission is allowed on the listener side to avoid breaking compatibility if we change the API // method calls. return event.getParameters(); }
/** * Notify a list of listeners about a specific metastore event to be executed within a txn. Each listener notified * might update the (ListenerEvent) event by setting a parameter key/value pair. These updated parameters will * be returned to the caller. * * @param listeners List of MetaStoreEventListener listeners. * @param eventType Type of the notification event. * @param event The ListenerEvent with information about the event. * @param dbConn The JDBC connection to the remote meta store db. * @param sqlGenerator The helper class to generate db specific SQL string. * @return A list of key/value pair parameters that the listeners set. The returned object will return an empty * map if no parameters were updated or if no listeners were notified. * @throws MetaException If an error occurred while calling the listeners. */ public static Map<String, String> notifyEventWithDirectSql(List<? extends MetaStoreEventListener> listeners, EventType eventType, ListenerEvent event, Connection dbConn, SQLGenerator sqlGenerator) throws MetaException { Preconditions.checkNotNull(listeners, "Listeners must not be null."); Preconditions.checkNotNull(event, "The event must not be null."); for (MetaStoreEventListener listener : listeners) { txnNotificationEvents.get(eventType).notify(listener, event, dbConn, sqlGenerator); } // Each listener called above might set a different parameter on the event. // This write permission is allowed on the listener side to avoid breaking compatibility if we change the API // method calls. return event.getParameters(); }
/** * Notify a list of listeners about a specific metastore event. Each listener notified might update * the (ListenerEvent) event by setting a parameter key/value pair. These updated parameters will * be returned to the caller. * * @param listeners List of MetaStoreEventListener listeners. * @param eventType Type of the notification event. * @param event The ListenerEvent with information about the event. * @return A list of key/value pair parameters that the listeners set. The returned object will return an empty * map if no parameters were updated or if no listeners were notified. * @throws MetaException If an error occurred while calling the listeners. */ public static Map<String, String> notifyEvent(List<? extends MetaStoreEventListener> listeners, EventType eventType, ListenerEvent event) throws MetaException { Preconditions.checkNotNull(listeners, "Listeners must not be null."); Preconditions.checkNotNull(event, "The event must not be null."); for (MetaStoreEventListener listener : listeners) { notificationEvents.get(eventType).notify(listener, event); } // Each listener called above might set a different parameter on the event. // This write permission is allowed on the listener side to avoid breaking compatibility if we change the API // method calls. return event.getParameters(); }
/** * Notify a list of listeners about a specific metastore event to be executed within a txn. Each listener notified * might update the (ListenerEvent) event by setting a parameter key/value pair. These updated parameters will * be returned to the caller. * * @param listeners List of MetaStoreEventListener listeners. * @param eventType Type of the notification event. * @param event The ListenerEvent with information about the event. * @param dbConn The JDBC connection to the remote meta store db. * @param sqlGenerator The helper class to generate db specific SQL string. * @return A list of key/value pair parameters that the listeners set. The returned object will return an empty * map if no parameters were updated or if no listeners were notified. * @throws MetaException If an error occurred while calling the listeners. */ public static Map<String, String> notifyEventWithDirectSql(List<? extends MetaStoreEventListener> listeners, EventType eventType, ListenerEvent event, Connection dbConn, SQLGenerator sqlGenerator) throws MetaException { Preconditions.checkNotNull(listeners, "Listeners must not be null."); Preconditions.checkNotNull(event, "The event must not be null."); for (MetaStoreEventListener listener : listeners) { txnNotificationEvents.get(eventType).notify(listener, event, dbConn, sqlGenerator); } // Each listener called above might set a different parameter on the event. // This write permission is allowed on the listener side to avoid breaking compatibility if we change the API // method calls. return event.getParameters(); }