Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyLogs ¶
func CopyLogs(ctx context.Context, dst, src raft.LogStore, batchBytes int, progress chan<- string) error
CopyLogs takes an src and a dst raft.LogStore implementation and copies all entries from src to dst. It assumes dst is empty. Neither LogStore may be in use at the time. batchBytes is the target number of bytes of log data to group into each append for efficiency. If progress is non-nil it will be delivered updates during the copy since it could take a while. Updates will be delivered best-effort with a short wait of 1 millisecond. If the channel blocks for longer updates may be lost. The caller should sufficiently buffer it and ensure it's being drained as fast as needed. If non-nil progress will be closed when the function returns.
func CopyStable ¶
func CopyStable(ctx context.Context, dst, src raft.StableStore, extraKeys, extraIntKeys [][]byte, progress chan<- string) error
CopyStable copies the known hashicorp/raft library used keys from one stable store to another. Since StableStore has no list method there is no general way to copy all possibly stored keys, however this is sufficient for standard uses of `hashicorp/raft` as of the current release since it only every writes these keys to StableStore. If other keys are written by another code path, the caller can provide them in extraKeys and/or extraIntKeys depending on which interface method they were written with - we don't assume all implementations share a key space for Set and SetUint64. Both can be nil for just the standard raft keys to be copied.
Types ¶
This section is empty.