public interface EventStore
extends java.io.Closeable
An Event Store is responsible for storing Provenance Events and retrieving them at a later time.
Modifier and Type | Method and Description |
---|---|
StorageResult |
addEvents(java.lang.Iterable<ProvenanceEventRecord> events)
Adds the given events to the store.
|
java.util.Optional<ProvenanceEventRecord> |
getEvent(long id)
Retrieves the event with the given ID
|
java.util.List<ProvenanceEventRecord> |
getEvents(java.util.List<java.lang.Long> eventIds,
EventAuthorizer authorizer,
EventTransformer unauthorizedTransformer)
Given a List of Event ID's, returns a List of Provenance Events that contain the events that have those corresponding
Event ID's.
|
java.util.List<ProvenanceEventRecord> |
getEvents(long firstRecordId,
int maxRecords)
Retrieves up to maxRecords events from the store, starting with the event whose ID is equal to firstRecordId.
|
java.util.List<ProvenanceEventRecord> |
getEvents(long firstRecordId,
int maxRecords,
EventAuthorizer authorizer,
EventTransformer unauthorizedTransformer)
Retrieves up to maxRecords events from the store, starting with the event whose ID is equal to firstRecordId.
|
long |
getMaxEventId() |
long |
getSize() |
void |
initialize()
Performs any initialization routines that need to happen before the store is used
|
void |
reindexLatestEvents(EventIndex eventIndex)
Causes the latest events in this store to be re-indexed by the given Event Index
|
void initialize() throws java.io.IOException
java.io.IOException
- if unable to perform initializationStorageResult addEvents(java.lang.Iterable<ProvenanceEventRecord> events) throws java.io.IOException
StorageSummary
objects that are provided when calling the StorageResult.getStorageLocations()
method will return the same value for the StorageSummary.getStorageLocation()
. Each one, however, will
have a different Event ID and potentially a different Block Index.events
- the events to addjava.io.IOException
- if unable to add the eventslong getSize() throws java.io.IOException
java.io.IOException
- if unable to determine the size of the storelong getMaxEventId()
java.util.Optional<ProvenanceEventRecord> getEvent(long id) throws java.io.IOException
id
- the ID of the event to retrievejava.io.IOException
- if unable to read the event from storagejava.util.List<ProvenanceEventRecord> getEvents(long firstRecordId, int maxRecords) throws java.io.IOException
firstRecordId
- the ID of the first event to retrievemaxRecords
- the maximum number of records to retrieve. The actual number of results returned may be less than this.java.io.IOException
- if unable to retrieve records from the storejava.util.List<ProvenanceEventRecord> getEvents(long firstRecordId, int maxRecords, EventAuthorizer authorizer, EventTransformer unauthorizedTransformer) throws java.io.IOException
firstRecordId
- the ID of the first event to retrievemaxRecords
- the maximum number of records to retrieve. The actual number of results returned may be less than this.authorizer
- the authorizer that should be used to filter out any events that the user doesn't have access tounauthorizedTransformer
- the transformer to apply to unauthorized eventsjava.io.IOException
- if unable to retrieve records from the storejava.util.List<ProvenanceEventRecord> getEvents(java.util.List<java.lang.Long> eventIds, EventAuthorizer authorizer, EventTransformer unauthorizedTransformer) throws java.io.IOException
eventIds
- a Stream of Event ID'sauthorizer
- the authorizer that should be used to filter out any events that the user doesn't have access tounauthorizedTransformer
- the transformer to apply to unauthorized eventsjava.io.IOException
- if unable to retrieve records from the storevoid reindexLatestEvents(EventIndex eventIndex)
eventIndex
- the EventIndex to use for indexing events