Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

mrambacher
Copy link
Contributor

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.

@zhichao-cao
Copy link
Contributor

@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

@zhichao-cao
Copy link
Contributor

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.

@zhichao-cao
Copy link
Contributor

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.

@mrambacher
Copy link
Contributor Author

I believe everything has been resolved (code and comment-wise) from this PR. The only outstanding issue is to add something to HISTORY.MD

java/src/main/java/org/rocksdb/OptionsUtil.java Outdated Show resolved Hide resolved
java/src/main/java/org/rocksdb/ColumnFamilyOptions.java Outdated Show resolved Hide resolved
java/src/main/java/org/rocksdb/DBOptions.java Outdated Show resolved Hide resolved
java/src/main/java/org/rocksdb/DBOptions.java Outdated Show resolved Hide resolved
java/src/main/java/org/rocksdb/ColumnFamilyOptions.java Outdated Show resolved Hide resolved
java/CMakeLists.txt Show resolved Hide resolved
#include "rocksdb/convenience.h"

// The portal class for org.rocksdb.SanityLevel
class SanityLevelJni {
Copy link
Collaborator

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

}
}

// Returns the equivalent C++ ROCKSDB_NAMESPACE::CompactionStopStyle enum for
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CompactionStopStyle?

Copy link
Collaborator

@adamretter adamretter left a 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.

@zhichao-cao
Copy link
Contributor

@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.
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@facebook-github-bot
Copy link
Contributor

@zhichao-cao merged this pull request in 4cbc19d.

facebook-github-bot pushed a commit that referenced this pull request May 7, 2020
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
anand1976 pushed a commit that referenced this pull request May 8, 2020
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
@mrambacher mrambacher deleted the ConfigOptions branch June 19, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants