change target_file_size_base to uint64_t

Summary: It contrains the file size to be 4G max with int

Test Plan:
tried to grep instance and made sure other related variables are also
uint64

Reviewers: sdong, yhchiang, igor

Reviewed By: igor

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D23697
main
Lei Jin 10 years ago
parent 5e6aee4325
commit 57a32f147f
  1. 1
      HISTORY.md
  2. 2
      db/db_bench.cc
  3. 2
      include/rocksdb/options.h
  4. 30
      util/options.cc
  5. 2
      util/options_helper.cc

@ -8,6 +8,7 @@
* We have refactored our system of stalling writes. Any stall-related statistics' meanings are changed. Instead of per-write stall counts, we now count stalls per-epoch, where epochs are periods between flushes and compactions. You'll find more information in our Tuning Perf Guide once we release RocksDB 3.6. * We have refactored our system of stalling writes. Any stall-related statistics' meanings are changed. Instead of per-write stall counts, we now count stalls per-epoch, where epochs are periods between flushes and compactions. You'll find more information in our Tuning Perf Guide once we release RocksDB 3.6.
* When disableDataSync=true, we no longer sync the MANIFEST file. * When disableDataSync=true, we no longer sync the MANIFEST file.
* Add identity_as_first_hash property to CuckooTable. SST file needs to be rebuilt to be opened by reader properly. * Add identity_as_first_hash property to CuckooTable. SST file needs to be rebuilt to be opened by reader properly.
* Change target_file_size_base type to uint64_t from int.
----- Past Releases ----- ----- Past Releases -----

@ -307,7 +307,7 @@ DEFINE_string(wal_dir, "", "If not empty, use the given dir for WAL");
DEFINE_int32(num_levels, 7, "The total number of levels"); DEFINE_int32(num_levels, 7, "The total number of levels");
DEFINE_int32(target_file_size_base, 2 * 1048576, "Target file size at level-1"); DEFINE_int64(target_file_size_base, 2 * 1048576, "Target file size at level-1");
DEFINE_int32(target_file_size_multiplier, 1, DEFINE_int32(target_file_size_multiplier, 1,
"A multiplier to compute target level-N file size (N >= 2)"); "A multiplier to compute target level-N file size (N >= 2)");

