2011-06-22 18:45:39 +00:00
|
|
|
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
|
|
|
|
|
|
|
#include "db/version_set.h"
|
2019-11-21 13:09:53 -08:00
|
|
|
|
2019-11-25 09:29:06 -08:00
|
|
|
#include "gtest/gtest.h"
|
2011-06-22 18:45:39 +00:00
|
|
|
#include "util/logging.h"
|
|
|
|
#include "util/testutil.h"
|
|
|
|
|
|
|
|
namespace leveldb {
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
class FindFileTest : public testing::Test {
|
2011-06-22 18:45:39 +00:00
|
|
|
public:
|
2019-05-02 11:01:00 -07:00
|
|
|
FindFileTest() : disjoint_sorted_files_(true) {}
|
2011-06-22 18:45:39 +00:00
|
|
|
|
|
|
|
~FindFileTest() {
|
|
|
|
for (int i = 0; i < files_.size(); i++) {
|
|
|
|
delete files_[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-15 00:20:57 +00:00
|
|
|
void Add(const char* smallest, const char* largest,
|
|
|
|
SequenceNumber smallest_seq = 100,
|
|
|
|
SequenceNumber largest_seq = 100) {
|
2011-06-22 18:45:39 +00:00
|
|
|
FileMetaData* f = new FileMetaData;
|
|
|
|
f->number = files_.size() + 1;
|
2011-07-15 00:20:57 +00:00
|
|
|
f->smallest = InternalKey(smallest, smallest_seq, kTypeValue);
|
|
|
|
f->largest = InternalKey(largest, largest_seq, kTypeValue);
|
2011-06-22 18:45:39 +00:00
|
|
|
files_.push_back(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
int Find(const char* key) {
|
|
|
|
InternalKey target(key, 100, kTypeValue);
|
|
|
|
InternalKeyComparator cmp(BytewiseComparator());
|
|
|
|
return FindFile(cmp, files_, target.Encode());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Overlaps(const char* smallest, const char* largest) {
|
|
|
|
InternalKeyComparator cmp(BytewiseComparator());
|
2018-04-10 16:18:06 -07:00
|
|
|
Slice s(smallest != nullptr ? smallest : "");
|
|
|
|
Slice l(largest != nullptr ? largest : "");
|
2011-10-05 16:30:28 -07:00
|
|
|
return SomeFileOverlapsRange(cmp, disjoint_sorted_files_, files_,
|
2018-04-10 16:18:06 -07:00
|
|
|
(smallest != nullptr ? &s : nullptr),
|
|
|
|
(largest != nullptr ? &l : nullptr));
|
2011-06-22 18:45:39 +00:00
|
|
|
}
|
2019-05-03 09:31:18 -07:00
|
|
|
|
|
|
|
bool disjoint_sorted_files_;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<FileMetaData*> files_;
|
2011-06-22 18:45:39 +00:00
|
|
|
};
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(FindFileTest, Empty) {
|
2011-06-22 18:45:39 +00:00
|
|
|
ASSERT_EQ(0, Find("foo"));
|
2019-05-02 11:01:00 -07:00
|
|
|
ASSERT_TRUE(!Overlaps("a", "z"));
|
|
|
|
ASSERT_TRUE(!Overlaps(nullptr, "z"));
|
|
|
|
ASSERT_TRUE(!Overlaps("a", nullptr));
|
|
|
|
ASSERT_TRUE(!Overlaps(nullptr, nullptr));
|
2011-06-22 18:45:39 +00:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(FindFileTest, Single) {
|
2011-06-22 18:45:39 +00:00
|
|
|
Add("p", "q");
|
|
|
|
ASSERT_EQ(0, Find("a"));
|
|
|
|
ASSERT_EQ(0, Find("p"));
|
|
|
|
ASSERT_EQ(0, Find("p1"));
|
|
|
|
ASSERT_EQ(0, Find("q"));
|
|
|
|
ASSERT_EQ(1, Find("q1"));
|
|
|
|
ASSERT_EQ(1, Find("z"));
|
|
|
|
|
2019-05-02 11:01:00 -07:00
|
|
|
ASSERT_TRUE(!Overlaps("a", "b"));
|
|
|
|
ASSERT_TRUE(!Overlaps("z1", "z2"));
|
2011-06-22 18:45:39 +00:00
|
|
|
ASSERT_TRUE(Overlaps("a", "p"));
|
|
|
|
ASSERT_TRUE(Overlaps("a", "q"));
|
|
|
|
ASSERT_TRUE(Overlaps("a", "z"));
|
|
|
|
ASSERT_TRUE(Overlaps("p", "p1"));
|
|
|
|
ASSERT_TRUE(Overlaps("p", "q"));
|
|
|
|
ASSERT_TRUE(Overlaps("p", "z"));
|
|
|
|
ASSERT_TRUE(Overlaps("p1", "p2"));
|
|
|
|
ASSERT_TRUE(Overlaps("p1", "z"));
|
|
|
|
ASSERT_TRUE(Overlaps("q", "q"));
|
|
|
|
ASSERT_TRUE(Overlaps("q", "q1"));
|
2011-10-05 16:30:28 -07:00
|
|
|
|
2019-05-02 11:01:00 -07:00
|
|
|
ASSERT_TRUE(!Overlaps(nullptr, "j"));
|
|
|
|
ASSERT_TRUE(!Overlaps("r", nullptr));
|
2018-04-10 16:18:06 -07:00
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "p"));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "p1"));
|
|
|
|
ASSERT_TRUE(Overlaps("q", nullptr));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, nullptr));
|
2011-06-22 18:45:39 +00:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(FindFileTest, Multiple) {
|
2011-06-22 18:45:39 +00:00
|
|
|
Add("150", "200");
|
|
|
|
Add("200", "250");
|
|
|
|
Add("300", "350");
|
|
|
|
Add("400", "450");
|
|
|
|
ASSERT_EQ(0, Find("100"));
|
|
|
|
ASSERT_EQ(0, Find("150"));
|
|
|
|
ASSERT_EQ(0, Find("151"));
|
|
|
|
ASSERT_EQ(0, Find("199"));
|
|
|
|
ASSERT_EQ(0, Find("200"));
|
|
|
|
ASSERT_EQ(1, Find("201"));
|
|
|
|
ASSERT_EQ(1, Find("249"));
|
|
|
|
ASSERT_EQ(1, Find("250"));
|
|
|
|
ASSERT_EQ(2, Find("251"));
|
|
|
|
ASSERT_EQ(2, Find("299"));
|
|
|
|
ASSERT_EQ(2, Find("300"));
|
|
|
|
ASSERT_EQ(2, Find("349"));
|
|
|
|
ASSERT_EQ(2, Find("350"));
|
|
|
|
ASSERT_EQ(3, Find("351"));
|
|
|
|
ASSERT_EQ(3, Find("400"));
|
|
|
|
ASSERT_EQ(3, Find("450"));
|
|
|
|
ASSERT_EQ(4, Find("451"));
|
|
|
|
|
2019-05-02 11:01:00 -07:00
|
|
|
ASSERT_TRUE(!Overlaps("100", "149"));
|
|
|
|
ASSERT_TRUE(!Overlaps("251", "299"));
|
|
|
|
ASSERT_TRUE(!Overlaps("451", "500"));
|
|
|
|
ASSERT_TRUE(!Overlaps("351", "399"));
|
2011-06-22 18:45:39 +00:00
|
|
|
|
|
|
|
ASSERT_TRUE(Overlaps("100", "150"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "200"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "300"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "400"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "500"));
|
|
|
|
ASSERT_TRUE(Overlaps("375", "400"));
|
|
|
|
ASSERT_TRUE(Overlaps("450", "450"));
|
|
|
|
ASSERT_TRUE(Overlaps("450", "500"));
|
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(FindFileTest, MultipleNullBoundaries) {
|
2011-10-05 16:30:28 -07:00
|
|
|
Add("150", "200");
|
|
|
|
Add("200", "250");
|
|
|
|
Add("300", "350");
|
|
|
|
Add("400", "450");
|
2019-05-02 11:01:00 -07:00
|
|
|
ASSERT_TRUE(!Overlaps(nullptr, "149"));
|
|
|
|
ASSERT_TRUE(!Overlaps("451", nullptr));
|
2018-04-10 16:18:06 -07:00
|
|
|
ASSERT_TRUE(Overlaps(nullptr, nullptr));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "150"));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "199"));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "200"));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "201"));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "400"));
|
|
|
|
ASSERT_TRUE(Overlaps(nullptr, "800"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", nullptr));
|
|
|
|
ASSERT_TRUE(Overlaps("200", nullptr));
|
|
|
|
ASSERT_TRUE(Overlaps("449", nullptr));
|
|
|
|
ASSERT_TRUE(Overlaps("450", nullptr));
|
2011-10-05 16:30:28 -07:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(FindFileTest, OverlapSequenceChecks) {
|
2011-07-15 00:20:57 +00:00
|
|
|
Add("200", "200", 5000, 3000);
|
2019-05-02 11:01:00 -07:00
|
|
|
ASSERT_TRUE(!Overlaps("199", "199"));
|
|
|
|
ASSERT_TRUE(!Overlaps("201", "300"));
|
2011-07-15 00:20:57 +00:00
|
|
|
ASSERT_TRUE(Overlaps("200", "200"));
|
|
|
|
ASSERT_TRUE(Overlaps("190", "200"));
|
|
|
|
ASSERT_TRUE(Overlaps("200", "210"));
|
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(FindFileTest, OverlappingFiles) {
|
2011-10-05 16:30:28 -07:00
|
|
|
Add("150", "600");
|
|
|
|
Add("400", "500");
|
|
|
|
disjoint_sorted_files_ = false;
|
2019-05-02 11:01:00 -07:00
|
|
|
ASSERT_TRUE(!Overlaps("100", "149"));
|
|
|
|
ASSERT_TRUE(!Overlaps("601", "700"));
|
2011-10-05 16:30:28 -07:00
|
|
|
ASSERT_TRUE(Overlaps("100", "150"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "200"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "300"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "400"));
|
|
|
|
ASSERT_TRUE(Overlaps("100", "500"));
|
|
|
|
ASSERT_TRUE(Overlaps("375", "400"));
|
|
|
|
ASSERT_TRUE(Overlaps("450", "450"));
|
|
|
|
ASSERT_TRUE(Overlaps("450", "500"));
|
|
|
|
ASSERT_TRUE(Overlaps("450", "700"));
|
|
|
|
ASSERT_TRUE(Overlaps("600", "700"));
|
|
|
|
}
|
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
void AddBoundaryInputs(const InternalKeyComparator& icmp,
|
|
|
|
const std::vector<FileMetaData*>& level_files,
|
|
|
|
std::vector<FileMetaData*>* compaction_files);
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
class AddBoundaryInputsTest : public testing::Test {
|
2016-01-24 18:10:16 -08:00
|
|
|
public:
|
2019-04-11 19:10:37 -07:00
|
|
|
std::vector<FileMetaData*> level_files_;
|
|
|
|
std::vector<FileMetaData*> compaction_files_;
|
|
|
|
std::vector<FileMetaData*> all_files_;
|
2016-01-24 18:10:16 -08:00
|
|
|
InternalKeyComparator icmp_;
|
|
|
|
|
2019-05-04 17:40:21 -07:00
|
|
|
AddBoundaryInputsTest() : icmp_(BytewiseComparator()) {}
|
2016-01-24 18:10:16 -08:00
|
|
|
|
|
|
|
~AddBoundaryInputsTest() {
|
2019-04-11 19:10:37 -07:00
|
|
|
for (size_t i = 0; i < all_files_.size(); ++i) {
|
|
|
|
delete all_files_[i];
|
2016-01-24 18:10:16 -08:00
|
|
|
}
|
2019-04-11 19:10:37 -07:00
|
|
|
all_files_.clear();
|
2019-05-04 17:40:21 -07:00
|
|
|
}
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* CreateFileMetaData(uint64_t number, InternalKey smallest,
|
2016-01-24 18:10:16 -08:00
|
|
|
InternalKey largest) {
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f = new FileMetaData();
|
2016-01-24 18:10:16 -08:00
|
|
|
f->number = number;
|
|
|
|
f->smallest = smallest;
|
|
|
|
f->largest = largest;
|
2019-04-11 19:10:37 -07:00
|
|
|
all_files_.push_back(f);
|
2016-01-24 18:10:16 -08:00
|
|
|
return f;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(AddBoundaryInputsTest, TestEmptyFileSets) {
|
2019-04-11 19:10:37 -07:00
|
|
|
AddBoundaryInputs(icmp_, level_files_, &compaction_files_);
|
|
|
|
ASSERT_TRUE(compaction_files_.empty());
|
|
|
|
ASSERT_TRUE(level_files_.empty());
|
2016-01-24 18:10:16 -08:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(AddBoundaryInputsTest, TestEmptyLevelFiles) {
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f1 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 1, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
compaction_files_.push_back(f1);
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
AddBoundaryInputs(icmp_, level_files_, &compaction_files_);
|
|
|
|
ASSERT_EQ(1, compaction_files_.size());
|
|
|
|
ASSERT_EQ(f1, compaction_files_[0]);
|
|
|
|
ASSERT_TRUE(level_files_.empty());
|
2016-01-24 18:10:16 -08:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(AddBoundaryInputsTest, TestEmptyCompactionFiles) {
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f1 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 1, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
level_files_.push_back(f1);
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
AddBoundaryInputs(icmp_, level_files_, &compaction_files_);
|
|
|
|
ASSERT_TRUE(compaction_files_.empty());
|
|
|
|
ASSERT_EQ(1, level_files_.size());
|
|
|
|
ASSERT_EQ(f1, level_files_[0]);
|
2016-01-24 18:10:16 -08:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(AddBoundaryInputsTest, TestNoBoundaryFiles) {
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f1 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 1, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f2 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("200", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("200", 1, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f3 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("300", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("300", 1, kTypeValue)));
|
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
level_files_.push_back(f3);
|
|
|
|
level_files_.push_back(f2);
|
|
|
|
level_files_.push_back(f1);
|
|
|
|
compaction_files_.push_back(f2);
|
|
|
|
compaction_files_.push_back(f3);
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
AddBoundaryInputs(icmp_, level_files_, &compaction_files_);
|
|
|
|
ASSERT_EQ(2, compaction_files_.size());
|
2016-01-24 18:10:16 -08:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(AddBoundaryInputsTest, TestOneBoundaryFiles) {
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f1 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 3, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 2, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f2 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 1, kTypeValue),
|
|
|
|
InternalKey(InternalKey("200", 3, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f3 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("300", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("300", 1, kTypeValue)));
|
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
level_files_.push_back(f3);
|
|
|
|
level_files_.push_back(f2);
|
|
|
|
level_files_.push_back(f1);
|
|
|
|
compaction_files_.push_back(f1);
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
AddBoundaryInputs(icmp_, level_files_, &compaction_files_);
|
|
|
|
ASSERT_EQ(2, compaction_files_.size());
|
|
|
|
ASSERT_EQ(f1, compaction_files_[0]);
|
|
|
|
ASSERT_EQ(f2, compaction_files_[1]);
|
2016-01-24 18:10:16 -08:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(AddBoundaryInputsTest, TestTwoBoundaryFiles) {
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f1 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 6, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 5, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f2 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("300", 1, kTypeValue)));
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f3 =
|
2016-01-24 18:10:16 -08:00
|
|
|
CreateFileMetaData(1, InternalKey("100", 4, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 3, kTypeValue)));
|
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
level_files_.push_back(f2);
|
|
|
|
level_files_.push_back(f3);
|
|
|
|
level_files_.push_back(f1);
|
|
|
|
compaction_files_.push_back(f1);
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
AddBoundaryInputs(icmp_, level_files_, &compaction_files_);
|
|
|
|
ASSERT_EQ(3, compaction_files_.size());
|
|
|
|
ASSERT_EQ(f1, compaction_files_[0]);
|
|
|
|
ASSERT_EQ(f3, compaction_files_[1]);
|
|
|
|
ASSERT_EQ(f2, compaction_files_[2]);
|
2016-01-24 18:10:16 -08:00
|
|
|
}
|
|
|
|
|
2019-11-21 13:09:53 -08:00
|
|
|
TEST_F(AddBoundaryInputsTest, TestDisjoinFilePointers) {
|
2019-04-11 19:10:37 -07:00
|
|
|
FileMetaData* f1 =
|
|
|
|
CreateFileMetaData(1, InternalKey("100", 6, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 5, kTypeValue)));
|
|
|
|
FileMetaData* f2 =
|
|
|
|
CreateFileMetaData(1, InternalKey("100", 6, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 5, kTypeValue)));
|
|
|
|
FileMetaData* f3 =
|
|
|
|
CreateFileMetaData(1, InternalKey("100", 2, kTypeValue),
|
|
|
|
InternalKey(InternalKey("300", 1, kTypeValue)));
|
|
|
|
FileMetaData* f4 =
|
|
|
|
CreateFileMetaData(1, InternalKey("100", 4, kTypeValue),
|
|
|
|
InternalKey(InternalKey("100", 3, kTypeValue)));
|
2016-01-24 18:10:16 -08:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
level_files_.push_back(f2);
|
|
|
|
level_files_.push_back(f3);
|
|
|
|
level_files_.push_back(f4);
|
2011-06-22 18:45:39 +00:00
|
|
|
|
2019-04-11 19:10:37 -07:00
|
|
|
compaction_files_.push_back(f1);
|
|
|
|
|
|
|
|
AddBoundaryInputs(icmp_, level_files_, &compaction_files_);
|
|
|
|
ASSERT_EQ(3, compaction_files_.size());
|
|
|
|
ASSERT_EQ(f1, compaction_files_[0]);
|
|
|
|
ASSERT_EQ(f4, compaction_files_[1]);
|
|
|
|
ASSERT_EQ(f3, compaction_files_[2]);
|
2011-06-22 18:45:39 +00:00
|
|
|
}
|
2019-04-11 19:10:37 -07:00
|
|
|
|
|
|
|
} // namespace leveldb
|