FlyDB
FlyDB copied to clipboard
Rewrite the fsm component of raft
- Apply: Implementing log submission operations for raft clusters
- Snapshot: Implementing snapshot operations for raft clusters
- Restore: Implementing storage operations for raft clusters
// fsm implements raft.FSM interface
type fsm struct {
//implement me
}
func newFSM() raft.FSM {
return &fsm{}
}
func (f fsm) Apply(log *raft.Log) interface{} {
//TODO implement me
panic("implement me")
}
func (f fsm) Snapshot() (raft.FSMSnapshot, error) {
//TODO implement me
panic("implement me")
}
func (f fsm) Restore(snapshot io.ReadCloser) error {
//TODO implement me
panic("implement me")
}
Do we have the structure of the log.Data?
The initial consideration is to record the information of meta components and corresponding operations. Do you have any ideas?