void expire(final FlowFile flowFile, final String details) { try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.EXPIRE).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
void expire(final FlowFile flowFile, final String details) { try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.EXPIRE).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
ProvenanceEventRecord drop(final FlowFile flowFile, final String reason) { try { final ProvenanceEventBuilder builder = build(flowFile, ProvenanceEventType.DROP); if (reason != null) { builder.setDetails("Discard reason: " + reason); } final ProvenanceEventRecord record = builder.build(); events.add(record); return record; } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } return null; } }
@Override public void modifyAttributes(final FlowFile flowFile, final String details) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.ATTRIBUTES_MODIFIED).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void invokeRemoteProcess(FlowFile flowFile, String transitUri, String details) { try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.REMOTE_INVOCATION) .setTransitUri(transitUri).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void modifyAttributes(final FlowFile flowFile, final String details) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.ATTRIBUTES_MODIFIED).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void create(final FlowFile flowFile, final String details) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.CREATE).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void invokeRemoteProcess(FlowFile flowFile, String transitUri, String details) { try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.REMOTE_INVOCATION) .setTransitUri(transitUri).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void create(final FlowFile flowFile, final String details) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.CREATE).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void modifyContent(final FlowFile flowFile, final String details, final long processingMillis) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.CONTENT_MODIFIED).setEventDuration(processingMillis).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void modifyContent(final FlowFile flowFile, final String details, final long processingMillis) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.CONTENT_MODIFIED).setEventDuration(processingMillis).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
ProvenanceEventRecord generateDropEvent(final FlowFile flowFile, final String details) { return build(flowFile, ProvenanceEventType.DROP).setDetails(details).build(); }
ProvenanceEventRecord generateDropEvent(final FlowFile flowFile, final String details) { return build(flowFile, ProvenanceEventType.DROP).setDetails(details).build(); }
@Override public void route(final FlowFile flowFile, final Relationship relationship, final String details, final long processingDuration) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.ROUTE).setRelationship(relationship).setDetails(details).setEventDuration(processingDuration).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void route(final FlowFile flowFile, final Relationship relationship, final String details, final long processingDuration) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.ROUTE).setRelationship(relationship).setDetails(details).setEventDuration(processingDuration).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void send(final FlowFile flowFile, final String transitUri, final String details, final long transmissionMillis, final boolean force) { try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.SEND).setTransitUri(transitUri).setEventDuration(transmissionMillis).setDetails(details).build(); if (force) { sharedSessionState.addProvenanceEvents(Collections.singleton(record)); } else { events.add(record); } } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void fetch(final FlowFile flowFile, final String transitUri, final String details, final long transmissionMillis) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.FETCH) .setTransitUri(transitUri) .setEventDuration(transmissionMillis) .setDetails(details) .build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void fetch(final FlowFile flowFile, final String transitUri, final String details, final long transmissionMillis) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.FETCH) .setTransitUri(transitUri) .setEventDuration(transmissionMillis) .setDetails(details) .build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
@Override public void receive(final FlowFile flowFile, final String transitUri, final String sourceSystemFlowFileIdentifier, final String details, final long transmissionMillis) { verifyFlowFileKnown(flowFile); try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.RECEIVE) .setTransitUri(transitUri).setSourceSystemFlowFileIdentifier(sourceSystemFlowFileIdentifier).setEventDuration(transmissionMillis).setDetails(details).build(); events.add(record); } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e); if (logger.isDebugEnabled()) { logger.error("", e); } } }
private ProvenanceEventRecord createDropProvenanceEvent(final FlowFileRecord flowFile, final String requestor) { final ProvenanceEventBuilder builder = provRepository.eventBuilder(); builder.fromFlowFile(flowFile); builder.setEventType(ProvenanceEventType.DROP); builder.setLineageStartDate(flowFile.getLineageStartDate()); builder.setComponentId(getIdentifier()); builder.setComponentType("Connection"); builder.setAttributes(flowFile.getAttributes(), Collections.emptyMap()); builder.setDetails("FlowFile Queue emptied by " + requestor); builder.setSourceQueueIdentifier(getIdentifier()); final ContentClaim contentClaim = flowFile.getContentClaim(); if (contentClaim != null) { final ResourceClaim resourceClaim = contentClaim.getResourceClaim(); builder.setPreviousContentClaim(resourceClaim.getContainer(), resourceClaim.getSection(), resourceClaim.getId(), contentClaim.getOffset(), flowFile.getSize()); } return builder.build(); }