public class PDClient extends AbstractGRPCClient<PDGrpc.PDBlockingStub,PDGrpc.PDFutureStub> implements ReadOnlyPDClient
Modifier and Type | Field and Description |
---|---|
static io.prometheus.client.Histogram |
PD_GET_REGION_BY_KEY_REQUEST_LATENCY |
asyncStub, blockingStub, channelFactory, conf, timeout
callAsyncWithRetry, callServerStreamingWithRetry, callWithRetry, checkHealth, getConf, getTimeout, setTimeout
public static final io.prometheus.client.Histogram PD_GET_REGION_BY_KEY_REQUEST_LATENCY
public static ReadOnlyPDClient create(TiConfiguration conf, RequestKeyCodec codec, ChannelFactory channelFactory)
public HostMapping getHostMapping()
getHostMapping
in interface ReadOnlyPDClient
public TiTimestamp getTimestamp(BackOffer backOffer)
ReadOnlyPDClient
getTimestamp
in interface ReadOnlyPDClient
public void keepPauseChecker(PDChecker checker)
public void stopKeepPauseChecker(PDChecker checker)
public void resumeChecker(PDChecker checker)
public Pair<Metapb.Region,Metapb.Peer> getRegionByKey(BackOffer backOffer, com.google.protobuf.ByteString key)
ReadOnlyPDClient
getRegionByKey
in interface ReadOnlyPDClient
key
- key in bytes for locating a regionpublic Pair<Metapb.Region,Metapb.Peer> getRegionByID(BackOffer backOffer, long id)
ReadOnlyPDClient
getRegionByID
in interface ReadOnlyPDClient
id
- Region Idpublic List<Pdpb.Region> scanRegions(BackOffer backOffer, com.google.protobuf.ByteString startKey, com.google.protobuf.ByteString endKey, int limit)
scanRegions
in interface ReadOnlyPDClient
public Metapb.Store getStore(BackOffer backOffer, long storeId)
ReadOnlyPDClient
getStore
in interface ReadOnlyPDClient
storeId
- StoreIdpublic List<Metapb.Store> getAllStores(BackOffer backOffer)
getAllStores
in interface ReadOnlyPDClient
public TiConfiguration.ReplicaRead getReplicaRead()
getReplicaRead
in interface ReadOnlyPDClient
public Long updateServiceGCSafePoint(String serviceId, long ttl, long safePoint, BackOffer backOffer)
ReadOnlyPDClient
updateServiceGCSafePoint
in interface ReadOnlyPDClient
serviceId
- ServiceIdttl
- TTL in secondssafePoint
- The TiTimestamp you want to set. Set to start_ts.getPrevious() is a good
practicepublic void close() throws InterruptedException
close
in interface AutoCloseable
InterruptedException
public void tryUpdateLeaderOrForwardFollower()
public void tryUpdateLeader()
public void updateTiFlashReplicaStatus()
public double getTiFlashReplicaProgress(long tableId)
protected PDGrpc.PDBlockingStub getBlockingStub()
getBlockingStub
in class AbstractGRPCClient<PDGrpc.PDBlockingStub,PDGrpc.PDFutureStub>
protected PDGrpc.PDFutureStub getAsyncStub()
getAsyncStub
in class AbstractGRPCClient<PDGrpc.PDBlockingStub,PDGrpc.PDFutureStub>
public Long getClusterId()
getClusterId
in interface ReadOnlyPDClient
public RequestKeyCodec getCodec()
getCodec
in interface ReadOnlyPDClient
Copyright © 2024 PingCAP. All rights reserved.