-
Notifications
You must be signed in to change notification settings - Fork 761
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
refactor: cache layer #9672
Merged
Merged
refactor: cache layer #9672
Conversation
This file contains 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
|
mergify
bot
added
the
pr-refactor
this PR changes the code base without new features or bugfix
label
Jan 18, 2023
read path & column reader
dantengsky
force-pushed
the
refact-cache
branch
from
January 18, 2023 18:12
c5fd071
to
64b0f04
Compare
BohuTANG
reviewed
Jan 19, 2023
move cache key generating logic into it
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-cache
CacheAccessor
, which provides the essential cache operationput
,get
,evict
StroageCache
, which describes the minimum interface that all the cache providers/backends should implementnote that it is a "sync style" trait. for the
put
andevict
methods, they are likely/should to be sync, not sure aboutget
yet.StorageCache
forLruCache
, and definesLruCache
instances(type level) we currently usedand also a dummy implementation of
StorageCache
forDiskCache
, to test the APILruCache
parameterized by the type of cached item, size meter, etc.CachedReader
given an implementation of
StorageCache
, e.g.LruCache
orDiskCache
, and a proper implementation ofLoader
, it can be instantiated to a concrete CachedReader.storages-common-table-meta::cache
meta_cache_manager.rs
init all the in-memory cache objects that are currently neededmeta_cache.rs
CachedMeta
trait and impls, whiche.g.
SegmentInfo::cache()
should return theSegmentInfoCache
Cache
returned should implCacheAccessor
, with proper type parameters.Cache
grabbed fromCacheManager
is bound to the meta type at compile timecommon-storages-fuse::io
ColumnDataLoader
, which implementsLoader
to load range of data from object storage, with the ability to customize cache keysio::read::BloomIndexColumnReader
which basically instantiatedCachedReader
withColumnDataLoader
andLruCahe
, caches index column data in memoryCachedMetaWriter
trait, which writes data and populated the item cachesimplemented for all the type that implements
CachedMeta
other related refactor
in fuse table operation modules, replaces the implicit usage of
CacheManger
to populate/evict caches, with the usage ofCachedMeta
trait.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