Exemplo n.º 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
	}
}
Exemplo n.º 2
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.mvcc.Get(args.Key, args.Timestamp, args.Txn)
	if err != nil {
		reply.SetGoError(err)
		return
	}
	if val != nil {
		reply.Exists = true
	}
}