Browse Source

server: p.Get -> p.QuorumGet

Yicheng Qin 11 years ago
parent
commit
a191df10a3
3 changed files with 4 additions and 4 deletions
  1. 1 1
      etcd/v2_apply.go
  2. 1 1
      etcd/v2_http_get.go
  3. 2 2
      etcd/v2_store.go

+ 1 - 1
etcd/v2_apply.go

@@ -49,7 +49,7 @@ func (p *participant) v2apply(index int64, ent raft.Entry) {
 		e, err = p.Store.CompareAndDelete(cmd.Key, cmd.PrevValue, cmd.PrevIndex)
 	case "cas":
 		e, err = p.Store.CompareAndSwap(cmd.Key, cmd.PrevValue, cmd.PrevIndex, cmd.Value, cmd.Time)
-	case "get":
+	case "quorumGet":
 		e, err = p.Store.Get(cmd.Key, cmd.Recursive, cmd.Sorted)
 	case "sync":
 		p.Store.DeleteExpiredKeys(cmd.Time)

+ 1 - 1
etcd/v2_http_get.go

@@ -127,7 +127,7 @@ func (p *participant) handleQuorumGet(key string, recursive, sort bool, w http.R
 	if req.Method == "HEAD" {
 		return fmt.Errorf("not support HEAD")
 	}
-	event, err := p.Get(key, recursive, sort)
+	event, err := p.QuorumGet(key, recursive, sort)
 	if err != nil {
 		return err
 	}

+ 2 - 2
etcd/v2_store.go

@@ -67,8 +67,8 @@ func (p *participant) CAD(key string, prevValue string, prevIndex uint64) (*stor
 	return p.do(cad)
 }
 
-func (p *participant) Get(key string, recursive, sorted bool) (*store.Event, error) {
-	get := &cmd{Type: "get", Key: key, Recursive: recursive, Sorted: sorted}
+func (p *participant) QuorumGet(key string, recursive, sorted bool) (*store.Event, error) {
+	get := &cmd{Type: "quorumGet", Key: key, Recursive: recursive, Sorted: sorted}
 	return p.do(get)
 }