Package org.apache.nifi.provenance
Interface ProvenanceEventRepository
public interface ProvenanceEventRepository
This Repository houses Provenance Events. The repository is responsible for
managing the life-cycle of the events, providing access to the events that it
has stored, and providing query capabilities against the events.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the repository, freeing any resourcesReturns aProvenanceEventBuilder
that is capable of buildingProvenanceEventRecord
sgetEvent
(long id) Retrieves the Provenance Event with the given ID.getEvents
(long firstRecordId, int maxRecords) Returns a List of allProvenanceEventRecord
s in the repository starting with the given ID.void
Adds the given event to the repository and returns a new event for which the event id has been populated.void
registerEvents
(Iterable<ProvenanceEventRecord> events) Adds the given events to the repository.
-
Method Details
-
eventBuilder
ProvenanceEventBuilder eventBuilder()Returns aProvenanceEventBuilder
that is capable of buildingProvenanceEventRecord
s- Returns:
- builder
-
registerEvent
Adds the given event to the repository and returns a new event for which the event id has been populated. Depending on the implementation, the returned event may or may not be the same event given- Parameters:
event
- to register
-
registerEvents
Adds the given events to the repository.This interface makes no assumptions about whether or not the registration of the Collection are atomic. This detail is implementation-specific.
- Parameters:
events
- to register
-
getEvents
Returns a List of allProvenanceEventRecord
s in the repository starting with the given ID. The first ID in the repository will always be 0 or higher. This method performs no authorization of the events.- Parameters:
firstRecordId
- id of the first record to retrievemaxRecords
- maximum number of records to retrieve- Returns:
- records
- Throws:
IOException
- if error reading from repository
-
getMaxEventId
Long getMaxEventId()- Returns:
- the largest ID of any event that is queryable in the repository. If no queryable events exists, returns null
-
getEvent
Retrieves the Provenance Event with the given ID.- Parameters:
id
- to lookup- Returns:
- the Provenance Event Record with the given ID, if it exists, or
null
otherwise - Throws:
IOException
- if failure while retrieving event
-
close
Closes the repository, freeing any resources- Throws:
IOException
- if failure closing repository
-