snapshot.go 303 B

123456789101112131415161718
  1. package raft
  2. var emptySnapshot = Snapshot{}
  3. type Snapshot struct {
  4. ClusterId int64
  5. Data []byte
  6. // the configuration
  7. Nodes []int64
  8. // the index at which the snapshot was taken.
  9. Index int64
  10. // the log term of the index
  11. Term int64
  12. }
  13. func (s Snapshot) IsEmpty() bool {
  14. return s.Term == 0
  15. }