@Override public ProvenanceEventRecord getProvenanceEvent(long eventId) { try { return provenanceRepository.getEvent(eventId); } catch (IOException e) { logger.error("Failed to get provenance event for {} due to {}", new Object[]{eventId, e}, e); return null; } }
@Override public List<ProvenanceEventRecord> getProvenanceEvents(final long firstEventId, final int maxRecords) throws IOException { return new ArrayList<>(getProvenanceRepository().getEvents(firstEventId, maxRecords)); }
public ComputeLineageResult findParents(long eventId) { final ComputeLineageSubmission submission = provenanceRepository.submitExpandParents(eventId, null); return getLineageResult(eventId, submission); }
/** * Submits the specified lineage request. * * @param lineageDto dto * @return updated lineage */ public LineageDTO submitLineage(LineageDTO lineageDto) { final LineageRequestDTO requestDto = lineageDto.getRequest(); // get the provenance repo final ProvenanceRepository provenanceRepository = flowController.getProvenanceRepository(); final ComputeLineageSubmission result; if (LineageRequestType.FLOWFILE.equals(requestDto.getLineageRequestType())) { if (requestDto.getUuid() != null) { // submit uuid if it is specified result = provenanceRepository.submitLineageComputation(requestDto.getUuid(), NiFiUserUtils.getNiFiUser()); } else { // submit the event if the flowfile uuid needs to be looked up result = provenanceRepository.submitLineageComputation(requestDto.getEventId(), NiFiUserUtils.getNiFiUser()); } } else { // submit event... (parents or children) if (LineageRequestType.PARENTS.equals(requestDto.getLineageRequestType())) { result = provenanceRepository.submitExpandParents(requestDto.getEventId(), NiFiUserUtils.getNiFiUser()); } else { result = provenanceRepository.submitExpandChildren(requestDto.getEventId(), NiFiUserUtils.getNiFiUser()); } } return getLineage(result.getLineageIdentifier()); }
final Set<String> provContainerNames = provenanceRepository.getContainerNames(); final Map<String, StorageUsage> provRepositoryUsage = new LinkedHashMap<>(provContainerNames.size()); for (final String containerName : provContainerNames) { containerFree = provenanceRepository.getContainerUsableSpace(containerName); containerCapacity = provenanceRepository.getContainerCapacity(containerName); } catch (final IOException ioe) { logger.warn("Unable to determine Provenance Repository usage for container {} due to {}", containerName, ioe.toString());
final QuerySubmission querySubmission = provenanceRepository.retrieveQuerySubmission(provenanceId, NiFiUserUtils.getNiFiUser()); final List<ProvenanceEventRecord> firstEvent = provenanceRepository.getEvents(0, 1); if (!firstEvent.isEmpty()) { resultsDto.setOldestEvent(new Date(firstEvent.get(0).getEventTime()));
@Override public ComputeLineageResult queryLineage(long eventId) { final ComputeLineageSubmission submission = provenanceRepository.submitLineageComputation(eventId, null); return getLineageResult(eventId, submission); }
public String getProvenanceRepoFileStoreName(final String containerName) { return provenanceRepository.getContainerFileStoreName(containerName); }
provenanceRepository.close(); } catch (final IOException ioe) { LOG.warn("There was a problem shutting down the Provenance Repository: " + ioe.toString());
@Override public ComputeLineageResult queryLineage(long eventId) { final ComputeLineageSubmission submission = provenanceRepository.submitLineageComputation(eventId, null); return getLineageResult(eventId, submission); }
public ProvenanceEventRecord replayFlowFile(final long provenanceEventRecordId, final NiFiUser user) throws IOException { final ProvenanceEventRecord record = provenanceRepository.getEvent(provenanceEventRecordId, user); if (record == null) { throw new IllegalStateException("Cannot find Provenance Event with ID " + provenanceEventRecordId); } return replayFlowFile(record, user); }
public ComputeLineageResult findParents(long eventId) { final ComputeLineageSubmission submission = provenanceRepository.submitExpandParents(eventId, null); return getLineageResult(eventId, submission); }
/** * Submits a replay request for the specified event id. * * @param eventId event id * @return provenance event */ public ProvenanceEventDTO submitReplay(final Long eventId) { try { final NiFiUser user = NiFiUserUtils.getNiFiUser(); if (user == null) { throw new WebApplicationException(new Throwable("Unable to access details for current user.")); } // lookup the original event final ProvenanceEventRecord originalEvent = flowController.getProvenanceRepository().getEvent(eventId, user); if (originalEvent == null) { throw new ResourceNotFoundException("Unable to find the specified event."); } // authorize the replay authorizeReplay(originalEvent); // replay the flow file final ProvenanceEventRecord event = flowController.replayFlowFile(originalEvent, user); // convert the event record return createProvenanceEventDto(event, false); } catch (final IOException ioe) { throw new NiFiCoreException("An error occurred while getting the specified event.", ioe); } }
/** * Get the provenance event with the specified event id. * * @param eventId event id * @return the provenance event with the specified event id */ public ProvenanceEventDTO getProvenanceEvent(final Long eventId) { try { final ProvenanceEventRecord event = flowController.getProvenanceRepository().getEvent(eventId, NiFiUserUtils.getNiFiUser()); if (event == null) { throw new ResourceNotFoundException("Unable to find the specified event."); } // convert the event return createProvenanceEventDto(event, false); } catch (final IOException ioe) { throw new NiFiCoreException("An error occurred while getting the specified event.", ioe); } }
final ProvenanceEventRecord event = flowController.getProvenanceRepository().getEvent(eventId, user); if (event == null) { throw new ResourceNotFoundException("Unable to find the specified event.");
@Override public ProvenanceEventRecord getProvenanceEvent(long eventId) { try { return provenanceRepository.getEvent(eventId); } catch (IOException e) { logger.error("Failed to get provenance event for {} due to {}", new Object[]{eventId, e}, e); return null; } }