예제 #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
	}
}