etcd/raft/snapshot.go

21 lines
447 B
Go
Raw Normal View History

2014-07-01 23:10:43 +04:00
package raft
type Snapshot struct {
Data []byte
// the configuration
2014-07-09 22:53:27 +04:00
Nodes []int64
2014-07-01 23:10:43 +04:00
// the index at which the snapshot was taken.
2014-07-11 09:51:37 +04:00
Index int64
2014-07-01 23:10:43 +04:00
// the log term of the index
2014-07-11 09:51:37 +04:00
Term int64
2014-07-01 23:10:43 +04:00
}
// A snapshoter can make a snapshot of its current state atomically.
// It can restore from a snapshot and get the latest snapshot it took.
type Snapshoter interface {
2014-07-11 09:51:37 +04:00
Snap(index, term int64, nodes []int64)
2014-07-01 23:10:43 +04:00
Restore(snap Snapshot)
GetSnap() Snapshot
}