public class RegionStoreClient extends AbstractRegionStoreClient
Modifier and Type | Class and Description |
---|---|
static class |
RegionStoreClient.RegionStoreClientBuilder |
static class |
RegionStoreClient.RequestTypes |
Modifier and Type | Field and Description |
---|---|
static io.prometheus.client.Histogram |
GRPC_RAW_REQUEST_LATENCY |
AbstractLockResolverClient |
lockResolverClient |
codec, region, regionManager, SEEK_LEADER_STORE_DURATION, SEEK_PROXY_STORE_DURATION, store
asyncStub, blockingStub, channelFactory, conf, timeout
Modifier and Type | Method and Description |
---|---|
boolean |
addResolvedLocks(Long version,
Set<Long> locks) |
List<Kvrpcpb.KvPair> |
batchGet(BackOffer backOffer,
List<com.google.protobuf.ByteString> keys,
long version) |
void |
commit(BackOffer backOffer,
Iterable<com.google.protobuf.ByteString> keys,
long startTs,
long commitTs)
Commit batch keys
|
List<RangeSplitter.RegionTask> |
coprocess(BackOffer backOffer,
DAGRequest req,
List<Coprocessor.KeyRange> ranges,
Queue<SelectResponse> responseQueue,
long startTs)
Execute and retrieve the response from TiKV server.
|
Iterator<SelectResponse> |
coprocessStreaming(DAGRequest req,
List<Coprocessor.KeyRange> ranges,
long startTs) |
com.google.protobuf.ByteString |
get(BackOffer backOffer,
com.google.protobuf.ByteString key,
long version)
Fetch a value according to a key
|
Set<Long> |
getResolvedLocks(Long version) |
void |
prewrite(BackOffer backOffer,
com.google.protobuf.ByteString primary,
List<Kvrpcpb.Mutation> mutations,
long startTs,
long lockTTL)
Prewrite batch keys
|
void |
prewrite(BackOffer bo,
com.google.protobuf.ByteString primaryLock,
List<Kvrpcpb.Mutation> mutations,
long startTs,
long ttl,
boolean skipConstraintCheck)
Prewrite batch keys
|
void |
rawBatchDelete(BackOffer backoffer,
List<com.google.protobuf.ByteString> keys,
boolean atomicForCAS) |
List<Kvrpcpb.KvPair> |
rawBatchGet(BackOffer backoffer,
List<com.google.protobuf.ByteString> keys) |
void |
rawBatchPut(BackOffer backOffer,
Batch batch,
long ttl,
boolean atomicForCAS) |
void |
rawBatchPut(BackOffer backOffer,
List<Kvrpcpb.KvPair> kvPairs,
long ttl,
boolean atomicForCAS) |
void |
rawCompareAndSet(BackOffer backOffer,
com.google.protobuf.ByteString key,
Optional<com.google.protobuf.ByteString> prevValue,
com.google.protobuf.ByteString value,
long ttl) |
void |
rawDelete(BackOffer backOffer,
com.google.protobuf.ByteString key,
boolean atomicForCAS) |
void |
rawDeleteRange(BackOffer backOffer,
com.google.protobuf.ByteString startKey,
com.google.protobuf.ByteString endKey)
Delete raw keys in the range of [startKey, endKey)
|
Optional<com.google.protobuf.ByteString> |
rawGet(BackOffer backOffer,
com.google.protobuf.ByteString key) |
Optional<Long> |
rawGetKeyTTL(BackOffer backOffer,
com.google.protobuf.ByteString key) |
void |
rawPut(BackOffer backOffer,
com.google.protobuf.ByteString key,
com.google.protobuf.ByteString value,
long ttl,
boolean atomicForCAS) |
List<Kvrpcpb.KvPair> |
rawScan(BackOffer backOffer,
com.google.protobuf.ByteString key,
boolean keyOnly) |
List<Kvrpcpb.KvPair> |
rawScan(BackOffer backOffer,
com.google.protobuf.ByteString key,
int limit,
boolean keyOnly)
Return a batch KvPair list containing limited key-value pairs starting from `key`, which are in
the same region
|
List<Kvrpcpb.KvPair> |
scan(BackOffer backOffer,
com.google.protobuf.ByteString startKey,
long version) |
List<Kvrpcpb.KvPair> |
scan(BackOffer backOffer,
com.google.protobuf.ByteString startKey,
long version,
boolean keyOnly) |
List<Metapb.Region> |
splitRegion(List<com.google.protobuf.ByteString> splitKeys)
Send SplitRegion request to tikv split a region at splitKey.
|
void |
txnHeartBeat(BackOffer bo,
com.google.protobuf.ByteString primaryLock,
long startTs,
long ttl)
TXN Heart Beat: update primary key ttl
|
close, getAsyncStub, getBlockingStub, getRegion, makeContext, makeContext, makeContext, makeContext, onNotLeader, onStoreUnreachable
callAsyncWithRetry, callServerStreamingWithRetry, callWithRetry, checkHealth, getConf, getTimeout, setTimeout
public final AbstractLockResolverClient lockResolverClient
public static final io.prometheus.client.Histogram GRPC_RAW_REQUEST_LATENCY
public com.google.protobuf.ByteString get(BackOffer backOffer, com.google.protobuf.ByteString key, long version) throws TiClientInternalException, KeyException
backOffer
- backOfferkey
- key to fetchversion
- key versionTiClientInternalException
- TiSpark Client exception, unexpectedKeyException
- Key may be lockedpublic List<Kvrpcpb.KvPair> batchGet(BackOffer backOffer, List<com.google.protobuf.ByteString> keys, long version)
public List<Kvrpcpb.KvPair> scan(BackOffer backOffer, com.google.protobuf.ByteString startKey, long version, boolean keyOnly)
public List<Kvrpcpb.KvPair> scan(BackOffer backOffer, com.google.protobuf.ByteString startKey, long version)
public void prewrite(BackOffer backOffer, com.google.protobuf.ByteString primary, List<Kvrpcpb.Mutation> mutations, long startTs, long lockTTL) throws TiClientInternalException, KeyException, RegionException
backOffer
- backOfferprimary
- primary lock of keysmutations
- batch key-values as mutationsstartTs
- startTs of prewritelockTTL
- lock ttlTiClientInternalException
- TiSpark Client exception, unexpectedKeyException
- Key may be lockedRegionException
- region error occurspublic void prewrite(BackOffer bo, com.google.protobuf.ByteString primaryLock, List<Kvrpcpb.Mutation> mutations, long startTs, long ttl, boolean skipConstraintCheck) throws TiClientInternalException, KeyException, RegionException
skipConstraintCheck
- whether to skip constraint checkTiClientInternalException
KeyException
RegionException
public void txnHeartBeat(BackOffer bo, com.google.protobuf.ByteString primaryLock, long startTs, long ttl)
public void commit(BackOffer backOffer, Iterable<com.google.protobuf.ByteString> keys, long startTs, long commitTs) throws KeyException
backOffer
- backOfferkeys
- keys to commitstartTs
- start versioncommitTs
- commit versionKeyException
public List<RangeSplitter.RegionTask> coprocess(BackOffer backOffer, DAGRequest req, List<Coprocessor.KeyRange> ranges, Queue<SelectResponse> responseQueue, long startTs)
req
- Select request to processranges
- Key range listpublic Iterator<SelectResponse> coprocessStreaming(DAGRequest req, List<Coprocessor.KeyRange> ranges, long startTs)
public List<Metapb.Region> splitRegion(List<com.google.protobuf.ByteString> splitKeys)
splitKeys
- is the split points for a specific region.public Optional<com.google.protobuf.ByteString> rawGet(BackOffer backOffer, com.google.protobuf.ByteString key)
public Optional<Long> rawGetKeyTTL(BackOffer backOffer, com.google.protobuf.ByteString key)
public void rawDelete(BackOffer backOffer, com.google.protobuf.ByteString key, boolean atomicForCAS)
public void rawPut(BackOffer backOffer, com.google.protobuf.ByteString key, com.google.protobuf.ByteString value, long ttl, boolean atomicForCAS)
public void rawCompareAndSet(BackOffer backOffer, com.google.protobuf.ByteString key, Optional<com.google.protobuf.ByteString> prevValue, com.google.protobuf.ByteString value, long ttl) throws RawCASConflictException
RawCASConflictException
public List<Kvrpcpb.KvPair> rawBatchGet(BackOffer backoffer, List<com.google.protobuf.ByteString> keys)
public void rawBatchPut(BackOffer backOffer, List<Kvrpcpb.KvPair> kvPairs, long ttl, boolean atomicForCAS)
public void rawBatchPut(BackOffer backOffer, Batch batch, long ttl, boolean atomicForCAS)
public void rawBatchDelete(BackOffer backoffer, List<com.google.protobuf.ByteString> keys, boolean atomicForCAS)
public List<Kvrpcpb.KvPair> rawScan(BackOffer backOffer, com.google.protobuf.ByteString key, int limit, boolean keyOnly)
backOffer
- BackOfferkey
- startKeykeyOnly
- true if value of KvPair is not neededpublic List<Kvrpcpb.KvPair> rawScan(BackOffer backOffer, com.google.protobuf.ByteString key, boolean keyOnly)
public void rawDeleteRange(BackOffer backOffer, com.google.protobuf.ByteString startKey, com.google.protobuf.ByteString endKey)
backOffer
- BackOfferstartKey
- startKeyendKey
- endKeyCopyright © 2024 PingCAP. All rights reserved.