Browse Source

Merge pull request #7307 from heyitsanthony/proxy-countonly

grpcproxy: support CountOnly
Anthony Romano 8 years ago
parent
commit
e52a985a3a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      proxy/grpcproxy/kv.go

+ 3 - 0
proxy/grpcproxy/kv.go

@@ -190,6 +190,9 @@ func RangeRequestToOp(r *pb.RangeRequest) clientv3.Op {
 	opts = append(opts, clientv3.WithMinCreateRev(r.MinCreateRevision))
 	opts = append(opts, clientv3.WithMinCreateRev(r.MinCreateRevision))
 	opts = append(opts, clientv3.WithMaxModRev(r.MaxModRevision))
 	opts = append(opts, clientv3.WithMaxModRev(r.MaxModRevision))
 	opts = append(opts, clientv3.WithMinModRev(r.MinModRevision))
 	opts = append(opts, clientv3.WithMinModRev(r.MinModRevision))
+	if r.CountOnly {
+		opts = append(opts, clientv3.WithCountOnly())
+	}
 
 
 	if r.Serializable {
 	if r.Serializable {
 		opts = append(opts, clientv3.WithSerializable())
 		opts = append(opts, clientv3.WithSerializable())