Snapshot returns the current snapshot.
()
| 270 | |
| 271 | // Snapshot returns the current snapshot. |
| 272 | func (n *Node) Snapshot() (raftpb.Snapshot, error) { |
| 273 | if n == nil || n.Store == nil { |
| 274 | return raftpb.Snapshot{}, errors.New("Uninitialized node or raft store") |
| 275 | } |
| 276 | return n.Store.Snapshot() |
| 277 | } |
| 278 | |
| 279 | // SaveToStorage saves the hard state, entries, and snapshot to persistent storage, in that order. |
| 280 | func (n *Node) SaveToStorage(h *raftpb.HardState, es []raftpb.Entry, s *raftpb.Snapshot) { |
no outgoing calls
no test coverage detected