mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-30 20:15:56 +00:00
Prefer auditstamp actor over agent for MLE actor (#1244)
This commit is contained in:
parent
bc8b138232
commit
00ad604db3
@ -107,17 +107,17 @@ public class MetadataLineageProcessor extends KafkaMessageProcessor {
|
||||
* Get actor Urn string from app type or change audit stamp
|
||||
*/
|
||||
private String getActorUrn(MetadataLineageEvent event) {
|
||||
// use app type first
|
||||
// use actorUrn in ChangeAuditStamp first
|
||||
ChangeAuditStamp auditStamp = event.changeAuditStamp;
|
||||
if (auditStamp != null && auditStamp.actorUrn != null) {
|
||||
return auditStamp.actorUrn.toString();
|
||||
}
|
||||
|
||||
// use app type as fallback
|
||||
if (event.type != agent.UNUSED) {
|
||||
return "urn:li:multiProduct:" + event.type.name().toLowerCase();
|
||||
}
|
||||
|
||||
// if app type = UNUSED, use actorUrn in ChangeAuditStamp
|
||||
ChangeAuditStamp auditStamp = event.changeAuditStamp;
|
||||
if (auditStamp == null || auditStamp.actorUrn == null) {
|
||||
throw new IllegalArgumentException("Requires ChangeAuditStamp actorUrn if MLE agent is UNUSED");
|
||||
}
|
||||
return auditStamp.actorUrn.toString();
|
||||
throw new IllegalArgumentException("Require ChangeAuditStamp actorUrn");
|
||||
}
|
||||
|
||||
public FailedMetadataLineageEvent newFailedEvent(MetadataLineageEvent event, Throwable throwable) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user