-
Notifications
You must be signed in to change notification settings - Fork 63
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
Change Configurable::SerializeOptions method to return a map #619
Changes from 9 commits
6dd7279
983f42f
846dd2a
8df931c
b373e4f
a7fb784
70392c9
7a80d1c
aded70d
6efcbb9
829da3f
253cf62
303570f
9dd077a
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 |
---|---|---|
|
@@ -2197,6 +2197,8 @@ TEST_F(DBBasicTest, DBSetThreadAffinity) { | |
CPU_ZERO(&cpuset); | ||
CPU_SET(0, &cpuset); | ||
pthread_setaffinity_np(thr, sizeof(cpu_set_t), &cpuset); | ||
#else | ||
(void)thr; | ||
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. There is a [[maybe_unused]] attribute 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. This is here because of a general build issue on Macs. I have fixed this in many PRs now. Hopefully one will take... |
||
#endif | ||
}; | ||
options.on_thread_start_callback = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ namespace ROCKSDB_NAMESPACE { | |
class Env; | ||
class Logger; | ||
class ObjectRegistry; | ||
|
||
class OptionProperties; | ||
struct ColumnFamilyOptions; | ||
struct DBOptions; | ||
struct Options; | ||
|
@@ -103,6 +103,14 @@ struct ConfigOptions { | |
bool IsCheckEnabled(SanityLevel level) const { | ||
return (level > SanityLevel::kSanityLevelNone && level <= sanity_level); | ||
} | ||
|
||
// Converts the properties to a single string representation | ||
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. How are these 2 methods related to this PR? 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. The ToString methods are used to convert the UserProperties to their string representation. Prior, the code was "hard-coded" in the various places |
||
std::string ToString(const std::string& prefix, | ||
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. Please document the use / purpose of the prefix parameter. However, I see that the prefix parameter is not actually in use in the implementation. Is it really needed? 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. The prefix parameter was there previously (called header) and is needed by some of the formats (like Log format) |
||
const OptionProperties& props) const; | ||
|
||
// Converts the vector options to a single string representation | ||
std::string ToString(char separator, | ||
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. Why does the 2nd ToString() receive a separator while the 1st uses delimiter? |
||
const std::vector<std::string>& elems) const; | ||
}; | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,8 @@ class Customizable : public Configurable { | |
public: | ||
~Customizable() override {} | ||
|
||
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. Please document the purpose of this method / constants |
||
constexpr static const char* kTargetPropName() { return "target"; } | ||
|
||
// Returns the name of this class of Customizable | ||
virtual const char* Name() const = 0; | ||
|
||
|
@@ -222,8 +224,9 @@ class Customizable : public Configurable { | |
virtual const char* NickName() const { return ""; } | ||
// Given a name (e.g. rocksdb.my.type.opt), returns the short name (opt) | ||
std::string GetOptionName(const std::string& long_name) const override; | ||
std::string SerializeOptions(const ConfigOptions& options, | ||
const std::string& prefix) const override; | ||
Status SerializeOptions(const ConfigOptions& config_options, | ||
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. Please document this method. |
||
const std::string& prefix, | ||
OptionProperties* props) const override; | ||
}; | ||
|
||
} // namespace ROCKSDB_NAMESPACE |
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.
please replace "" with "" /* prefix */ for clarity