コード例 #1
0
ファイル: range.go プロジェクト: kuguobing/cockroach
// 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)
}
コード例 #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
}
コード例 #3
0
ファイル: range.go プロジェクト: embark/cockroach
// 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)
}