Skip to content

Commit

Permalink
change target_file_size_base to uint64_t
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Lei Jin committed Sep 22, 2014
1 parent 5e6aee4 commit 57a32f1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Expand Up @@ -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.
* 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.
* Change target_file_size_base type to uint64_t from int.

----- Past Releases -----

Expand Down
2 changes: 1 addition & 1 deletion db/db_bench.cc
Expand Up @@ -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(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,
"A multiplier to compute target level-N file size (N >= 2)");
Expand Down
2 changes: 1 addition & 1 deletion include/rocksdb/options.h
Expand Up @@ -287,7 +287,7 @@ struct ColumnFamilyOptions {
// and each file on level-3 will be 200MB.

// 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 files in different levels will have similar size.
int target_file_size_multiplier;
Expand Down
30 changes: 15 additions & 15 deletions util/options.cc
Expand Up @@ -273,8 +273,8 @@ void DBOptions::Dump(Logger* log) const {
Log(log, " Options.disableDataSync: %d", disableDataSync);
Log(log, " Options.use_fsync: %d", use_fsync);
Log(log, " Options.max_log_file_size: %zu", max_log_file_size);
Log(log, "Options.max_manifest_file_size: %lu",
(unsigned long)max_manifest_file_size);
Log(log, "Options.max_manifest_file_size: %" PRIu64,
max_manifest_file_size);
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.allow_os_buffer: %d", allow_os_buffer);
Expand All @@ -290,16 +290,16 @@ void DBOptions::Dump(Logger* log) const {
table_cache_numshardbits);
Log(log, " Options.table_cache_remove_scan_count_limit: %d",
table_cache_remove_scan_count_limit);
Log(log, " Options.delete_obsolete_files_period_micros: %lu",
(unsigned long)delete_obsolete_files_period_micros);
Log(log, " Options.delete_obsolete_files_period_micros: %" PRIu64,
delete_obsolete_files_period_micros);
Log(log, " Options.max_background_compactions: %d",
max_background_compactions);
Log(log, " Options.max_background_flushes: %d",
max_background_flushes);
Log(log, " Options.WAL_ttl_seconds: %lu",
(unsigned long)WAL_ttl_seconds);
Log(log, " Options.WAL_size_limit_MB: %lu",
(unsigned long)WAL_size_limit_MB);
Log(log, " Options.WAL_ttl_seconds: %" PRIu64,
WAL_ttl_seconds);
Log(log, " Options.WAL_size_limit_MB: %" PRIu64,
WAL_size_limit_MB);
Log(log, " Options.manifest_preallocation_size: %zu",
manifest_preallocation_size);
Log(log, " Options.allow_os_buffer: %d",
Expand All @@ -322,8 +322,8 @@ void DBOptions::Dump(Logger* log) const {
use_adaptive_mutex);
Log(log, " Options.rate_limiter: %p",
rate_limiter.get());
Log(log, " Options.bytes_per_sync: %lu",
(unsigned long)bytes_per_sync);
Log(log, " Options.bytes_per_sync: %" PRIu64,
bytes_per_sync);
} // DBOptions::Dump

void ColumnFamilyOptions::Dump(Logger* log) const {
Expand Down Expand Up @@ -371,20 +371,20 @@ void ColumnFamilyOptions::Dump(Logger* log) const {
level0_stop_writes_trigger);
Log(log," Options.max_mem_compaction_level: %d",
max_mem_compaction_level);
Log(log," Options.target_file_size_base: %d",
Log(log," Options.target_file_size_base: %" PRIu64,
target_file_size_base);
Log(log," Options.target_file_size_multiplier: %d",
target_file_size_multiplier);
Log(log," Options.max_bytes_for_level_base: %lu",
(unsigned long)max_bytes_for_level_base);
Log(log," Options.max_bytes_for_level_base: %" PRIu64,
max_bytes_for_level_base);
Log(log," Options.max_bytes_for_level_multiplier: %d",
max_bytes_for_level_multiplier);
for (int i = 0; i < num_levels; i++) {
Log(log,"Options.max_bytes_for_level_multiplier_addtl[%d]: %d",
i, max_bytes_for_level_multiplier_additional[i]);
}
Log(log," Options.max_sequential_skip_in_iterations: %lu",
(unsigned long)max_sequential_skip_in_iterations);
Log(log," Options.max_sequential_skip_in_iterations: %" PRIu64,
max_sequential_skip_in_iterations);
Log(log," Options.expanded_compaction_factor: %d",
expanded_compaction_factor);
Log(log," Options.source_compaction_factor: %d",
Expand Down
2 changes: 1 addition & 1 deletion util/options_helper.cc
Expand Up @@ -177,7 +177,7 @@ bool GetOptionsFromStrings(
} else if (o.first == "max_mem_compaction_level") {
new_options->max_mem_compaction_level = ParseInt(o.second);
} 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") {
new_options->target_file_size_multiplier = ParseInt(o.second);
} else if (o.first == "max_bytes_for_level_base") {
Expand Down

0 comments on commit 57a32f1

Please sign in to comment.