-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29249 Allow for BlockCache implementations to define dynamic properties #6897
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
…operties Change-Id: I3681c3b1a50196a70ece04fde08da06448d16353
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| * notifications of dynamic configuration changes. The default is a noop. | ||
| * @param config the new configuration to be updated. | ||
| */ | ||
| default void refreshConfiguration(Configuration config) { |
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.
Why not just implement ConfigurationObserver?
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 just thought to reuse CacheConfig as the observer for all cache related configuration changes notifications. Sounds less convoluted to have just one observer, but no hard feelings about it. I can change if you prefer to have BlockCache implementing ConfigurationObserver.
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.
We can make CacheConfig implement PropagatingConfigurationObserver, so it can register children ConfigurationObservers to ConfigurationManager.
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.
Ok, have pushed a new commit with these suggestions.
This comment has been minimized.
This comment has been minimized.
Change-Id: I0aac16ed7d685ac533fe9d0325747be03adc9140
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Change-Id: I12afe38cd3df15974a44101accd74614edec2a01
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
Show resolved
Hide resolved
|
|
||
| @Override | ||
| public void onConfigurationChange(Configuration config) { | ||
| this.acceptableFactor = conf.getFloat(ACCEPT_FACTOR_CONFIG_NAME, DEFAULT_ACCEPT_FACTOR); |
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.
Haven't touch this area for a long time, all these configs can be loaded dynamically? IIRC, BucketCache will pre alloc all the memory chunks when initializing, configuration refreshing can not trigger the allocation again.
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.
Yes. We can't make any of the bucket allocation related properties, such as bucket sizes and cache size dynamic as those would require a reset of the cache.
The properties being updated here are not related to the cache size, nor how the cache spaces are allocated, so it won't cause a cache reset.
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.
nit: can we add a comment of javadoc on what properties could not be dynamic config? basically we changed ConfigurationObserver to be part of the dynamic config.
This comment has been minimized.
This comment has been minimized.
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
taklwu
left a comment
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.
+1 , add a minor comment about putting a comment what could be or could not be dynamic configuration in the code (or just say be cautions about this function.)
Change-Id: Id6390798d91d6f557caa0ed0007eda817c4ac16c
…operties (#6897) Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Tak Lon (Stephen) Wu <[email protected]>
…operties (apache#6897) Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Tak Lon (Stephen) Wu <[email protected]>
No description provided.