use of org.apache.hadoop.hive.metastore.events.PreAlterDatabaseEvent in project hive by apache.
the class AlterDatabaseEvent method getOutputHObjs.
private List<HivePrivilegeObject> getOutputHObjs() {
LOG.debug("==> AlterDatabaseEvent.getOutputHObjs()");
List<HivePrivilegeObject> ret = new ArrayList<>();
PreAlterDatabaseEvent event = (PreAlterDatabaseEvent) preEventContext;
Database database = event.getNewDatabase();
if (database != null) {
ret.add(getHivePrivilegeObject(database));
String newUri = (database != null) ? database.getLocationUri() : "";
if (StringUtils.isNotEmpty(newUri)) {
ret.add(getHivePrivilegeObjectDfsUri(newUri));
}
COMMAND_STR = buildCommandString(COMMAND_STR, database);
LOG.debug("<== AlterDatabaseEvent.getOutputHObjs(): ret={}", ret);
}
return ret;
}
use of org.apache.hadoop.hive.metastore.events.PreAlterDatabaseEvent in project hive by apache.
the class AlterDatabaseEvent method getOperationType.
private HiveOperationType getOperationType() {
PreAlterDatabaseEvent event = (PreAlterDatabaseEvent) preEventContext;
Database database = event.getNewDatabase();
Database oldDatabase = event.getOldDatabase();
String newUri = (database != null) ? database.getLocationUri() : "";
String oldUri = (oldDatabase != null) ? oldDatabase.getLocationUri() : "";
return StringUtils.equals(oldUri, newUri) ? HiveOperationType.ALTERDATABASE : HiveOperationType.ALTERDATABASE_LOCATION;
}
Aggregations