Open bubbajoe opened 2 weeks ago
Hi Joe,
I think your first three tasks are pretty reasonable. I've been meaning to improve the documentation for a while now, so I think this is a pretty good opportunity to do so. With that being said, I'm pretty busy this week, so it may take me a bit to get to it.
As for adding snapshot intervals, I'm curious what you had in mind? At present, the StateMachine
interface has the NeedSnapshot
function which should return true
if a snapshot is necessary. This function is passed the size of the log in terms of log entries, which may be used to determine if a snapshot is needed. This function is called every time a log entry is applied to determine whether a snapshot is necessary. With most implementations, I think function should be very cheap to call.
@jmsadair Thanks, and no rush!
And yea, thinking about it now. Snapshot Intervals aren't really needed, your implementation is more flexible.
[ ] Task: Misspelled interface function:
RegsiterInstallSnapshotHandler -> RegisterInstallSnapshotHandler
[ ] Task (optional): Interface name change:
Log -> LogStore
- just a nitpick in namingtype Log = LogStore
- you can use an alias type and add deprecated to the godoc for backwards compatibility.[ ] Task: For the Log interface, can you add more context and information to the godoc on the follow functions and how they are used: Truncate, Compact, Contains, DiscardEntries. DiscardEntries's description is okay, but having more concrete and clear explanations like:
this function is used when a snapshot is taken and earlier logs are no longer needed.