public abstract class AbstractRegionStoreClient extends AbstractGRPCClient<TikvGrpc.TikvBlockingStub,TikvGrpc.TikvFutureStub> implements RegionErrorReceiver
Modifier and Type | Field and Description |
---|---|
protected RequestKeyCodec |
codec |
protected TiRegion |
region |
protected RegionManager |
regionManager |
static io.prometheus.client.Histogram |
SEEK_LEADER_STORE_DURATION |
static io.prometheus.client.Histogram |
SEEK_PROXY_STORE_DURATION |
protected TiStore |
store |
asyncStub, blockingStub, channelFactory, conf, timeout
Modifier | Constructor and Description |
---|---|
protected |
AbstractRegionStoreClient(TiConfiguration conf,
TiRegion region,
TiStore store,
ChannelFactory channelFactory,
TikvGrpc.TikvBlockingStub blockingStub,
TikvGrpc.TikvFutureStub asyncStub,
RegionManager regionManager) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected TikvGrpc.TikvFutureStub |
getAsyncStub() |
protected TikvGrpc.TikvBlockingStub |
getBlockingStub() |
TiRegion |
getRegion() |
protected Kvrpcpb.Context |
makeContext() |
protected Kvrpcpb.Context |
makeContext(Metapb.Peer peer) |
protected Kvrpcpb.Context |
makeContext(Set<Long> resolvedLocks,
TiStoreType storeType,
SlowLog slowLog) |
protected Kvrpcpb.Context |
makeContext(TiStoreType storeType,
SlowLog slowLog) |
boolean |
onNotLeader(TiRegion newRegion,
BackOffer backOffer)
onNotLeader deals with NotLeaderError and returns whether re-splitting key range is needed
|
boolean |
onStoreUnreachable(BackOffer backOffer) |
callAsyncWithRetry, callServerStreamingWithRetry, callWithRetry, checkHealth, getConf, getTimeout, setTimeout
public static final io.prometheus.client.Histogram SEEK_LEADER_STORE_DURATION
public static final io.prometheus.client.Histogram SEEK_PROXY_STORE_DURATION
protected final RegionManager regionManager
protected final RequestKeyCodec codec
protected TiRegion region
protected TiStore store
protected AbstractRegionStoreClient(TiConfiguration conf, TiRegion region, TiStore store, ChannelFactory channelFactory, TikvGrpc.TikvBlockingStub blockingStub, TikvGrpc.TikvFutureStub asyncStub, RegionManager regionManager)
public TiRegion getRegion()
getRegion
in interface RegionErrorReceiver
protected TikvGrpc.TikvBlockingStub getBlockingStub()
getBlockingStub
in class AbstractGRPCClient<TikvGrpc.TikvBlockingStub,TikvGrpc.TikvFutureStub>
protected TikvGrpc.TikvFutureStub getAsyncStub()
getAsyncStub
in class AbstractGRPCClient<TikvGrpc.TikvBlockingStub,TikvGrpc.TikvFutureStub>
public void close() throws GrpcException
close
in interface AutoCloseable
GrpcException
public boolean onNotLeader(TiRegion newRegion, BackOffer backOffer)
onNotLeader
in interface RegionErrorReceiver
newRegion
- the new region presented by NotLeader Errorpublic boolean onStoreUnreachable(BackOffer backOffer)
onStoreUnreachable
in interface RegionErrorReceiver
protected Kvrpcpb.Context makeContext(TiStoreType storeType, SlowLog slowLog)
protected Kvrpcpb.Context makeContext(Set<Long> resolvedLocks, TiStoreType storeType, SlowLog slowLog)
protected Kvrpcpb.Context makeContext()
protected Kvrpcpb.Context makeContext(Metapb.Peer peer)
Copyright © 2024 PingCAP. All rights reserved.