public class RegionManager extends Object
Modifier and Type | Field and Description |
---|---|
static io.prometheus.client.Histogram |
GET_REGION_BY_KEY_REQUEST_LATENCY |
static io.prometheus.client.Histogram |
SCAN_REGIONS_REQUEST_LATENCY |
Constructor and Description |
---|
RegionManager(TiConfiguration conf,
ReadOnlyPDClient pdClient) |
RegionManager(TiConfiguration conf,
ReadOnlyPDClient pdClient,
ChannelFactory channelFactory) |
RegionManager(TiConfiguration conf,
ReadOnlyPDClient pdClient,
ChannelFactory channelFactory,
int callBackExecutorThreadNum) |
RegionManager(TiConfiguration conf,
ReadOnlyPDClient pdClient,
int callBackExecutorThreadNum) |
Modifier and Type | Method and Description |
---|---|
void |
addCacheInvalidateCallback(Function<CacheInvalidateEvent,Void> cacheInvalidateCallback) |
void |
clearRegionCache()
Clears all cache when some unexpected error occurs.
|
void |
close() |
TiRegion |
createRegion(Metapb.Region region,
BackOffer backOffer) |
List<Function<CacheInvalidateEvent,Void>> |
getCacheInvalidateCallbackList() |
ExecutorService |
getCallBackThreadPool() |
ReadOnlyPDClient |
getPDClient() |
TiRegion |
getRegionById(long regionId)
Deprecated.
|
TiRegion |
getRegionByKey(com.google.protobuf.ByteString key) |
TiRegion |
getRegionByKey(com.google.protobuf.ByteString key,
BackOffer backOffer) |
Pair<TiRegion,TiStore> |
getRegionStorePairByKey(com.google.protobuf.ByteString key) |
Pair<TiRegion,TiStore> |
getRegionStorePairByKey(com.google.protobuf.ByteString key,
BackOffer backOffer) |
Pair<TiRegion,TiStore> |
getRegionStorePairByKey(com.google.protobuf.ByteString key,
TiStoreType storeType) |
Pair<TiRegion,TiStore> |
getRegionStorePairByKey(com.google.protobuf.ByteString key,
TiStoreType storeType,
BackOffer backOffer) |
TiStore |
getStoreById(long id) |
TiStore |
getStoreById(long id,
BackOffer backOffer) |
void |
insertRegionToCache(TiRegion region) |
void |
invalidateAll() |
void |
invalidateRegion(TiRegion region) |
void |
invalidateStore(long storeId) |
void |
onRegionStale(TiRegion region) |
void |
onRequestFail(TiRegion region)
Clears all cache when a TiKV server does not respond
|
List<Pdpb.Region> |
scanRegions(BackOffer backOffer,
com.google.protobuf.ByteString startKey,
com.google.protobuf.ByteString endKey,
int limit) |
TiRegion |
updateLeader(TiRegion region,
long storeId) |
void |
updateStore(TiStore oldStore,
TiStore newStore) |
public static final io.prometheus.client.Histogram GET_REGION_BY_KEY_REQUEST_LATENCY
public static final io.prometheus.client.Histogram SCAN_REGIONS_REQUEST_LATENCY
public RegionManager(TiConfiguration conf, ReadOnlyPDClient pdClient, ChannelFactory channelFactory)
public RegionManager(TiConfiguration conf, ReadOnlyPDClient pdClient)
public RegionManager(TiConfiguration conf, ReadOnlyPDClient pdClient, int callBackExecutorThreadNum)
public RegionManager(TiConfiguration conf, ReadOnlyPDClient pdClient, ChannelFactory channelFactory, int callBackExecutorThreadNum)
public void close()
public ReadOnlyPDClient getPDClient()
public ExecutorService getCallBackThreadPool()
public List<Function<CacheInvalidateEvent,Void>> getCacheInvalidateCallbackList()
public void addCacheInvalidateCallback(Function<CacheInvalidateEvent,Void> cacheInvalidateCallback)
public void invalidateAll()
public List<Pdpb.Region> scanRegions(BackOffer backOffer, com.google.protobuf.ByteString startKey, com.google.protobuf.ByteString endKey, int limit)
public TiRegion getRegionByKey(com.google.protobuf.ByteString key)
public TiRegion getRegionByKey(com.google.protobuf.ByteString key, BackOffer backOffer)
@Deprecated public TiRegion getRegionById(long regionId)
public Pair<TiRegion,TiStore> getRegionStorePairByKey(com.google.protobuf.ByteString key, BackOffer backOffer)
public Pair<TiRegion,TiStore> getRegionStorePairByKey(com.google.protobuf.ByteString key)
public Pair<TiRegion,TiStore> getRegionStorePairByKey(com.google.protobuf.ByteString key, TiStoreType storeType)
public Pair<TiRegion,TiStore> getRegionStorePairByKey(com.google.protobuf.ByteString key, TiStoreType storeType, BackOffer backOffer)
public TiRegion createRegion(Metapb.Region region, BackOffer backOffer)
public TiStore getStoreById(long id)
public void onRegionStale(TiRegion region)
public void clearRegionCache()
public void onRequestFail(TiRegion region)
region
- regionpublic void invalidateStore(long storeId)
public void invalidateRegion(TiRegion region)
public void insertRegionToCache(TiRegion region)
Copyright © 2024 PingCAP. All rights reserved.