Ejemplo n.º 1
0
// Get returns the value for a specified key.
func (r *Range) Get(args *proto.GetRequest, reply *proto.GetResponse) {
	val, err := r.engine.Get(args.Key)
	reply.Value = proto.Value{Bytes: val}
	reply.SetGoError(err)
}
Ejemplo n.º 2
0
// Get returns the value for a specified key.
func (r *Range) Get(batch engine.Engine, args *proto.GetRequest, reply *proto.GetResponse) []proto.Intent {
	val, intents, err := engine.MVCCGet(batch, args.Key, args.Timestamp, args.ReadConsistency == proto.CONSISTENT, args.Txn)
	reply.Value = val
	reply.SetGoError(err)
	return intents
}
Ejemplo n.º 3
0
// Get returns the value for a specified key.
func (r *Range) Get(args *proto.GetRequest, reply *proto.GetResponse) {
	val, err := r.mvcc.Get(args.Key, args.Timestamp, args.Txn)
	reply.Value = val
	reply.SetGoError(err)
}