ProjectionStorage

public abstract class ProjectionStorage<I> extends RecordStorage<I>

The storage used by projection repositories for keeping Projections and the timestamp of the last event processed by the projection repository.

This timestamp is used for 'catch-up' operation of the projection repositories.

Parameters

<I>

the type of stream projection IDs

Inheritors

Constructors

Link copied to clipboard
protected void ProjectionStorage(Class<? extends Projection<? extends Object, ? extends Object, ? extends Object>> projectionClass, boolean multitenant)

Functions

Link copied to clipboard
public Columns columns()
Returns the columns of the managed Entity.
Link copied to clipboard
protected Iterator<EntityRecord> readAllRecords(EntityQuery<I> query, ResponseFormat format)
Obtains an iterator for reading records matching the query, and applying the passed field mask to the results.
Link copied to clipboard
protected Optional<EntityRecord> readRecord(I id)
Reads a record from the storage by the passed ID.
Link copied to clipboard
protected abstract RecordStorage<I> recordStorage()
Returns an entity storage implementation.
Link copied to clipboard
protected void writeRecord(I id, EntityRecordWithColumns record)
Writes a record and the associated column values into the storage.
Link copied to clipboard
protected void writeRecords(Map<I, EntityRecordWithColumns> records)
Writes a bulk of records into the storage.

Inherited functions

Link copied to clipboard
protected void checkNotClosed()
protected void checkNotClosed(String message)
Ensures the storage is not closed.
Link copied to clipboard
public void close()
Closes the storage.
public abstract void close()
Link copied to clipboard
protected final ImmutableList<Column> columnList()
Obtains a list of columns of the managed Entity.
Link copied to clipboard
public abstract boolean delete(I id)
Deletes the record with the passed ID.
Link copied to clipboard
public abstract Iterator<I> index()
Returns an iterator over identifiers of records in the storage.
Link copied to clipboard
public boolean isClosed()
Tests whether the storage is closed.
Link copied to clipboard
public boolean isMultitenant()
Verifies whether the storage is multitenant.
Link copied to clipboard
public boolean isOpen()
Tests whether the storage is open.
Link copied to clipboard
public final ImmutableMap<ColumnName, Column> lifecycleColumns()
Returns a Map of columns corresponded to the lifecycle storage fields of the Entity class managed by this storage.
Link copied to clipboard
public Optional<EntityRecord> read(RecordReadRequest<I> request)
Reads a record which matches the specified request.
public Optional<EntityRecord> read(RecordReadRequest<I> request, FieldMask fieldMask)
Reads a record which matches the specified request and applies a FieldMask to it.
public abstract Optional<M> read(R request)
Reads a record from the storage by the specified request.
Link copied to clipboard
public abstract Iterator<R> readAll(ResponseFormat format)
Reads all the active records from the storage.
public Iterator<EntityRecord> readAll(ResponseFormat format)
Reads all active items from the storage and apply FieldMask to each of the results.
public Iterator<EntityRecord> readAll(EntityQuery<I> query)
public Iterator<EntityRecord> readAll(EntityQuery<I> query, ResponseFormat format)
Reads all the records matching the given EntityQuery and applies the given FieldMask to the resulting record states.
Link copied to clipboard
protected abstract Iterator<EntityRecord> readAllRecords(ResponseFormat format)
Obtains an iterator for reading all records.
Link copied to clipboard
public Optional<LifecycleFlags> readLifecycleFlags(I id)
Reads the lifecycle status for the entity with the passed ID.
Link copied to clipboard
public abstract Iterator<R> readMultiple(Iterable<I> ids, FieldMask fieldMask)
Reads the active records with the given IDs from the storage.
public Iterator<EntityRecord> readMultiple(Iterable<I> ids, FieldMask fieldMask)
Reads multiple active items from the storage and applies FieldMask to the results.
Link copied to clipboard
protected abstract Iterator<EntityRecord> readMultipleRecords(Iterable<I> ids, FieldMask fieldMask)
Obtains an iterator for reading multiple records by IDs, and applying the passed field mask to the results.
Link copied to clipboard
public void write(Map<I, EntityRecordWithColumns> records)
Writes a bulk of records into the storage.
public void write(I id, EntityRecord record)
public abstract void write(I id, M record)
Writes a record into the storage.
public void write(I id, EntityRecordWithColumns record)
Writes a record and its columns into the storage.
Link copied to clipboard
public void writeLifecycleFlags(I id, LifecycleFlags flags)
Writes the lifecycle status for the entity with the passed ID.