-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29668 Add row cache framework #7398
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
base: HBASE-29585
Are you sure you want to change the base?
Conversation
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.
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.
f95570c to
cc96b4c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I see this PR got an unrelated commit. Do you want me to rebase this branch on top of master, @EungsopYoo? You can then just force push your initial commit to your remote branch. |
6136446 to
0df6d15
Compare
|
@wchevreuil |
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.
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.
This comment has been minimized.
This comment has been minimized.
c19a96d to
25cea27
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ea0e73a to
0df6d15
Compare
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
@wchevreuil |
wchevreuil
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.
Thanks for submitting this PR @EungsopYoo and sorry for the long delayed response. Let's resume the discussions on this. Please refer to my comments below:
I think we should avoid putting row cache related logic on RSRpcServices, as RSRpcServices is mainly a proxy between RS/Region logic and the RPC layer.
The row cache would be a core component of RegionServer, so in that sense, it should be created and kept at HRegionServer, just like we do for BlockCache.
Since row cache would be used on region related operations, all access logic to it should be implemented at HRegion class. HRegionServer should expose its row cache to HRegion instances via the RegionServerServices (as it does with BlockCache, for instance).
| @org.apache.yetus.audience.InterfaceAudience.Private | ||
| public class RowCacheService { | ||
| private final boolean enabledByConf; | ||
| private final RowCache rowCache; | ||
|
|
||
| RowCacheService(Configuration conf) { | ||
| enabledByConf = | ||
| conf.getFloat(HConstants.ROW_CACHE_SIZE_KEY, HConstants.ROW_CACHE_SIZE_DEFAULT) > 0; | ||
| rowCache = new RowCacheImpl(MemorySizeUtil.getRowCacheSize(conf)); | ||
| } | ||
|
|
||
| OperationStatus[] batchMutate(HRegion region, Mutation[] mArray, boolean atomic, long nonceGroup, | ||
| long nonce) throws IOException { | ||
| return region.batchMutate(mArray, atomic, nonceGroup, nonce); | ||
| } | ||
|
|
||
| BulkLoadHFileResponse bulkLoadHFile(RSRpcServices rsRpcServices, BulkLoadHFileRequest request) | ||
| throws ServiceException { | ||
| return rsRpcServices.bulkLoadHFileInternal(request); | ||
| } | ||
|
|
||
| CheckAndMutateResult checkAndMutate(HRegion region, CheckAndMutate checkAndMutate, | ||
| long nonceGroup, long nonce) throws IOException { | ||
| return region.checkAndMutate(checkAndMutate, nonceGroup, nonce); | ||
| } | ||
|
|
||
| RegionScannerImpl getScanner(HRegion region, Scan scan, List<Cell> results) throws IOException { | ||
| RegionScannerImpl scanner = region.getScanner(scan); | ||
| scanner.next(results); | ||
| return scanner; | ||
| } | ||
|
|
||
| Result mutate(RSRpcServices rsRpcServices, HRegion region, ClientProtos.MutationProto mutation, | ||
| OperationQuota quota, CellScanner cellScanner, long nonceGroup, | ||
| ActivePolicyEnforcement spaceQuotaEnforcement, RpcCallContext context) throws IOException { | ||
| return rsRpcServices.mutateInternal(mutation, region, quota, cellScanner, nonceGroup, | ||
| spaceQuotaEnforcement, context); | ||
| } |
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 do we need this class at all? It's adding a cyclic dependency within RSRpcServices. Can't we simply reference the RowCache impl from the HRegion instance?
| package org.apache.hadoop.hbase.regionserver; | ||
|
|
||
| @org.apache.yetus.audience.InterfaceAudience.Private | ||
| public class RowCacheImpl implements RowCache { |
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: since we are not really doing anything here, can we remove this impl from this PR and focus only on the framework itself?
|
@wchevreuil |
No problem. Enjoy your time off! |
No description provided.