NIFI-174: Always 'enrich' the Provenance SEND event, regardless of whether or not we are commiting ot he repository immediately

This commit is contained in:
Mark Payne 2014-12-30 10:29:38 -05:00
parent 05cc6f045d
commit 7589ad356e
1 changed files with 4 additions and 6 deletions

View File

@ -159,14 +159,12 @@ public class StandardProvenanceReporter implements ProvenanceReporter {
try { try {
final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.SEND).setTransitUri(transitUri).setEventDuration(transmissionMillis).setDetails(details).build(); final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.SEND).setTransitUri(transitUri).setEventDuration(transmissionMillis).setDetails(details).build();
final ProvenanceEventRecord enriched = eventEnricher.enrich(record, flowFile);
if (force) { if (force) {
if (eventEnricher == null) { repository.registerEvent(enriched);
repository.registerEvent(record);
} else { } else {
repository.registerEvent(eventEnricher.enrich(record, flowFile)); events.add(enriched);
}
} else {
events.add(record);
} }
} catch (final Exception e) { } catch (final Exception e) {
logger.error("Failed to generate Provenance Event due to " + e); logger.error("Failed to generate Provenance Event due to " + e);