-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Restructure the composed store adaptors #2637
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
Conversation
8b38f3b
to
8de66e6
Compare
}; | ||
let config = DynamoDbStoreConfig { | ||
inner_config, | ||
cache_size: common_config.cache_size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache_size
belongs to a LruCacheConfig
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So compared to this PR, my idea was to replace DynamoDbStoreConfig
by LruCacheConfig<DynamoDbStoreConfig>
and rename DynamoDbStoreInternalConfig
into DynamoDbStoreConfig
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. Indeed this PR does not implement that idea. However, that can be done next.
Thus the next step would be to remove the "Internal" attribute to the RockDb
, ScyllaDb
, DynamoDb
and others. And they could then be exposed to users so that users could run, e.g. with ScyllaDb
with cache or without.
But I think this can be done in a subsequent work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
8de66e6
to
f5f4c1e
Compare
Motivation
We have the
Journaling
,ValueSplitting
,LruCaching
andMeteredStore
but the potential is not fully exploited with a relatively large quantity of boilerplate code.Proposal
The following was done:
get_name()
function is introduced to theAdminKeyValueStore
. Unfortunately, it was not possible to have a&'static str
since we want to have composed types and so composed names.get_name()
allows removing all theKeyValueStoreMetrics
static variables and instead having a global store that contains theKeyValueStoreMeytrics
.AdminKeyValueStore
trait function.AdminKeyValueStore
is added to all the Adaptor.LruCaching
this requires the introduction of theLruSplittingConfig
that contains the configurations in a nested way.CommonStoreConfig
is split with thecache_size
being removed from it.pub store
are systematically changed intostore
in the adaptors.Possible criticism of the design:
JournalingKeyValueStore
. The rust difficulty was in thetype Keys = K::Keys
since this requires a nested key type and I think it was a little too complicated at this time.KeyValueStoreMetrics
were previously as&'static LazyLock<KeyValueStoreMetrics>
. Now they are asArc<KeyValueStoreMetrics>
.LruSplittingError
. But those would be pure boilerplate since for LRU, there is no additional error occurring.Test Plan
CI. Nothing should be affected by the refactoring.
Release Plan
Not relevant.
Links
None.