public abstract class PartitionedEventStore extends java.lang.Object implements EventStore
Constructor and Description |
---|
PartitionedEventStore(RepositoryConfiguration config,
EventReporter eventReporter) |
Modifier and Type | Method and Description |
---|---|
StorageResult |
addEvents(java.lang.Iterable<ProvenanceEventRecord> events)
Adds the given events to the store.
|
void |
close() |
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 transformer)
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 transformer)
Retrieves up to maxRecords events from the store, starting with the event whose ID is equal to firstRecordId.
|
long |
getMaxEventId() |
protected abstract java.util.List<? extends EventStorePartition> |
getPartitions() |
long |
getSize() |
void |
initialize()
Performs any initialization routines that need to happen before the store is used
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reindexLatestEvents
public PartitionedEventStore(RepositoryConfiguration config, EventReporter eventReporter)
public void initialize() throws java.io.IOException
EventStore
initialize
in interface EventStore
java.io.IOException
- if unable to perform initializationpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public StorageResult addEvents(java.lang.Iterable<ProvenanceEventRecord> events) throws java.io.IOException
EventStore
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.addEvents
in interface EventStore
events
- the events to addjava.io.IOException
- if unable to add the eventspublic long getSize()
getSize
in interface EventStore
public long getMaxEventId()
getMaxEventId
in interface EventStore
public java.util.Optional<ProvenanceEventRecord> getEvent(long id) throws java.io.IOException
EventStore
getEvent
in interface EventStore
id
- the ID of the event to retrievejava.io.IOException
- if unable to read the event from storagepublic java.util.List<ProvenanceEventRecord> getEvents(long firstRecordId, int maxRecords) throws java.io.IOException
EventStore
getEvents
in interface EventStore
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 storepublic java.util.List<ProvenanceEventRecord> getEvents(long firstRecordId, int maxRecords, EventAuthorizer authorizer, EventTransformer transformer) throws java.io.IOException
EventStore
getEvents
in interface EventStore
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 totransformer
- the transformer to apply to unauthorized eventsjava.io.IOException
- if unable to retrieve records from the storepublic java.util.List<ProvenanceEventRecord> getEvents(java.util.List<java.lang.Long> eventIds, EventAuthorizer authorizer, EventTransformer transformer) throws java.io.IOException
EventStore
getEvents
in interface EventStore
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 totransformer
- the transformer to apply to unauthorized eventsjava.io.IOException
- if unable to retrieve records from the storeprotected abstract java.util.List<? extends EventStorePartition> getPartitions()