@Override public void onDropDatabase(DropDatabaseEvent dbEvent) throws MetaException { // Subscriber can get notification about drop of a database in HCAT // by listening on a topic named "HCAT" and message selector string // as "HCAT_EVENT = HCAT_DROP_DATABASE" if (dbEvent.getStatus()) { String topicName = getTopicPrefix(dbEvent.getIHMSHandler().getConf()); send(messageFactory.buildDropDatabaseMessage(dbEvent.getDatabase()), topicName); } }
assert dropDB.getStatus();
Assert.assertTrue(dropDB.getStatus()); validateDropDb(db, dropDB.getDatabase()); validateDropDb(db, preDropDB.getDatabase());
@Override public void onDropDatabase(DropDatabaseEvent dbEvent) throws MetaException { // Subscriber can get notification about drop of a database in HCAT // by listening on a topic named "HCAT" and message selector string // as "HCAT_EVENT = HCAT_DROP_DATABASE" if (dbEvent.getStatus()) { String topicName = getTopicPrefix(dbEvent.getIHMSHandler().getConf()); send(messageFactory.buildDropDatabaseMessage(dbEvent.getDatabase()), topicName); } }
@Override public void onDropDatabase(DropDatabaseEvent dbEvent) throws MetaException { // Subscriber can get notification about drop of a database in HCAT // by listening on a topic named "HCAT" and message selector string // as "HCAT_EVENT = HCAT_DROP_DATABASE" if (dbEvent.getStatus()) { String topicName = getTopicPrefix(dbEvent.getHandler().getHiveConf()); send(messageFactory.buildDropDatabaseMessage(dbEvent.getDatabase()), topicName); } }
@Override public void onDropDatabase(DropDatabaseEvent dbEvent) throws MetaException { // Subscriber can get notification about drop of a database in HCAT // by listening on a topic named "HCAT" and message selector string // as "HCAT_EVENT = HCAT_DROP_DATABASE" if (dbEvent.getStatus()) { String topicName = getTopicPrefix(dbEvent.getHandler().getHiveConf()); send(messageFactory.buildDropDatabaseMessage(dbEvent.getDatabase()), topicName); } }
/** * Drop the privileges on the database. Note that child tables will be * dropped individually by client, so we just need to handle the removing * the db privileges. The table drop should cleanup the table privileges. */ @Override public void onDropDatabase(DropDatabaseEvent dbEvent) throws MetaException { // don't sync paths/privileges if the operation has failed if (!dbEvent.getStatus()) { LOGGER.debug("Skip syncing paths/privileges with Sentry server for onDropDatabase event," + " since the operation failed. \n"); return; } String authzObj = dbEvent.getDatabase().getName(); for (SentryMetastoreListenerPlugin plugin : sentryPlugins) { List<String> tNames = dbEvent.getHandler().get_all_tables(authzObj); plugin.removeAllPaths(authzObj, tNames); } if (!syncWithPolicyStore(AuthzConfVars.AUTHZ_SYNC_DROP_WITH_POLICY_STORE)) { return; } dropSentryDbPrivileges(dbEvent.getDatabase().getName()); }