-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-28469: Integration of time-based priority caching into compaction paths #5866
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
Changes from all commits
740f8f5
f648081
e17df62
d7d15eb
d757ecc
3da7b43
9ea998d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,5 +116,4 @@ public void setBlockType(BlockType blockType) { | |
| public Path getFilePath() { | ||
| return filePath; | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ | |
| import org.apache.hadoop.hbase.nio.RefCnt; | ||
| import org.apache.hadoop.hbase.protobuf.ProtobufMagic; | ||
| import org.apache.hadoop.hbase.regionserver.DataTieringManager; | ||
| import org.apache.hadoop.hbase.regionserver.TimeRangeTracker; | ||
| import org.apache.hadoop.hbase.util.Bytes; | ||
| import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; | ||
| import org.apache.hadoop.hbase.util.IdReadWriteLock; | ||
|
|
@@ -2203,6 +2204,18 @@ public Optional<Boolean> shouldCacheFile(HFileInfo hFileInfo, Configuration conf | |
| return Optional.of(!fullyCachedFiles.containsKey(fileName)); | ||
| } | ||
|
|
||
| @Override | ||
| public Optional<Boolean> shouldCacheBlock(BlockCacheKey key, TimeRangeTracker timeRangeTracker, | ||
| Configuration conf) { | ||
| DataTieringManager dataTieringManager = DataTieringManager.getInstance(); | ||
| if (dataTieringManager != null && !dataTieringManager.isHotData(timeRangeTracker, conf)) { | ||
| LOG.debug("Data tiering is enabled for file: '{}' and it is not hot data", | ||
| key.getHfileName()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Do we need this "key" parameter only for logging the details? If so, we could move this debug to the caller function and avoid passing this parameter to this API.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, it's only used for logging purposes. The caller function, shouldCacheBlock(), isn't aware of data tiering, so I couldn't add that line there. Hence, I kept it here. Additionally, it makes sense to pass the corresponding BlockCacheKey to shouldCacheBlock() to make the decision.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK got it. I am ok for the parameter key to be there considering the API name is shouldCacheBlock(). |
||
| return Optional.of(false); | ||
| } | ||
| return Optional.of(true); | ||
| } | ||
|
|
||
| @Override | ||
| public Optional<Boolean> isAlreadyCached(BlockCacheKey key) { | ||
| return Optional.of(getBackingMap().containsKey(key)); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.