@ -287,7 +287,7 @@ struct ColumnFamilyOptions {
// and each file on level-3 will be 200MB. // and each file on level-3 will be 200MB.
// by default target_file_size_base is 2MB. // by default target_file_size_base is 2MB.
int target_file_size_base; uint64_t target_file_size_base;
// by default target_file_size_multiplier is 1, which means // by default target_file_size_multiplier is 1, which means
// by default files in different levels will have similar size. // by default files in different levels will have similar size.
int target_file_size_multiplier; int target_file_size_multiplier;

@ -273,8 +273,8 @@ void DBOptions::Dump(Logger* log) const {
Log(log, " Options.disableDataSync: %d", disableDataSync); Log(log, " Options.disableDataSync: %d", disableDataSync);
Log(log, " Options.use_fsync: %d", use_fsync); Log(log, " Options.use_fsync: %d", use_fsync);
Log(log, " Options.max_log_file_size: %zu", max_log_file_size); Log(log, " Options.max_log_file_size: %zu", max_log_file_size);
Log(log, "Options.max_manifest_file_size: %lu", Log(log, "Options.max_manifest_file_size: %" PRIu64,
(unsigned long)max_manifest_file_size); max_manifest_file_size);
Log(log, " Options.log_file_time_to_roll: %zu", log_file_time_to_roll); Log(log, " Options.log_file_time_to_roll: %zu", log_file_time_to_roll);
Log(log, " Options.keep_log_file_num: %zu", keep_log_file_num); Log(log, " Options.keep_log_file_num: %zu", keep_log_file_num);
Log(log, " Options.allow_os_buffer: %d", allow_os_buffer); Log(log, " Options.allow_os_buffer: %d", allow_os_buffer);
@ -290,16 +290,16 @@ void DBOptions::Dump(Logger* log) const {
table_cache_numshardbits); table_cache_numshardbits);
Log(log, " Options.table_cache_remove_scan_count_limit: %d", Log(log, " Options.table_cache_remove_scan_count_limit: %d",
table_cache_remove_scan_count_limit); table_cache_remove_scan_count_limit);
Log(log, " Options.delete_obsolete_files_period_micros: %lu", Log(log, " Options.delete_obsolete_files_period_micros: %" PRIu64,
(unsigned long)delete_obsolete_files_period_micros); delete_obsolete_files_period_micros);
Log(log, " Options.max_background_compactions: %d", Log(log, " Options.max_background_compactions: %d",
max_background_compactions); max_background_compactions);
Log(log, " Options.max_background_flushes: %d", Log(log, " Options.max_background_flushes: %d",
max_background_flushes); max_background_flushes);
Log(log, " Options.WAL_ttl_seconds: %lu", Log(log, " Options.WAL_ttl_seconds: %" PRIu64,
(unsigned long)WAL_ttl_seconds); WAL_ttl_seconds);
Log(log, " Options.WAL_size_limit_MB: %lu", Log(log, " Options.WAL_size_limit_MB: %" PRIu64,
(unsigned long)WAL_size_limit_MB); WAL_size_limit_MB);
Log(log, " Options.manifest_preallocation_size: %zu", Log(log, " Options.manifest_preallocation_size: %zu",
manifest_preallocation_size); manifest_preallocation_size);
Log(log, " Options.allow_os_buffer: %d", Log(log, " Options.allow_os_buffer: %d",
@ -322,8 +322,8 @@ void DBOptions::Dump(Logger* log) const {
use_adaptive_mutex); use_adaptive_mutex);
Log(log, " Options.rate_limiter: %p", Log(log, " Options.rate_limiter: %p",
rate_limiter.get()); rate_limiter.get());
Log(log, " Options.bytes_per_sync: %lu", Log(log, " Options.bytes_per_sync: %" PRIu64,
(unsigned long)bytes_per_sync); bytes_per_sync);
} // DBOptions::Dump } // DBOptions::Dump
void ColumnFamilyOptions::Dump(Logger* log) const { void ColumnFamilyOptions::Dump(Logger* log) const {
@ -371,20 +371,20 @@ void ColumnFamilyOptions::Dump(Logger* log) const {
level0_stop_writes_trigger); level0_stop_writes_trigger);
Log(log," Options.max_mem_compaction_level: %d", Log(log," Options.max_mem_compaction_level: %d",
max_mem_compaction_level); max_mem_compaction_level);
Log(log," Options.target_file_size_base: %d", Log(log," Options.target_file_size_base: %" PRIu64,
target_file_size_base); target_file_size_base);
Log(log," Options.target_file_size_multiplier: %d", Log(log," Options.target_file_size_multiplier: %d",
target_file_size_multiplier); target_file_size_multiplier);
Log(log," Options.max_bytes_for_level_base: %lu", Log(log," Options.max_bytes_for_level_base: %" PRIu64,
(unsigned long)max_bytes_for_level_base); max_bytes_for_level_base);
Log(log," Options.max_bytes_for_level_multiplier: %d", Log(log," Options.max_bytes_for_level_multiplier: %d",
max_bytes_for_level_multiplier); max_bytes_for_level_multiplier);
for (int i = 0; i < num_levels; i++) { for (int i = 0; i < num_levels; i++) {
Log(log,"Options.max_bytes_for_level_multiplier_addtl[%d]: %d", Log(log,"Options.max_bytes_for_level_multiplier_addtl[%d]: %d",
i, max_bytes_for_level_multiplier_additional[i]); i, max_bytes_for_level_multiplier_additional[i]);
} }
Log(log," Options.max_sequential_skip_in_iterations: %lu", Log(log," Options.max_sequential_skip_in_iterations: %" PRIu64,
(unsigned long)max_sequential_skip_in_iterations); max_sequential_skip_in_iterations);
Log(log," Options.expanded_compaction_factor: %d", Log(log," Options.expanded_compaction_factor: %d",
expanded_compaction_factor); expanded_compaction_factor);
Log(log," Options.source_compaction_factor: %d", Log(log," Options.source_compaction_factor: %d",

@ -177,7 +177,7 @@ bool GetOptionsFromStrings(
} else if (o.first == "max_mem_compaction_level") { } else if (o.first == "max_mem_compaction_level") {
new_options->max_mem_compaction_level = ParseInt(o.second); new_options->max_mem_compaction_level = ParseInt(o.second);
} else if (o.first == "target_file_size_base") { } else if (o.first == "target_file_size_base") {
new_options->target_file_size_base = ParseInt(o.second); new_options->target_file_size_base = ParseUint64(o.second);
} else if (o.first == "target_file_size_multiplier") { } else if (o.first == "target_file_size_multiplier") {
new_options->target_file_size_multiplier = ParseInt(o.second); new_options->target_file_size_multiplier = ParseInt(o.second);
} else if (o.first == "max_bytes_for_level_base") { } else if (o.first == "max_bytes_for_level_base") {

Loading…
Cancel
Save