Documentation
¶
Overview ¶
Package mutationstorage defines operations to write and read mutations to and from the database.
Index ¶
- type Mutations
- func (m *Mutations) AddLogs(ctx context.Context, directoryID string, logIDs ...int64) error
- func (m *Mutations) HighWatermark(ctx context.Context, directoryID string, logID, start int64, batchSize int32) (int32, int64, error)
- func (m *Mutations) HighestRev(ctx context.Context, directoryID string) (int64, error)
- func (m *Mutations) ListLogs(ctx context.Context, directoryID string, writable bool) ([]int64, error)
- func (m *Mutations) ReadBatch(ctx context.Context, domainID string, rev int64) (*spb.MapMetadata, error)
- func (m *Mutations) ReadLog(ctx context.Context, directoryID string, logID, low, high int64, ...) ([]*mutator.LogMessage, error)
- func (m *Mutations) Send(ctx context.Context, directoryID string, updates ...*pb.EntryUpdate) error
- func (m *Mutations) WriteBatchSources(ctx context.Context, dirID string, rev int64, sources *spb.MapMetadata) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mutations ¶
type Mutations struct {
// contains filtered or unexported fields
}
Mutations implements mutator.MutationStorage and mutator.MutationQueue.
func (*Mutations) HighWatermark ¶
func (m *Mutations) HighWatermark(ctx context.Context, directoryID string, logID, start int64, batchSize int32) (int32, int64, error)
HighWatermark returns the highest watermark +1 in logID that is less than or equal to batchSize items greater than start.
func (*Mutations) HighestRev ¶
HighestRev returns the highest defined revision number for directoryID.
func (*Mutations) ListLogs ¶
func (m *Mutations) ListLogs(ctx context.Context, directoryID string, writable bool) ([]int64, error)
ListLogs returns a list of all logs for directoryID, optionally filtered for writable logs.
func (*Mutations) ReadBatch ¶
func (m *Mutations) ReadBatch(ctx context.Context, domainID string, rev int64) (*spb.MapMetadata, error)
ReadBatch returns the batch definitions for a given revision.
func (*Mutations) ReadLog ¶
func (m *Mutations) ReadLog(ctx context.Context, directoryID string, logID, low, high int64, batchSize int32) ([]*mutator.LogMessage, error)
ReadLog reads all mutations in logID between [low, high). ReadLog may return more rows than batchSize in order to fetch all the rows at a particular timestamp.
func (*Mutations) Send ¶
Send writes mutations to the leading edge (by sequence number) of the mutations table. TODO(gbelvin): Make updates a slice.
func (*Mutations) WriteBatchSources ¶
func (m *Mutations) WriteBatchSources(ctx context.Context, dirID string, rev int64, sources *spb.MapMetadata) error
WriteBatchSources saves the mutations in the database. If revision has already been defined, this will fail.