@Override public void clone(final FlowFile parent, final FlowFile child) { verifyFlowFileKnown(child); try { final ProvenanceEventBuilder eventBuilder = build(parent, ProvenanceEventType.CLONE); eventBuilder.addChildFlowFile(child); eventBuilder.addParentFlowFile(parent); events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
void clone(final FlowFile parent, final FlowFile child, final boolean verifyFlowFile) { if (verifyFlowFile) { verifyFlowFileKnown(child); } try { final ProvenanceEventBuilder eventBuilder = build(parent, ProvenanceEventType.CLONE); eventBuilder.addChildFlowFile(child); eventBuilder.addParentFlowFile(parent); events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void join(final Collection<FlowFile> parents, final FlowFile child, final String details, final long joinDuration) { verifyFlowFileKnown(child); try { final ProvenanceEventBuilder eventBuilder = build(child, ProvenanceEventType.JOIN); eventBuilder.addChildFlowFile(child); eventBuilder.setDetails(details); for (final FlowFile parent : parents) { eventBuilder.addParentFlowFile(parent); } events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void join(final Collection<FlowFile> parents, final FlowFile child, final String details, final long joinDuration) { verifyFlowFileKnown(child); try { final ProvenanceEventBuilder eventBuilder = build(child, ProvenanceEventType.JOIN); eventBuilder.addChildFlowFile(child); eventBuilder.setDetails(details); for (final FlowFile parent : parents) { eventBuilder.addParentFlowFile(parent); } events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
/** * Generates a Fork event for the given child and parents but does not register the event. This is useful so that a ProcessSession has the ability to de-dupe events, since one or more events may * be created by the session itself, as well as by the Processor * * @param parents parents * @param child child * @return record */ ProvenanceEventRecord generateJoinEvent(final Collection<FlowFile> parents, final FlowFile child) { final ProvenanceEventBuilder eventBuilder = build(child, ProvenanceEventType.JOIN); eventBuilder.addChildFlowFile(child); for (final FlowFile parent : parents) { eventBuilder.addParentFlowFile(parent); } return eventBuilder.build(); }
@Override public void fork(final FlowFile parent, final Collection<FlowFile> children, final String details, final long forkDuration) { verifyFlowFileKnown(parent); try { final ProvenanceEventBuilder eventBuilder = build(parent, ProvenanceEventType.FORK); eventBuilder.addParentFlowFile(parent); for (final FlowFile child : children) { eventBuilder.addChildFlowFile(child); } if (forkDuration > -1L) { eventBuilder.setEventDuration(forkDuration); } if (details != null) { eventBuilder.setDetails(details); } events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void fork(final FlowFile parent, final Collection<FlowFile> children, final String details, final long forkDuration) { verifyFlowFileKnown(parent); try { final ProvenanceEventBuilder eventBuilder = build(parent, ProvenanceEventType.FORK); eventBuilder.addParentFlowFile(parent); for (final FlowFile child : children) { eventBuilder.addChildFlowFile(child); } if (forkDuration > -1L) { eventBuilder.setEventDuration(forkDuration); } if (details != null) { eventBuilder.setDetails(details); } events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
/** * Generates a Fork event for the given child and parents but does not * register the event. This is useful so that a ProcessSession has the * ability to de-dupe events, since one or more events may be created by the * session itself, as well as by the Processor * * @param parents * parents * @param child * child * @return record */ ProvenanceEventRecord generateJoinEvent(final Collection<FlowFile> parents, final FlowFile child) { final ProvenanceEventBuilder eventBuilder = build(child, ProvenanceEventType.JOIN); eventBuilder.addChildFlowFile(child); for (final FlowFile parent : parents) { eventBuilder.addParentFlowFile(parent); } return eventBuilder.build(); }
copy.getChildFlowFileIds().clear(); copy.addChildFlowFile(flowFileId);
private void registerForkEvent(final FlowFile parent, final FlowFile child) { ProvenanceEventBuilder eventBuilder = forkEventBuilders.get(parent); if (eventBuilder == null) { eventBuilder = context.getProvenanceRepository().eventBuilder(); eventBuilder.setEventType(ProvenanceEventType.FORK); eventBuilder.setFlowFileEntryDate(parent.getEntryDate()); eventBuilder.setLineageStartDate(parent.getLineageStartDate()); eventBuilder.setFlowFileUUID(parent.getAttribute(CoreAttributes.UUID.key())); eventBuilder.setComponentId(context.getConnectable().getIdentifier()); final Connectable connectable = context.getConnectable(); final String processorType = connectable.getComponentType(); eventBuilder.setComponentType(processorType); eventBuilder.addParentFlowFile(parent); updateEventContentClaims(eventBuilder, parent, getRecord(parent)); forkEventBuilders.put(parent, eventBuilder); } eventBuilder.addChildFlowFile(child); }
@Override public void clone(final FlowFile parent, final FlowFile child) { verifyFlowFileKnown(child); try { final ProvenanceEventBuilder eventBuilder = build(parent, ProvenanceEventType.CLONE); eventBuilder.addChildFlowFile(child); eventBuilder.addParentFlowFile(parent); events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void join(final Collection<FlowFile> parents, final FlowFile child, final String details, final long joinDuration) { verifyFlowFileKnown(child); try { final ProvenanceEventBuilder eventBuilder = build(child, ProvenanceEventType.JOIN); eventBuilder.addChildFlowFile(child); eventBuilder.setDetails(details); for (final FlowFile parent : parents) { eventBuilder.addParentFlowFile(parent); } events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void fork(final FlowFile parent, final Collection<FlowFile> children, final String details, final long forkDuration) { verifyFlowFileKnown(parent); try { final ProvenanceEventBuilder eventBuilder = build(parent, ProvenanceEventType.FORK); eventBuilder.addParentFlowFile(parent); for (final FlowFile child : children) { eventBuilder.addChildFlowFile(child); } if (forkDuration > -1L) { eventBuilder.setEventDuration(forkDuration); } if (details != null) { eventBuilder.setDetails(details); } events.add(eventBuilder.build()); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
/** * Generates a Fork event for the given child and parents but does not * register the event. This is useful so that a ProcessSession has the * ability to de-dupe events, since one or more events may be created by the * session itself, as well as by the Processor * * @param parents * parents * @param child * child * @return record */ ProvenanceEventRecord generateJoinEvent(final Collection<FlowFile> parents, final FlowFile child) { final ProvenanceEventBuilder eventBuilder = build(child, ProvenanceEventType.JOIN); eventBuilder.addChildFlowFile(child); for (final FlowFile parent : parents) { eventBuilder.addParentFlowFile(parent); } return eventBuilder.build(); }