public class KVClient extends Object implements AutoCloseable
Constructor and Description |
---|
KVClient(TiConfiguration conf,
RegionStoreClient.RegionStoreClientBuilder clientBuilder,
TiSession session) |
Modifier and Type | Method and Description |
---|---|
List<Kvrpcpb.KvPair> |
batchGet(BackOffer backOffer,
List<com.google.protobuf.ByteString> keys,
long version)
Get a set of key-value pair by keys from TiKV
|
void |
close() |
com.google.protobuf.ByteString |
get(com.google.protobuf.ByteString key,
long version)
Get a key-value pair from TiKV if key exists
|
void |
ingest(List<Pair<com.google.protobuf.ByteString,com.google.protobuf.ByteString>> list) |
List<Kvrpcpb.KvPair> |
scan(com.google.protobuf.ByteString startKey,
com.google.protobuf.ByteString endKey,
long version)
Scan key-value pairs from TiKV in range [startKey, endKey)
|
List<Kvrpcpb.KvPair> |
scan(com.google.protobuf.ByteString startKey,
long version) |
List<Kvrpcpb.KvPair> |
scan(com.google.protobuf.ByteString startKey,
long version,
int limit)
Scan key-value pairs from TiKV in range [startKey, ♾), maximum to `limit` pairs
|
public KVClient(TiConfiguration conf, RegionStoreClient.RegionStoreClientBuilder clientBuilder, TiSession session)
public void close()
close
in interface AutoCloseable
public com.google.protobuf.ByteString get(com.google.protobuf.ByteString key, long version) throws GrpcException
key
- keyGrpcException
public List<Kvrpcpb.KvPair> batchGet(BackOffer backOffer, List<com.google.protobuf.ByteString> keys, long version) throws GrpcException
backOffer
- keys
- version
- GrpcException
public List<Kvrpcpb.KvPair> scan(com.google.protobuf.ByteString startKey, com.google.protobuf.ByteString endKey, long version) throws GrpcException
startKey
- start key, inclusiveendKey
- end key, exclusiveGrpcException
public List<Kvrpcpb.KvPair> scan(com.google.protobuf.ByteString startKey, long version, int limit) throws GrpcException
startKey
- start key, inclusivelimit
- limit of kv pairsGrpcException
public List<Kvrpcpb.KvPair> scan(com.google.protobuf.ByteString startKey, long version) throws GrpcException
GrpcException
public void ingest(List<Pair<com.google.protobuf.ByteString,com.google.protobuf.ByteString>> list) throws GrpcException
GrpcException
Copyright © 2024 PingCAP. All rights reserved.