use of org.apache.nifi.atlas.provenance.StandardAnalysisContext in project nifi by apache.
the class ReportLineageToAtlas method consumeNiFiProvenanceEvents.
private void consumeNiFiProvenanceEvents(ReportingContext context, NiFiFlow nifiFlow) {
final EventAccess eventAccess = context.getEventAccess();
final AnalysisContext analysisContext = new StandardAnalysisContext(nifiFlow, clusterResolvers, // FIXME: This class cast shouldn't be necessary to query lineage. Possible refactor target in next major update.
(ProvenanceRepository) eventAccess.getProvenanceRepository());
consumer.consumeEvents(context, (componentMapHolder, events) -> {
for (ProvenanceEventRecord event : events) {
try {
lineageStrategy.processEvent(analysisContext, nifiFlow, event);
} catch (Exception e) {
// If something went wrong, log it and continue with other records.
getLogger().error("Skipping failed analyzing event {} due to {}.", new Object[] { event, e, e });
}
}
nifiAtlasHook.commitMessages();
});
}
Aggregations