mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
change imports to coreos/etcd coreos/go-raft; change API to work with new go-raft
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user