|
|
@ -172,7 +172,7 @@ class CompactionJobTest : public testing::Test { |
|
|
|
// This is how the key will look like once it's written in bottommost
|
|
|
|
// This is how the key will look like once it's written in bottommost
|
|
|
|
// file
|
|
|
|
// file
|
|
|
|
InternalKey bottommost_internal_key( |
|
|
|
InternalKey bottommost_internal_key( |
|
|
|
key, (key == "9999") ? sequence_number : 0, kTypeValue); |
|
|
|
key, 0, kTypeValue); |
|
|
|
|
|
|
|
|
|
|
|
if (corrupt_id(k)) { |
|
|
|
if (corrupt_id(k)) { |
|
|
|
test::CorruptKeyType(&internal_key); |
|
|
|
test::CorruptKeyType(&internal_key); |
|
|
@ -379,7 +379,7 @@ TEST_F(CompactionJobTest, SimpleOverwrite) { |
|
|
|
|
|
|
|
|
|
|
|
auto expected_results = |
|
|
|
auto expected_results = |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "val2"}, |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "val2"}, |
|
|
|
{KeyStr("b", 4U, kTypeValue), "val3"}}); |
|
|
|
{KeyStr("b", 0U, kTypeValue), "val3"}}); |
|
|
|
|
|
|
|
|
|
|
|
SetLastSequence(4U); |
|
|
|
SetLastSequence(4U); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
@ -432,7 +432,7 @@ TEST_F(CompactionJobTest, SimpleMerge) { |
|
|
|
|
|
|
|
|
|
|
|
auto expected_results = |
|
|
|
auto expected_results = |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "3,4,5"}, |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "3,4,5"}, |
|
|
|
{KeyStr("b", 2U, kTypeValue), "1,2"}}); |
|
|
|
{KeyStr("b", 0U, kTypeValue), "1,2"}}); |
|
|
|
|
|
|
|
|
|
|
|
SetLastSequence(5U); |
|
|
|
SetLastSequence(5U); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
@ -456,7 +456,7 @@ TEST_F(CompactionJobTest, NonAssocMerge) { |
|
|
|
|
|
|
|
|
|
|
|
auto expected_results = |
|
|
|
auto expected_results = |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "3,4,5"}, |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "3,4,5"}, |
|
|
|
{KeyStr("b", 2U, kTypeValue), "1,2"}}); |
|
|
|
{KeyStr("b", 0U, kTypeValue), "1,2"}}); |
|
|
|
|
|
|
|
|
|
|
|
SetLastSequence(5U); |
|
|
|
SetLastSequence(5U); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
@ -483,7 +483,7 @@ TEST_F(CompactionJobTest, MergeOperandFilter) { |
|
|
|
|
|
|
|
|
|
|
|
auto expected_results = |
|
|
|
auto expected_results = |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), test::EncodeInt(8U)}, |
|
|
|
mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), test::EncodeInt(8U)}, |
|
|
|
{KeyStr("b", 2U, kTypeValue), test::EncodeInt(2U)}}); |
|
|
|
{KeyStr("b", 0U, kTypeValue), test::EncodeInt(2U)}}); |
|
|
|
|
|
|
|
|
|
|
|
SetLastSequence(5U); |
|
|
|
SetLastSequence(5U); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
@ -746,7 +746,7 @@ TEST_F(CompactionJobTest, SingleDeleteZeroSeq) { |
|
|
|
AddMockFile(file2); |
|
|
|
AddMockFile(file2); |
|
|
|
|
|
|
|
|
|
|
|
auto expected_results = mock::MakeMockFile({ |
|
|
|
auto expected_results = mock::MakeMockFile({ |
|
|
|
{KeyStr("dummy", 5U, kTypeValue), "val2"}, |
|
|
|
{KeyStr("dummy", 0U, kTypeValue), "val2"}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
SetLastSequence(22U); |
|
|
|
SetLastSequence(22U); |
|
|
@ -930,7 +930,7 @@ TEST_F(CompactionJobTest, CorruptionAfterDeletion) { |
|
|
|
mock::MakeMockFile({{test::KeyStr("A", 0U, kTypeValue), "val3"}, |
|
|
|
mock::MakeMockFile({{test::KeyStr("A", 0U, kTypeValue), "val3"}, |
|
|
|
{test::KeyStr("a", 0U, kTypeValue, true), "val"}, |
|
|
|
{test::KeyStr("a", 0U, kTypeValue, true), "val"}, |
|
|
|
{test::KeyStr("b", 0U, kTypeValue, true), "val"}, |
|
|
|
{test::KeyStr("b", 0U, kTypeValue, true), "val"}, |
|
|
|
{test::KeyStr("c", 1U, kTypeValue), "val2"}}); |
|
|
|
{test::KeyStr("c", 0U, kTypeValue), "val2"}}); |
|
|
|
|
|
|
|
|
|
|
|
SetLastSequence(6U); |
|
|
|
SetLastSequence(6U); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
|
auto files = cfd_->current()->storage_info()->LevelFiles(0); |
|
|
|