1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.tikv.common.apiversion;
19
20 import com.google.protobuf.ByteString;
21 import java.util.List;
22 import org.tikv.common.util.Pair;
23 import org.tikv.kvproto.Kvrpcpb.KvPair;
24 import org.tikv.kvproto.Kvrpcpb.Mutation;
25 import org.tikv.kvproto.Metapb.Region;
26 import org.tikv.kvproto.Pdpb;
27
28 public class RequestKeyV1Codec implements RequestKeyCodec {
29 @Override
30 public ByteString encodeKey(ByteString key) {
31 return key;
32 }
33
34 @Override
35 public List<ByteString> encodeKeys(List<ByteString> keys) {
36 return keys;
37 }
38
39 @Override
40 public List<Mutation> encodeMutations(List<Mutation> mutations) {
41 return mutations;
42 }
43
44 @Override
45 public ByteString decodeKey(ByteString key) {
46 return key;
47 }
48
49 @Override
50 public KvPair decodeKvPair(KvPair pair) {
51 return pair;
52 }
53
54 @Override
55 public List<KvPair> decodeKvPairs(List<KvPair> pairs) {
56 return pairs;
57 }
58
59 @Override
60 public Pair<ByteString, ByteString> encodeRange(ByteString start, ByteString end) {
61 return Pair.create(start, end);
62 }
63
64 @Override
65 public ByteString encodePdQuery(ByteString key) {
66 return key;
67 }
68
69 @Override
70 public Pair<ByteString, ByteString> encodePdQueryRange(ByteString start, ByteString end) {
71 return Pair.create(start, end);
72 }
73
74 @Override
75 public Region decodeRegion(Region region) {
76 return region;
77 }
78
79 @Override
80 public List<Pdpb.Region> decodePdRegions(List<Pdpb.Region> regions) {
81 return regions;
82 }
83 }