-
Notifications
You must be signed in to change notification settings - Fork 836
refactor: cache layer #9672
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
Merged
Merged
refactor: cache layer #9672
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
read path & column reader
c5fd071 to
64b0f04
Compare
BohuTANG
reviewed
Jan 19, 2023
move cache key generating logic into it
Member
|
Cool, will review it today later. |
BohuTANG
reviewed
Jan 20, 2023
BohuTANG
reviewed
Jan 20, 2023
BohuTANG
reviewed
Jan 20, 2023
BohuTANG
approved these changes
Jan 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
storages-common-cacheCacheAccessor, which provides the essential cache operationput,get,evictStroageCache, which describes the minimum interface that all the cache providers/backends should implementnote that it is a "sync style" trait. for the
putandevictmethods, they are likely/should to be sync, not sure aboutgetyet.StorageCacheforLruCache, and definesLruCacheinstances(type level) we currently usedand also a dummy implementation of
StorageCacheforDiskCache, to test the APILruCacheparameterized by the type of cached item, size meter, etc.CachedReadergiven an implementation of
StorageCache, e.g.LruCacheorDiskCache, and a proper implementation ofLoader, it can be instantiated to a concrete CachedReader.storages-common-table-meta::cachemeta_cache_manager.rsinit all the in-memory cache objects that are currently neededmeta_cache.rsCachedMetatrait and impls, whiche.g.
SegmentInfo::cache()should return theSegmentInfoCacheCachereturned should implCacheAccessor, with proper type parameters.Cachegrabbed fromCacheManageris bound to the meta type at compile timecommon-storages-fuse::ioColumnDataLoader, which implementsLoaderto load range of data from object storage, with the ability to customize cache keysio::read::BloomIndexColumnReaderwhich basically instantiatedCachedReaderwithColumnDataLoaderandLruCahe, caches index column data in memoryCachedMetaWritertrait, which writes data and populated the item cachesimplemented for all the type that implements
CachedMetaother related refactor
in fuse table operation modules, replaces the implicit usage of
CacheMangerto populate/evict caches, with the usage ofCachedMetatrait.the way of manipulating the cache is kept as it is, e.g. snapshot will not be cached during the writing, but after committed successfully.
Closes #issue