NIFI-782: Make sure that FlowFiles' lineage identifiers are propagated properly

This commit is contained in:
Mark Payne 2015-07-31 09:55:08 -04:00
parent bf84ce6608
commit 496ebfb3be
1 changed files with 4 additions and 1 deletions

View File

@ -2522,7 +2522,9 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE
newAttributes.put(key, value);
}
fFileBuilder.lineageIdentifiers(parent.getLineageIdentifiers());
final Set<String> lineageIdentifiers = new HashSet<>(parent.getLineageIdentifiers());
lineageIdentifiers.add(parent.getAttribute(CoreAttributes.UUID.key()));
fFileBuilder.lineageIdentifiers(lineageIdentifiers);
fFileBuilder.lineageStartDate(parent.getLineageStartDate());
fFileBuilder.addAttributes(newAttributes);
@ -2549,6 +2551,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE
final Set<String> lineageIdentifiers = new HashSet<>();
for (final FlowFile parent : parents) {
lineageIdentifiers.addAll(parent.getLineageIdentifiers());
lineageIdentifiers.add(parent.getAttribute(CoreAttributes.UUID.key()));
final long parentLineageStartDate = parent.getLineageStartDate();
if (lineageStartDate == 0L || parentLineageStartDate < lineageStartDate) {