client-java
client-java copied to clipboard
Consider to rewrite regioncache to reduce the cache number.
Feature Request
Is your feature request related to a problem? Please describe:
Describe the feature you'd like:
Now, RegionCache needs three Maps to store the cache. it is easily cause error because of the inconsistency of the cache.
public class RegionCache {
private final Map<Long, TiRegion> regionCache;
private final Map<Long, TiStore> storeCache;
private final RangeMap<Key, Long> keyToRegionIdCache;
}
I suggest using two caches.
public class RegionCache {
private final Map<Long, TiStore> storeCache;
private final RangeMap<Key, TiRegion> regionCache;
}
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy: