-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-23296 Add CompositeBucketCache to support tiered BC #868
Conversation
private static FirstLevelBlockCache createFirstLevelCache(final Configuration c) { | ||
private static BlockCache createFirstLevelCache(final Configuration c) { | ||
if (c.getBoolean(BUCKET_CACHE_COMPOSITE_KEY, false)) { | ||
return createBucketCache(c, CacheLevel.L1); |
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 L1 can be offheap - I mean the engine type and L2 is a seperate bucket cache and so it can be on file also? If both has to be offheap - we should recommend the memory usage part also. Say how much % will be good for L1 and how much for L2.
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 have exposed some conf key for each level's BucketCache (see CompositeBucketCache), such as the ioengine and cacheSize.
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. I saw it now. The bucket cache's hash map was considered to take significant space and was optimized by some JIRA by @anoopsjohn . So now with this tiered cache it may be having some more impact. But all those for later just saying. Will take a closer look at the patch.
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 bucket cache's hash map was considered to take significant space and was optimized by some JIRA by @anoopsjohn
That's great! is there any JIRA to track with? looking forward on it.
💔 -1 overall
This message was automatically generated. |
03656de
to
4005a81
Compare
💔 -1 overall
This message was automatically generated. |
protected final FirstLevelBlockCache l1Cache; | ||
protected final BlockCache l2Cache; | ||
protected final CombinedCacheStats combinedCacheStats; | ||
public class CombinedBlockCache extends CompositeBlockCache implements ResizableBlockCache { |
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 compositeBlockCache is the base now. CombinedBlockCache is a type of it. good.
persistentPath = c.get(CompositeBucketCache.PERSISTENT_PATH_L1); | ||
break; | ||
case L2: | ||
default: |
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 need to LOG that we are creating both L1 and L2 caches as bucket cache.
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.
Add some log like this:
LOG.info("Creating BucketCache for {}, ioengine : {}, cacheSize {}.", level, bucketCacheIOEngineName, bucketCacheSize);
870e224
to
bd3a54a
Compare
public static final String PERSISTENT_PATH_L2 = "hbase.bucketcache.l2.persistent.path"; | ||
|
||
public CompositeBucketCache(BucketCache l1Cache, BucketCache l2Cache) { | ||
super(l1Cache, l2Cache); |
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.
When the L1\2 Bucket cache emits the statistics - you may have to log it with the the level of the cache info also?
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, maybe i have a misunderstood, will do this later
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.
Make CacheLevel as an constructor arg of BucketCache, in order to do some logging
bd3a54a
to
995dbcb
Compare
💔 -1 overall
This message was automatically generated. |
@@ -28,6 +28,10 @@ | |||
*/ | |||
@InterfaceAudience.Private | |||
public interface BlockCache extends Iterable<CachedBlock> { | |||
public enum CacheLevel { | |||
L1, L2 |
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.
When we have on heap cache and a BucketCache, or 2 Bucket Cache are we making it like L1 and L2 really now? That the caching of all blocks starts with L1 and L2 is victim handler for the eviction? I think no. If so better to avoid the term L1 and L2 IMHO. We have done that as part of some work and removed this. Not getting other naming also. Suggestions?
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.
Do you think it's better to naming L1 as metaCache, L2 as dataCache?
Any updates here guys? @ramkrish86 @anoopsjohn @chenxu14 |
This feature enabled on our own branch only, has no updates for now, any advise for how to improve this? |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Any updates here? |
Resovling. No updates. |
No description provided.