-
Notifications
You must be signed in to change notification settings - Fork 6.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
Add a ConfigOptions for use in comparing objects and converting to/from strings #6389
Conversation
0b95020
to
b75c555
Compare
f531ff7
to
622945a
Compare
ffd277f
to
579e5d0
Compare
095ef14
to
f102429
Compare
@adamretter Hi Adam, can you help to review the Java code change of this PR. I'm not familiar with the Java interfaces in RocksDB |
Also, for all the new interfaces, we want to make them align with our codebase: move ConfigOption to the first place of the function parameters if the functions use ConfigOption as an operating option. |
Thanks @mrambacher for working on this! It makes compare/convert objects to/from strings more clear by introducing the ConfigOption, and avoids the fragmented control parameters used in different places. |
f102429
to
54b7433
Compare
I believe everything has been resolved (code and comment-wise) from this PR. The only outstanding issue is to add something to HISTORY.MD |
cd1be7c
to
0e0f9fb
Compare
0e0f9fb
to
c52f7a2
Compare
java/rocksjni/config_options.cc
Outdated
#include "rocksdb/convenience.h" | ||
|
||
// The portal class for org.rocksdb.SanityLevel | ||
class SanityLevelJni { |
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.
Can you move SanityLevelJni
to portal.h
please
java/rocksjni/config_options.cc
Outdated
} | ||
} | ||
|
||
// Returns the equivalent C++ ROCKSDB_NAMESPACE::CompactionStopStyle enum for |
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.
CompactionStopStyle
?
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.
@mrambacher LGTM... just one class to move to portal.h
.
c52f7a2
to
9c45905
Compare
@adamretter Thanks a lot for your detailed review and comments! |
The ConfigOptions encapsulates the additional parameters to the GetFromString, GetFromMap, GetStringFrom, and Verify methods. The GetFromMap typically took two parameters (input_strings_escaped, ignore_unknown_options). The GetStringFrom method would take a parameter for the delimiter between fields. The Verify would take a SanityCheckLevel to control how close to match properties. All of these fields were moved under a single struct. The purpose of this change is to be able to add additional optional parameters to these methods without changing the method signatures in the future.
9c45905
to
45584cc
Compare
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.
@zhichao-cao has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@zhichao-cao merged this pull request in 4cbc19d. |
Summary: #6389 replaced the #include of options.h in table.h with forward declarations, which is causing some build failures in RocksDB users in 6.10. Remove the forward declarations and #include options.h as recommended by the style guide - https://google.github.io/styleguide/cppguide.html#Forward_Declarations Pull Request resolved: #6823 Reviewed By: riversand963 Differential Revision: D21464078 Pulled By: anand1976 fbshipit-source-id: 6033ee2544d279690f57bb0db91bc83816cee11d
Summary: #6389 replaced the #include of options.h in table.h with forward declarations, which is causing some build failures in RocksDB users in 6.10. Remove the forward declarations and #include options.h as recommended by the style guide - https://google.github.io/styleguide/cppguide.html#Forward_Declarations Pull Request resolved: #6823 Reviewed By: riversand963 Differential Revision: D21464078 Pulled By: anand1976 fbshipit-source-id: 6033ee2544d279690f57bb0db91bc83816cee11d
The methods in convenience.h are used to compare/convert objects to/from strings. There is a mishmash of parameters in use here with more needed in the future. This PR replaces those parameters with a single structure.