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, timeoutcallAsyncWithRetry, callServerStreamingWithRetry, callWithRetry, checkHealth, getConf, getTimeout, setTimeoutpublic 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 ReadOnlyPDClientpublic TiTimestamp getTimestamp(BackOffer backOffer)
ReadOnlyPDClientgetTimestamp in interface ReadOnlyPDClientpublic 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)
ReadOnlyPDClientgetRegionByKey in interface ReadOnlyPDClientkey - key in bytes for locating a regionpublic Pair<Metapb.Region,Metapb.Peer> getRegionByID(BackOffer backOffer, long id)
ReadOnlyPDClientgetRegionByID in interface ReadOnlyPDClientid - Region Idpublic List<Pdpb.Region> scanRegions(BackOffer backOffer, com.google.protobuf.ByteString startKey, com.google.protobuf.ByteString endKey, int limit)
scanRegions in interface ReadOnlyPDClientpublic Metapb.Store getStore(BackOffer backOffer, long storeId)
ReadOnlyPDClientgetStore in interface ReadOnlyPDClientstoreId - StoreIdpublic List<Metapb.Store> getAllStores(BackOffer backOffer)
getAllStores in interface ReadOnlyPDClientpublic TiConfiguration.ReplicaRead getReplicaRead()
getReplicaRead in interface ReadOnlyPDClientpublic Long updateServiceGCSafePoint(String serviceId, long ttl, long safePoint, BackOffer backOffer)
ReadOnlyPDClientupdateServiceGCSafePoint in interface ReadOnlyPDClientserviceId - 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 AutoCloseableInterruptedExceptionpublic 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 ReadOnlyPDClientpublic RequestKeyCodec getCodec()
getCodec in interface ReadOnlyPDClientCopyright © 2025 PingCAP. All rights reserved.