// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
-// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree. An additional grant
-// of patent rights can be found in the PATENTS file in the same directory.
+// This source code is licensed under both the GPLv2 (found in the
+// COPYING file in the root directory) and Apache 2.0 License
+// (found in the LICENSE.Apache file in the root directory).
//
//
// The goal of this tool is to be a simple stress test with focus on catching:
}
#else
-#include <gflags/gflags.h>
-
+#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
+#endif // __STDC_FORMAT_MACROS
+
#include <inttypes.h>
#include <atomic>
#include <random>
#include "rocksdb/options.h"
#include "rocksdb/slice.h"
#include "util/filename.h"
+#include "util/gflags_compat.h"
-using GFLAGS::ParseCommandLineFlags;
-using GFLAGS::RegisterFlagValidator;
-using GFLAGS::SetUsageMessage;
+using GFLAGS_NAMESPACE::ParseCommandLineFlags;
+using GFLAGS_NAMESPACE::RegisterFlagValidator;
+using GFLAGS_NAMESPACE::SetUsageMessage;
DEFINE_int32(key_size, 10, "Key size");
DEFINE_int32(value_size, 100, "Value size");
DEFINE_string(db, "", "Use the db with the following name.");
DEFINE_bool(destroy_db, true,
- "Destory the existing DB before running the test");
+ "Destroy the existing DB before running the test");
DEFINE_int32(runtime_sec, 10 * 60, "How long are we running for, in seconds");
DEFINE_int32(seed, 139, "Random seed");
// compactions
options.create_if_missing = true;
options.write_buffer_size = 256 * 1024; // 256k
- options.max_bytes_for_level_base = 1 * 1024 * 1204; // 1MB
- options.target_file_size_base = 100 * 1204; // 100k
+ options.max_bytes_for_level_base = 1 * 1024 * 1024; // 1MB
+ options.target_file_size_base = 100 * 1024; // 100k
options.max_write_buffer_number = 16;
options.max_background_compactions = 16;
options.max_background_flushes = 16;
std::uniform_int_distribution<int> char_dist('a', 'z');
std::string ret;
for (int i = 0; i < len; ++i) {
- ret += char_dist(r);
+ ret += static_cast<char>(char_dist(r));
}
return ret;
};
FLAGS_prefix_mutate_period_sec *
1000 * 1000LL));
if (dist(rng) < FLAGS_first_char_mutate_probability) {
- key_prefix_[0].store(char_dist(rng), std::memory_order_relaxed);
+ key_prefix_[0].store(static_cast<char>(char_dist(rng)), std::memory_order_relaxed);
}
if (dist(rng) < FLAGS_second_char_mutate_probability) {
- key_prefix_[1].store(char_dist(rng), std::memory_order_relaxed);
+ key_prefix_[1].store(static_cast<char>(char_dist(rng)), std::memory_order_relaxed);
}
if (dist(rng) < FLAGS_third_char_mutate_probability) {
- key_prefix_[2].store(char_dist(rng), std::memory_order_relaxed);
+ key_prefix_[2].store(static_cast<char>(char_dist(rng)), std::memory_order_relaxed);
}
}
}