@Override public void registerEvent(final ProvenanceEventRecord event) { final StandardProvenanceEventRecord newRecord; if (event instanceof StandardProvenanceEventRecord) { newRecord = (StandardProvenanceEventRecord) event; } else { newRecord = new StandardProvenanceEventRecord.Builder().fromEvent(event).build(); } newRecord.setEventId(idGenerator.getAndIncrement()); records.add(newRecord); }
private StandardProvenanceEventRecord truncateAttributes(final StandardProvenanceEventRecord original) { boolean requireTruncation = false; for (final String updatedAttr : original.getUpdatedAttributes().values()) { if (updatedAttr != null && updatedAttr.length() > maxAttributeChars) { requireTruncation = true; break; } } if (!requireTruncation) { for (final String previousAttr : original.getPreviousAttributes().values()) { if (previousAttr != null && previousAttr.length() > maxAttributeChars) { requireTruncation = true; break; } } } if (!requireTruncation) { return original; } final StandardProvenanceEventRecord.Builder builder = new StandardProvenanceEventRecord.Builder().fromEvent(original); builder.setAttributes(truncateAttributes(original.getPreviousAttributes()), truncateAttributes(original.getUpdatedAttributes())); final StandardProvenanceEventRecord truncated = builder.build(); truncated.setEventId(original.getEventId()); return truncated; }
private StandardProvenanceEventRecord enrich( final ProvenanceEventRecord rawEvent, final Map<String, FlowFileRecord> flowFileRecordMap, final Map<Long, StandardRepositoryRecord> records, final boolean updateAttributes, final long commitNanos) { final StandardProvenanceEventRecord.Builder recordBuilder = new StandardProvenanceEventRecord.Builder().fromEvent(rawEvent); final FlowFileRecord eventFlowFile = flowFileRecordMap.get(rawEvent.getFlowFileUuid()); if (eventFlowFile != null) {
private StandardProvenanceEventRecord truncateAttributes(final StandardProvenanceEventRecord original) { boolean requireTruncation = false; for (final String updatedAttr : original.getUpdatedAttributes().values()) { if (updatedAttr != null && updatedAttr.length() > maxAttributeChars) { requireTruncation = true; break; } } if (!requireTruncation) { for (final String previousAttr : original.getPreviousAttributes().values()) { if (previousAttr != null && previousAttr.length() > maxAttributeChars) { requireTruncation = true; break; } } } if (!requireTruncation) { return original; } final StandardProvenanceEventRecord.Builder builder = new StandardProvenanceEventRecord.Builder().fromEvent(original); builder.setAttributes(truncateAttributes(original.getPreviousAttributes()), truncateAttributes(original.getUpdatedAttributes())); final StandardProvenanceEventRecord truncated = builder.build(); truncated.setEventId(original.getEventId()); return truncated; }
public static StandardProvenanceEventRecord copy(StandardProvenanceEventRecord other) { Builder builder = new Builder().fromEvent(other); return new StandardProvenanceEventRecord(builder); }
@Override public void registerEvent(final ProvenanceEventRecord event) { final StandardProvenanceEventRecord newRecord; if (event instanceof StandardProvenanceEventRecord) { newRecord = (StandardProvenanceEventRecord) event; } else { newRecord = new StandardProvenanceEventRecord.Builder().fromEvent(event).build(); } newRecord.setEventId(idGenerator.getAndIncrement()); records.add(newRecord); }
final StandardProvenanceEventRecord.Builder recordBuilder = new StandardProvenanceEventRecord.Builder().fromEvent(rawEvent); if (repoRecord.getCurrent() != null && repoRecord.getCurrentClaim() != null) { final ContentClaim currentClaim = repoRecord.getCurrentClaim();
public static StandardProvenanceEventRecord copy(StandardProvenanceEventRecord other) { Builder builder = new Builder().fromEvent(other); return new StandardProvenanceEventRecord(builder); }