@Override public List<String> getChildUuids() { return record.getChildUuids(); }
@Override public List<String> getChildUuids() { return event.getChildUuids(); }
@Override public List<String> getChildUuids() { return record.getChildUuids(); }
/** * Checks if the given event is a spurious FORK, meaning that the FORK has a * single child and that child was removed in this session. This happens * when a Processor calls #create(FlowFile) and then removes the created * FlowFile. * * @param event event * @return true if spurious fork */ private boolean isSpuriousForkEvent(final ProvenanceEventRecord event, final Set<String> removedFlowFiles) { if (event.getEventType() == ProvenanceEventType.FORK) { final List<String> childUuids = event.getChildUuids(); if (childUuids != null && childUuids.size() == 1 && removedFlowFiles.contains(childUuids.get(0))) { return true; } } return false; }
private static String stringify(final ProvenanceEventRecord event, final int index, final long byteOffset) { final StringBuilder sb = new StringBuilder(); sb.append("Event Index in File = ").append(index).append(", Byte Offset = ").append(byteOffset); sb.append("\n\t").append("Event ID = ").append(event.getEventId()); sb.append("\n\t").append("Event Type = ").append(event.getEventType()); sb.append("\n\t").append("Event Time = ").append(new Date(event.getEventTime())); sb.append("\n\t").append("Event UUID = ").append(event.getFlowFileUuid()); sb.append("\n\t").append("Component ID = ").append(event.getComponentId()); sb.append("\n\t").append("Event ID = ").append(event.getComponentType()); sb.append("\n\t").append("Transit URI = ").append(event.getTransitUri()); sb.append("\n\t").append("Parent IDs = ").append(event.getParentUuids()); sb.append("\n\t").append("Child IDs = ").append(event.getChildUuids()); sb.append("\n\t").append("Previous Attributes = ").append(event.getPreviousAttributes()); sb.append("\n\t").append("Updated Attributes = ").append(event.getUpdatedAttributes()); return sb.toString(); } }
@Override public boolean select(final ProvenanceEventRecord event) { if (!isAuthorized(event, user)) { return false; } if (flowFileUuids.contains(event.getFlowFileUuid())) { return true; } for (final String parentId : event.getParentUuids()) { if (flowFileUuids.contains(parentId)) { return true; } } for (final String childId : event.getChildUuids()) { if (flowFileUuids.contains(childId)) { return true; } } return false; } };
for (final String uuid : event.getChildUuids()) { if (pattern.matcher(uuid).matches()) { found = true; continue; } else if (event.getFlowFileUuid().equals(searchValue) || event.getParentUuids().contains(searchValue) || event.getChildUuids().contains(searchValue)) { continue;
case CLONE: { for (final String childUuid : record.getChildUuids()) { if (flowFileUuids.contains(childUuid)) { final FlowFileNode childNode = new FlowFileNode(childUuid, record.getEventTime());
case JOIN: case REPLAY: { return submitLineageComputation(event.getChildUuids(), user, authorizer, LineageComputationType.EXPAND_CHILDREN, eventId, event.getEventTime(), Long.MAX_VALUE);
@Override public ComputeLineageSubmission submitExpandChildren(final long eventId, final NiFiUser user) { final String userId = user == null ? null : user.getIdentity(); final ProvenanceEventRecord event = getEvent(eventId, user); if (event == null) { final AsyncLineageSubmission submission = new AsyncLineageSubmission(LineageComputationType.EXPAND_CHILDREN, eventId, Collections.emptyList(), 1, userId); lineageSubmissionMap.put(submission.getLineageIdentifier(), submission); submission.getResult().update(Collections.emptyList(), 0L); return submission; } switch (event.getEventType()) { case JOIN: case FORK: case REPLAY: case CLONE: return submitLineageComputation(event.getChildUuids(), user, LineageComputationType.EXPAND_CHILDREN, eventId); default: { final AsyncLineageSubmission submission = new AsyncLineageSubmission(LineageComputationType.EXPAND_CHILDREN, eventId, Collections.emptyList(), 1, userId); lineageSubmissionMap.put(submission.getLineageIdentifier(), submission); submission.getResult().setError("Event ID " + eventId + " indicates an event of type " + event.getEventType() + " so its children cannot be expanded"); return submission; } } }
case JOIN: case REPLAY: return submitLineageComputation(event.getChildUuids(), user, LineageComputationType.EXPAND_CHILDREN, eventId, event.getEventTime(), Long.MAX_VALUE); default: final AsyncLineageSubmission submission = new AsyncLineageSubmission(LineageComputationType.EXPAND_CHILDREN, eventId, Collections.<String>emptyList(), 1, userId);
final ProvenanceEventRecord event = builder.build(); if (!event.getChildUuids().isEmpty() && !isSpuriousForkEvent(event, checkpoint.removedFlowFiles)) { for (final String childUuid : event.getChildUuids()) { addEventType(eventTypesPerFlowFileId, childUuid, event.getEventType());
writeUUIDs(out, record.getChildUuids()); } else if (recordType == ProvenanceEventType.RECEIVE) { writeNullableString(out, record.getTransitUri(), "TransitUri");
for (final String uuid : record.getChildUuids()) { if (!uuid.equals(record.getFlowFileUuid())) { addField(doc, SearchableFields.FlowFileUUID, uuid);
addField(builder, factory, "childIds", event.getChildUuids()); addField(builder, "transitUri", event.getTransitUri()); addField(builder, "remoteIdentifier", event.getSourceSystemFlowFileIdentifier());
final List<String> childUuids = new ArrayList<>(event.getChildUuids()); childUuids.sort(Collator.getInstance(Locale.US)); dto.setChildUuids(childUuids);
return event.getAlternateIdentifierUri(); case EventFieldNames.CHILD_UUIDS: return event.getChildUuids(); case EventFieldNames.COMPONENT_ID: return createLookupValue(event.getComponentId(), componentIdMap);
return event.getAlternateIdentifierUri(); case EventFieldNames.CHILD_UUIDS: return event.getChildUuids(); case EventFieldNames.COMPONENT_ID: return event.getComponentId();
uuid = event.getFlowFileUuid(); parentUuids = event.getParentUuids(); childrenUuids = event.getChildUuids(); alternateIdentifierUri = event.getAlternateIdentifierUri(); eventDuration = event.getEventDuration();
@Override public List<String> getChildUuids() { return record.getChildUuids(); }