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

common/options: pass by reference and use user-literals for size #18034

Merged
merged 2 commits into from Sep 30, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/common/options.cc
Expand Up @@ -599,7 +599,7 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("ms_tcp_prefetch_max_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(4096)
.set_default(4_K)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is excellent. Where are these literals defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right in this file. line:144.

.set_description(""),

Option("ms_initial_backoff", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
Expand Down Expand Up @@ -1253,15 +1253,15 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("mon_config_key_max_entry_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(4096)
.set_default(4_K)
.set_description(""),

Option("mon_sync_timeout", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(60.0)
.set_description(""),

Option("mon_sync_max_payload_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1048576)
.set_default(1_M)
.set_description(""),

Option("mon_sync_debug", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
Expand Down Expand Up @@ -1687,7 +1687,7 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("osd_pool_erasure_code_stripe_unit", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(4096)
.set_default(4_K)
.set_description(""),

Option("osd_pool_default_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
Expand Down Expand Up @@ -2309,11 +2309,11 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("osd_command_thread_timeout", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(10*60)
.set_default(10_min)
.set_description(""),

Option("osd_command_thread_suicide_timeout", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(15*60)
.set_default(15_min)
.set_description(""),

Option("osd_heartbeat_addr", Option::TYPE_ADDR, Option::LEVEL_ADVANCED)
Expand Down Expand Up @@ -2897,7 +2897,7 @@ std::vector<Option> get_global_options() {
.set_long_description("This is an experimental option for rocksdb that works in conjunction with two_level indices to avoid having to keep the entire filter/index in cache when cache_index_and_filter_blocks is true. The idea is to keep a much smaller top-level index in heap/cache and then opportunistically cache the lower level indices. See: https://github.com/facebook/rocksdb/wiki/Partitioned-Index-Filters"),

Option("rocksdb_metadata_block_size", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(4096)
.set_default(4_K)
.set_description("The block size for index partitions. (0 = rocksdb default)"),

Option("mon_rocksdb_options", Option::TYPE_STR, Option::LEVEL_ADVANCED)
Expand Down Expand Up @@ -3029,7 +3029,7 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("memstore_page_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(64 << 10)
.set_default(64_K)
.set_description(""),

Option("objectstore_blackhole", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
Expand Down Expand Up @@ -3068,7 +3068,7 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("bdev_block_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(4096)
.set_default(4_K)
.set_description(""),

Option("bdev_debug_aio", Option::TYPE_BOOL, Option::LEVEL_DEV)
Expand All @@ -3088,15 +3088,15 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("bluefs_alloc_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1048576)
.set_default(1_M)
.set_description(""),

Option("bluefs_max_prefetch", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1048576)
.set_default(1_M)
.set_description(""),

Option("bluefs_min_log_runway", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(1048576)
.set_default(1_M)
.set_description(""),

Option("bluefs_max_log_runway", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
Expand All @@ -3108,11 +3108,11 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("bluefs_log_compact_min_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(16*1048576)
.set_default(16_M)
.set_description(""),

Option("bluefs_min_flush_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(524288)
.set_default(512_K)
.set_description(""),

Option("bluefs_compact_log_sync", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
Expand Down Expand Up @@ -3564,7 +3564,7 @@ std::vector<Option> get_global_options() {
.set_description("simulate fragmentation"),

Option("bluestore_debug_prefragment_max", Option::TYPE_INT, Option::LEVEL_DEV)
.set_default(1048576)
.set_default(1_M)
.set_description(""),

Option("bluestore_debug_inject_read_err", Option::TYPE_BOOL, Option::LEVEL_DEV)
Expand Down Expand Up @@ -3914,7 +3914,7 @@ std::vector<Option> get_global_options() {
.set_description("Seconds before backing file system is considered hung"),

Option("filestore_fiemap_threshold", Option::TYPE_INT, Option::LEVEL_DEV)
.set_default(4096)
.set_default(4_K)
.set_description(""),

Option("filestore_merge_threshold", Option::TYPE_INT, Option::LEVEL_DEV)
Expand Down Expand Up @@ -3986,7 +3986,7 @@ std::vector<Option> get_global_options() {
.set_description(""),

Option("journal_block_size", Option::TYPE_INT, Option::LEVEL_DEV)
.set_default(4096)
.set_default(4_K)
.set_description(""),

Option("journal_max_corrupt_search", Option::TYPE_UINT, Option::LEVEL_DEV)
Expand Down Expand Up @@ -4111,31 +4111,31 @@ std::vector<Option> get_global_options() {
"performance counter data."),

Option("mgr_client_bytes", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(128*1048576)
.set_default(128_M)
.add_service("mgr"),

Option("mgr_client_messages", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(512)
.add_service("mgr"),

Option("mgr_osd_bytes", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(512*1048576)
.set_default(512_M)
.add_service("mgr"),

Option("mgr_osd_messages", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(8192)
.add_service("mgr"),

Option("mgr_mds_bytes", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(128*1048576)
.set_default(128_M)
.add_service("mgr"),

Option("mgr_mds_messages", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(128)
.add_service("mgr"),

Option("mgr_mon_bytes", Option::TYPE_UINT, Option::LEVEL_DEV)
.set_default(128*1048576)
.set_default(128_M)
.add_service("mgr"),

Option("mgr_mon_messages", Option::TYPE_UINT, Option::LEVEL_DEV)
Expand Down Expand Up @@ -5958,7 +5958,7 @@ std::vector<Option> get_mds_client_options() {
.set_description(""),

Option("client_max_inline_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(4096)
.set_default(4_K)
.set_description(""),

Option("client_inject_release_failure", Option::TYPE_BOOL, Option::LEVEL_DEV)
Expand Down