示例#1
0
// Contains verifies the existence of a key in the key value store.
func (r *Range) Contains(args *proto.ContainsRequest, reply *proto.ContainsResponse) {
	val, err := r.engine.Get(args.Key)
	if err != nil {
		reply.SetGoError(err)
		return
	}
	if val != nil {
		reply.Exists = true
	}
}
示例#2
0
文件: range.go 项目: embark/cockroach
// Contains verifies the existence of a key in the key value store.
func (r *Range) Contains(args *proto.ContainsRequest, reply *proto.ContainsResponse) {
	val, err := r.mvcc.Get(args.Key, args.Timestamp, args.Txn)
	if err != nil {
		reply.SetGoError(err)
		return
	}
	if val != nil {
		reply.Exists = true
	}
}