// 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).
//
// Test for issue 178: a manual compaction causes deleted data to reappear.
#include <iostream>
namespace {
-const int kNumKeys = 1100000;
+// Reasoning: previously the number was 1100000. Since the keys are written to
+// the batch in one write each write will result into one SST file. each write
+// will result into one SST file. We reduced the write_buffer_size to 1K to
+// basically have the same effect with however less number of keys, which
+// results into less test runtime.
+const int kNumKeys = 1100;
std::string Key1(int i) {
char buf[100];
public:
ManualCompactionTest() {
// Get rid of any state from an old run.
- dbname_ = rocksdb::test::TmpDir() + "/rocksdb_cbug_test";
+ dbname_ = rocksdb::test::PerThreadDBPath("rocksdb_cbug_test");
DestroyDB(dbname_, rocksdb::Options());
}
public:
DestroyAllCompactionFilter() {}
- virtual bool Filter(int level, const Slice& key, const Slice& existing_value,
- std::string* new_value,
- bool* value_changed) const override {
+ virtual bool Filter(int /*level*/, const Slice& /*key*/,
+ const Slice& existing_value, std::string* /*new_value*/,
+ bool* /*value_changed*/) const override {
return existing_value.ToString() == "destroy";
}
// specific scenario.
rocksdb::DB* db;
rocksdb::Options db_options;
+ db_options.write_buffer_size = 1024;
db_options.create_if_missing = true;
db_options.compression = rocksdb::kNoCompression;
ASSERT_OK(rocksdb::DB::Open(db_options, dbname_, &db));