/** * Returns a unique identifier for the record. By default, it uses * {@link ProvenanceEventRecord#getEventId()} but if it has not been persisted to the * repository, this is {@code -1}, so it constructs a String of the format * {@code <event type>_on_<flowfile UUID>_by_<component UUID>_at_<event time>}. * * @return a String identifying the record for later analysis */ @Override public String getBestEventIdentifier() { if (getEventId() != -1) { return Long.toString(getEventId()); } else { return getEventType().name() + "_on_" + getFlowFileUuid() + "_by_" + getComponentId() + "_at_" + getEventTime(); } }
public void index(final StandardProvenanceEventRecord record, final IndexWriter indexWriter, final Integer blockIndex) throws IOException { final Document doc = new Document(); addField(doc, SearchableFields.FlowFileUUID, record.getFlowFileUuid(), Store.NO); addField(doc, SearchableFields.Filename, record.getAttribute(CoreAttributes.FILENAME.key()), Store.NO); addField(doc, SearchableFields.ComponentID, record.getComponentId(), Store.NO); if (eventType == ProvenanceEventType.FORK || eventType == ProvenanceEventType.CLONE || eventType == ProvenanceEventType.REPLAY) { for (final String uuid : record.getChildUuids()) { if (!uuid.equals(record.getFlowFileUuid())) { addField(doc, SearchableFields.FlowFileUUID, uuid, Store.NO); if (!uuid.equals(record.getFlowFileUuid())) { addField(doc, SearchableFields.FlowFileUUID, uuid, Store.NO);
/** * Returns a unique identifier for the record. By default, it uses * {@link ProvenanceEventRecord#getEventId()} but if it has not been persisted to the * repository, this is {@code -1}, so it constructs a String of the format * {@code <event type>_on_<flowfile UUID>_by_<component UUID>_at_<event time>}. * * @return a String identifying the record for later analysis */ @Override public String getBestEventIdentifier() { if (getEventId() != -1) { return Long.toString(getEventId()); } else { return getEventType().name() + "_on_" + getFlowFileUuid() + "_by_" + getComponentId() + "_at_" + getEventTime(); } }