change imports to coreos/etcd coreos/go-raft; change API to work with new go-raft

This commit is contained in:
Xiang Li
2013-07-08 09:41:04 -07:00
parent 0f22918e2b
commit e2f0420862
6 changed files with 28 additions and 28 deletions

View File

@@ -8,8 +8,8 @@ package main
import (
"encoding/json"
"github.com/xiangli-cmu/go-raft"
"github.com/xiangli-cmu/raft-etcd/store"
"github.com/coreos/etcd/store"
"github.com/coreos/go-raft"
"time"
)
@@ -33,7 +33,7 @@ func (c *SetCommand) CommandName() string {
// Set the value of key to value
func (c *SetCommand) Apply(server *raft.Server) (interface{}, error) {
return store.Set(c.Key, c.Value, c.ExpireTime, server.CommittedIndex())
return store.Set(c.Key, c.Value, c.ExpireTime, server.CommitIndex())
}
// Get the path for http request
@@ -88,7 +88,7 @@ func (c *DeleteCommand) CommandName() string {
// Delete the key
func (c *DeleteCommand) Apply(server *raft.Server) (interface{}, error) {
return store.Delete(c.Key, server.CommittedIndex())
return store.Delete(c.Key, server.CommitIndex())
}
// Watch command