Documentation ¶
Index ¶
- func Checkpoints() chan *pb.StableCheckpoint
- func CommitCheckpoint(c *pb.StableCheckpoint)
- func CommitEntry(entry *Entry)
- func Entries() chan *Entry
- func EntriesOutOfOrder() chan *Entry
- func GetCheckpoint() *pb.StableCheckpoint
- func Missing(until int32) []int32
- func WaitForEntry(sn int32)
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Checkpoints ¶
func Checkpoints() chan *pb.StableCheckpoint
Creates and returns a new channel to which all the new stable checkpoints will be pushed. It is possible that a chackpoint will be pushed to this channel without all the entries of that checkpoint being committed. This might happen if other peers are faster at producing a checkpoint than this peer is at committing entries. If the caller needs the entries to be committed, it can always call log.WaitForEntry(checkpoint.Sn) using the returned checkpoint.
func CommitCheckpoint ¶
func CommitCheckpoint(c *pb.StableCheckpoint)
If c has a higher sequence number than the most recent stable checkpoint committed so far, CommitCheckpoint() replaces the most recent stable checkpoint by c and notifies all subscribers, if any.
func CommitEntry ¶
func CommitEntry(entry *Entry)
CommitEntry a decided value to the log. This is the final decision that will never be reverted. If this is the first empty slot of the log, push the Entry (and potentially other previously committed entries with higher sequence numbers) to the subscribers.
func Entries ¶
func Entries() chan *Entry
Creates and returns a new channel to which all the new log entries will be pushed in order.
func EntriesOutOfOrder ¶
func EntriesOutOfOrder() chan *Entry
Creates and returns a new channel to which all the new log entries will be pushed as they are committed, out of order (regardless of potential "holes" in the log).
func GetCheckpoint ¶
func GetCheckpoint() *pb.StableCheckpoint
Returns the latest stable checkpoint, or nil when there is no stable checkpoint.
func WaitForEntry ¶
func WaitForEntry(sn int32)
Blocks until entry with sequence number sn and all previous entries are committed. TODO: Do we really want to wait until all previous entries are committed too?
This can unnecessarily delay a segment just because there is a hole somewhere in the past. (Move the notification to CommitEntry instead of PublishEntries?, If yes, watch out for the lock!) Added after changes to the SimpleCheckpointer: SimpleCheckpointer relies on the absence of holes guaranteed by WaitForEntry. The Manager relies on the absence of holes for consistent watermark advancement.