Raft fixes, integrate logging.

This commit is contained in:
Ben Johnson
2013-12-27 15:35:42 -07:00
parent 44af8ea190
commit a9e20aecc6
10 changed files with 30 additions and 30 deletions

View File

@ -27,8 +27,8 @@ func (c *CompareAndSwapCommand) CommandName() string {
}
// Set the key-value pair if the current value of the key equals to the given prevValue
func (c *CompareAndSwapCommand) Apply(server raft.Server) (interface{}, error) {
s, _ := server.StateMachine().(store.Store)
func (c *CompareAndSwapCommand) Apply(context raft.Context) (interface{}, error) {
s, _ := context.Server().StateMachine().(store.Store)
e, err := s.CompareAndSwap(c.Key, c.PrevValue, c.PrevIndex, c.Value, c.ExpireTime)