I
- the type of stream projection IDs@SPI public abstract class ProjectionStorage<I> extends RecordStorage<I>
Projection
s
and the timestamp of the last event processed by the projection repository.
This timestamp is used for 'catch-up' operation of the projection repositories.
Modifier | Constructor and Description |
---|---|
protected |
ProjectionStorage(java.lang.Class<? extends Projection<?,?,?>> projectionClass,
boolean multitenant) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Iterator<io.spine.server.entity.EntityRecord> |
readAllRecords(EntityQuery<I> query,
io.spine.client.ResponseFormat format)
Obtains an iterator for reading records matching the query,
and applying the passed field mask to the results.
|
protected java.util.Optional<io.spine.server.entity.EntityRecord> |
readRecord(I id)
Reads a record from the storage by the passed ID.
|
protected abstract RecordStorage<I> |
recordStorage()
Returns an entity storage implementation.
|
protected void |
writeRecord(I id,
EntityRecordWithColumns record)
Writes a record and the associated column
values into the storage.
|
protected void |
writeRecords(java.util.Map<I,EntityRecordWithColumns> records)
Writes a bulk of records into the storage.
|
columnList, delete, read, read, readAll, readAll, readAll, readAllRecords, readLifecycleFlags, readMultiple, readMultipleRecords, write, write, write, writeLifecycleFlags
checkNotClosed, checkNotClosed, close, isClosed, isMultitenant, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, index, isMultitenant, isOpen
protected ProjectionStorage(java.lang.Class<? extends Projection<?,?,?>> projectionClass, boolean multitenant)
protected java.util.Optional<io.spine.server.entity.EntityRecord> readRecord(I id)
RecordStorage
readRecord
in class RecordStorage<I>
id
- the ID of the record to loadnull
if there is no record with this IDprotected void writeRecord(I id, EntityRecordWithColumns record)
RecordStorage
Rewrites it if a record with this ID already exists in the storage.
writeRecord
in class RecordStorage<I>
id
- an ID of the recordrecord
- a record to storeprotected void writeRecords(java.util.Map<I,EntityRecordWithColumns> records)
RecordStorage
Rewrites it if a record with this ID already exists in the storage.
writeRecords
in class RecordStorage<I>
records
- an ID to record map with the entries to storeprotected java.util.Iterator<io.spine.server.entity.EntityRecord> readAllRecords(EntityQuery<I> query, io.spine.client.ResponseFormat format)
RecordStorage
Returns only active entities if the query does not specify the lifecycle flags. In order to read inactive entities, the corresponding filters must be set
to the provided query
.
readAllRecords
in class RecordStorage<I>
RecordStorage.readAll(EntityQuery, ResponseFormat)
protected abstract RecordStorage<I> recordStorage()