Prefer auditstamp actor over agent for MLE actor
@@ -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
- if (event.type != agent.UNUSED) {
- return "urn:li:multiProduct:" + event.type.name().toLowerCase();
+ // use actorUrn in ChangeAuditStamp first
+ ChangeAuditStamp auditStamp = event.changeAuditStamp;
+ if (auditStamp != null && auditStamp.actorUrn != null) {
+ return auditStamp.actorUrn.toString();
}
- // 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");
+ // use app type as fallback
+ if (event.type != agent.UNUSED) {
+ return "urn:li:multiProduct:" + event.type.name().toLowerCase();
}
- return auditStamp.actorUrn.toString();
+ throw new IllegalArgumentException("Require ChangeAuditStamp actorUrn");
}
public FailedMetadataLineageEvent newFailedEvent(MetadataLineageEvent event, Throwable throwable) {
