use of org.apache.hadoop.hive.metastore.events.PreCreateFunctionEvent in project hive by apache.
the class CreateFunctionEvent method getOutputHObjs.
private List<HivePrivilegeObject> getOutputHObjs() {
if (LOG.isDebugEnabled()) {
LOG.debug("==> CreateFunctionEvent.getOutputHObjs()");
}
List<HivePrivilegeObject> ret = new ArrayList<>();
PreCreateFunctionEvent event = (PreCreateFunctionEvent) preEventContext;
Function function = event.getFunction();
List<ResourceUri> uris = function.getResourceUris();
ret.add(new HivePrivilegeObject(HivePrivilegeObject.HivePrivilegeObjectType.DATABASE, function.getDbName(), null, null, null, HivePrivilegeObject.HivePrivObjectActionType.OTHER, null, null, function.getOwnerName(), function.getOwnerType()));
ret.add(new HivePrivilegeObject(HivePrivilegeObject.HivePrivilegeObjectType.FUNCTION, function.getDbName(), function.getFunctionName(), null, null, HivePrivilegeObject.HivePrivObjectActionType.OTHER, null, function.getClassName(), function.getOwnerName(), function.getOwnerType()));
if (uris != null && !uris.isEmpty()) {
for (ResourceUri uri : uris) {
ret.add(new HivePrivilegeObject(HivePrivilegeObject.HivePrivilegeObjectType.DFS_URI, null, uri.getUri()));
}
}
COMMAND_STR = buildCommandString(function);
if (LOG.isDebugEnabled()) {
LOG.debug("<== CreateFunctionEvent.getOutputHObjs(): ret=" + ret);
}
return ret;
}
Aggregations