Documentation ¶
Overview ¶
Package mutations stores mutations by timestamp.
Index ¶
- type LogStatusCols
- type Table
- func (t *Table) AddLogs(ctx context.Context, directoryID string, logIDs ...int64) error
- func (t *Table) HighWatermark(ctx context.Context, directoryID string, logID int64, start water.Mark, ...) (count int32, high water.Mark, err error)
- func (t *Table) ListLogs(ctx context.Context, directoryID string, writable bool) ([]int64, error)
- func (t *Table) ReadLog(ctx context.Context, directoryID string, logID int64, low, high water.Mark, ...) ([]*mutator.LogMessage, error)
- func (t *Table) SendBatch(ctx context.Context, directoryID string, logID int64, batch []*pb.EntryUpdate) (water.Mark, error)
- func (t *Table) SetWritable(ctx context.Context, directoryID string, logID int64, enabled bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogStatusCols ¶
LogStatusCols are the columns in the LogStatus table.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table implements a queue of mutations.
func (*Table) AddLogs ¶
AddLogs adds the logIDs to the list of active logs to send mutations to, and read mutations from. If directoryID and logID already exist, they will be marked as writable.
func (*Table) HighWatermark ¶
func (t *Table) HighWatermark(ctx context.Context, directoryID string, logID int64, start water.Mark, limit int32) (count int32, high water.Mark, err error)
HighWatermark returns the number of items and the highest timestamp (exclusive) up to limit items after start (inclusive). Because batches (items that have the same timestamp) can contain more than one item, count may exceed limit.
func (*Table) ListLogs ¶
ListLogs returns the mutation logIDs assocciated with directoryID. If writable is true, the list is filtered to only contain writable logs. Returns codes.NotFound if the list is empty.
func (*Table) ReadLog ¶
func (t *Table) ReadLog(ctx context.Context, directoryID string, logID int64, low, high water.Mark, limit int32) ([]*mutator.LogMessage, error)
ReadLog reads all mutations between [low, high). If limit is used, ReadLog ensures that complete batches are returned, which could slightly exceed limit.