Commit 151b4bff authored by Xinye Tao's avatar Xinye Tao Committed by yiwu-arbug

fix test config for min-blob-size (#10)

Add an uint64 test flag `min-blob-size` for Titan in titandb_bench and titandb_stress tests.
parent 73b29188
...@@ -741,15 +741,22 @@ DEFINE_uint64(blob_db_max_ttl_range, 86400, ...@@ -741,15 +741,22 @@ DEFINE_uint64(blob_db_max_ttl_range, 86400,
DEFINE_uint64(blob_db_ttl_range_secs, 3600, DEFINE_uint64(blob_db_ttl_range_secs, 3600,
"TTL bucket size to use when creating blob files."); "TTL bucket size to use when creating blob files.");
DEFINE_uint64(blob_db_min_blob_size, 0,
"Smallest blob to store in a file. Blobs smaller than this "
"will be inlined with the key in the LSM tree.");
DEFINE_uint64(blob_db_bytes_per_sync, 0, "Bytes to sync blob file at."); DEFINE_uint64(blob_db_bytes_per_sync, 0, "Bytes to sync blob file at.");
DEFINE_uint64(blob_db_file_size, 256 * 1024 * 1024, DEFINE_uint64(blob_db_file_size, 256 * 1024 * 1024,
"Target size of each blob file."); "Target size of each blob file.");
DEFINE_uint64(blob_db_min_blob_size, 0,
"Smallest blob to store in a file. Blob smaller than this "
"will be inlined with the key in the LSM tree.");
// Titan Options
DEFINE_bool(use_titan, true, "Open a Titan instance.");
DEFINE_uint64(titan_db_min_blob_size, 0,
"Smallest blob to store in a file. Blobs smaller than this "
"will be inlined with the key in the LSM tree.");
#endif // ROCKSDB_LITE #endif // ROCKSDB_LITE
DEFINE_bool(report_bg_io_stats, false, DEFINE_bool(report_bg_io_stats, false,
...@@ -1124,8 +1131,6 @@ DEFINE_bool(report_file_operations, false, ...@@ -1124,8 +1131,6 @@ DEFINE_bool(report_file_operations, false,
"if report number of file " "if report number of file "
"operations"); "operations");
DEFINE_bool(use_titan, true, "Open a Titan instance.");
static const bool FLAGS_soft_rate_limit_dummy __attribute__((__unused__)) = static const bool FLAGS_soft_rate_limit_dummy __attribute__((__unused__)) =
RegisterFlagValidator(&FLAGS_soft_rate_limit, &ValidateRateLimit); RegisterFlagValidator(&FLAGS_soft_rate_limit, &ValidateRateLimit);
...@@ -3581,7 +3586,7 @@ class Benchmark { ...@@ -3581,7 +3586,7 @@ class Benchmark {
options.listeners.emplace_back(listener_); options.listeners.emplace_back(listener_);
opts->min_blob_size = 0; opts->min_blob_size = FLAGS_titan_db_min_blob_size;
opts->min_gc_batch_size = 128 << 20; opts->min_gc_batch_size = 128 << 20;
opts->blob_file_compression = FLAGS_compression_type_e; opts->blob_file_compression = FLAGS_compression_type_e;
if (FLAGS_cache_size) { if (FLAGS_cache_size) {
...@@ -3731,13 +3736,13 @@ class Benchmark { ...@@ -3731,13 +3736,13 @@ class Benchmark {
if (s.ok()) { if (s.ok()) {
db->db = ptr; db->db = ptr;
} }
#endif // ROCKSDB_LITE
} else if (FLAGS_use_titan) { } else if (FLAGS_use_titan) {
titandb::TitanDB* ptr; titandb::TitanDB* ptr;
s = titandb::TitanDB::Open(options, db_name, &ptr); s = titandb::TitanDB::Open(options, db_name, &ptr);
if (s.ok()) { if (s.ok()) {
db->db = ptr; db->db = ptr;
} }
#endif // ROCKSDB_LITE
} else { } else {
s = DB::Open(options, db_name, &db->db); s = DB::Open(options, db_name, &db->db);
} }
......
...@@ -437,6 +437,10 @@ DEFINE_int32(max_background_gc, ...@@ -437,6 +437,10 @@ DEFINE_int32(max_background_gc,
"The maximum number of concurrent background gc " "The maximum number of concurrent background gc "
"that can occur in parallel."); "that can occur in parallel.");
DEFINE_uint64(min_blob_size, 0,
"Smallest blob to store in a file. Blob smaller than this "
"will be inlined with the key in the LSM tree.");
static bool ValidateInt32Percent(const char* flagname, int32_t value) { static bool ValidateInt32Percent(const char* flagname, int32_t value) {
if (value < 0 || value > 100) { if (value < 0 || value > 100) {
fprintf(stderr, "Invalid value for --%s: %d, 0<= pct <=100 \n", flagname, fprintf(stderr, "Invalid value for --%s: %d, 0<= pct <=100 \n", flagname,
...@@ -2314,7 +2318,7 @@ class StressTest { ...@@ -2314,7 +2318,7 @@ class StressTest {
options_.blob_file_compression = kLZ4Compression; options_.blob_file_compression = kLZ4Compression;
options_.blob_file_target_size = 128 << 20; options_.blob_file_target_size = 128 << 20;
options_.disable_background_gc = FLAGS_disable_background_gc; options_.disable_background_gc = FLAGS_disable_background_gc;
options_.min_blob_size = 0; options_.min_blob_size = FLAGS_min_blob_size;
options_.min_gc_batch_size = 0; options_.min_gc_batch_size = 0;
options_.blob_file_discardable_ratio = 0.01; options_.blob_file_discardable_ratio = 0.01;
options_.max_background_gc = FLAGS_max_background_gc; options_.max_background_gc = FLAGS_max_background_gc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment