Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider to rewrite regioncache to reduce the cache number. #696

Open
shiyuhang0 opened this issue Dec 26, 2022 · 0 comments
Open

Consider to rewrite regioncache to reduce the cache number. #696

shiyuhang0 opened this issue Dec 26, 2022 · 0 comments
Labels
type/feature-request New feature request

Comments

@shiyuhang0
Copy link
Collaborator

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request New feature request
Projects
None yet
Development

No branches or pull requests

1 participant