-
Notifications
You must be signed in to change notification settings - Fork 590
HDDS-10107. Remove the static dbNameToCfHandleMap from RocksDatabase. #5976
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
hemantk-12
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 @szetszwo for the patch.
Overall looks good to me. Left couple of minor comments.
| this.columnFamilyNames = MemoizedSupplier.valueOf(() -> toMap(columnFamilies.values())); | ||
| } | ||
|
|
||
| private Map<String, ColumnFamily> newMap(List<ColumnFamilyHandle> handles) throws RocksDBException { |
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: newMap and toMap are very generic names and seem like can be used to create/convert any type of Map.
I think newMap could be toColumnFamilyMap and toMap be toColumnFamilyIdToNameMap or something along the line.
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.
Sure, let me rename them.
|
|
||
| @VisibleForTesting | ||
| public ColumnFamilyHandle getHandle() { | ||
| return handle; |
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: please remove @VisibleForTesting. it is used in src code now.
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 @VisibleForTesting tag was added by HDDS-8122 since it changed the method from protected to public for a unit test. The getHandle() method is already used many times by in RocksDatabase and a few times in RDBStore.
|
@hemantk-12 , thanks a lot for reviewing this! Just have pushed a commit for addressing your comments. |
hemantk-12
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.
LGTM.
What changes were proposed in this pull request?
RocksDatabasealready has a non-staticcolumnFamilieswhich hasColumnFamilyHandle. The staticdbNameToCfHandleMapshould be removed for better performance and cleaner code.What is the link to the Apache JIRA
HDDS-10107
How was this patch tested?
By existing tests.