@ -238,9 +238,9 @@ TEST_F(MemTableListTest, GetTest) {
autovector < MemTable * > to_delete ;
LookupKey lkey ( " key1 " , seq ) ;
bool found = list . current ( ) - > Get (
lkey , & value , /*timestamp */nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
bool found = list . current ( ) - > Get ( lkey , & value , /*columns=*/ nullptr ,
/*timestamp= */ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
// Create a MemTable
@ -266,7 +266,7 @@ TEST_F(MemTableListTest, GetTest) {
// Fetch the newly written keys
merge_context . Clear ( ) ;
found = mem - > Get ( LookupKey ( " key1 " , seq ) , & value ,
found = mem - > Get ( LookupKey ( " key1 " , seq ) , & value , /*columns*/ nullptr ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ,
false /* immutable_memtable */ ) ;
@ -274,7 +274,7 @@ TEST_F(MemTableListTest, GetTest) {
ASSERT_EQ ( value , " value1 " ) ;
merge_context . Clear ( ) ;
found = mem - > Get ( LookupKey ( " key1 " , 2 ) , & value ,
found = mem - > Get ( LookupKey ( " key1 " , 2 ) , & value , /*columns*/ nullptr ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ,
false /* immutable_memtable */ ) ;
@ -282,7 +282,7 @@ TEST_F(MemTableListTest, GetTest) {
ASSERT_TRUE ( found & & s . IsNotFound ( ) ) ;
merge_context . Clear ( ) ;
found = mem - > Get ( LookupKey ( " key2 " , seq ) , & value ,
found = mem - > Get ( LookupKey ( " key2 " , seq ) , & value , /*columns*/ nullptr ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ,
false /* immutable_memtable */ ) ;
@ -319,29 +319,32 @@ TEST_F(MemTableListTest, GetTest) {
// Fetch keys via MemTableList
merge_context . Clear ( ) ;
found = list . current ( ) - > Get (
LookupKey ( " key1 " , seq ) , & value , /*timestamp*/ nullptr , & s ,
& merge_context , & max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key1 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_TRUE ( found & & s . IsNotFound ( ) ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > Get (
LookupKey ( " key1 " , saved_seq ) , & value , /*timestamp*/ nullptr ,
& s , & merge_context , & max_covering_tombstone_seq , ReadOptions ( ) ) ;
found = list . current ( ) - > Get ( LookupKey ( " key1 " , saved_seq ) , & value ,
/*columns=*/ nullptr , /*timestamp=*/ nullptr , & s ,
& merge_context , & max_covering_tombstone_seq ,
ReadOptions ( ) ) ;
ASSERT_TRUE ( s . ok ( ) & & found ) ;
ASSERT_EQ ( " value1 " , value ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > Get (
LookupKey ( " key2 " , seq ) , & value , /*timestamp*/ nullptr , & s ,
& merge_context , & max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_TRUE ( s . ok ( ) & & found ) ;
ASSERT_EQ ( value , " value2.3 " ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > Get (
LookupKey ( " key2 " , 1 ) , & value , /*timestamp*/ nullptr , & s ,
& merge_context , & max_covering_tombstone_seq , ReadOptions ( ) ) ;
found = list . current ( ) - > Get ( LookupKey ( " key2 " , 1 ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
ASSERT_EQ ( 2 , list . NumNotFlushed ( ) ) ;
@ -370,9 +373,9 @@ TEST_F(MemTableListTest, GetFromHistoryTest) {
autovector < MemTable * > to_delete ;
LookupKey lkey ( " key1 " , seq ) ;
bool found = list . current ( ) - > Get (
lkey , & value , /*timestamp */nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
bool found = list . current ( ) - > Get ( lkey , & value , /*columns=*/ nullptr ,
/*timestamp= */ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
// Create a MemTable
@ -396,7 +399,7 @@ TEST_F(MemTableListTest, GetFromHistoryTest) {
// Fetch the newly written keys
merge_context . Clear ( ) ;
found = mem - > Get ( LookupKey ( " key1 " , seq ) , & value ,
found = mem - > Get ( LookupKey ( " key1 " , seq ) , & value , /*columns*/ nullptr ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ,
false /* immutable_memtable */ ) ;
@ -404,7 +407,7 @@ TEST_F(MemTableListTest, GetFromHistoryTest) {
ASSERT_TRUE ( found & & s . IsNotFound ( ) ) ;
merge_context . Clear ( ) ;
found = mem - > Get ( LookupKey ( " key2 " , seq ) , & value ,
found = mem - > Get ( LookupKey ( " key2 " , seq ) , & value , /*columns*/ nullptr ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ,
false /* immutable_memtable */ ) ;
@ -420,15 +423,17 @@ TEST_F(MemTableListTest, GetFromHistoryTest) {
// Fetch keys via MemTableList
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key1 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key1 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_TRUE ( found & & s . IsNotFound ( ) ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_TRUE ( s . ok ( ) & & found ) ;
ASSERT_EQ ( " value2.2 " , value ) ;
@ -449,28 +454,32 @@ TEST_F(MemTableListTest, GetFromHistoryTest) {
// Verify keys are no longer in MemTableList
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key1 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key1 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
// Verify keys are present in history
merge_context . Clear ( ) ;
found = list . current ( ) - > GetFromHistory (
LookupKey ( " key1 " , seq ) , & value , /*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
LookupKey ( " key1 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context , & max_covering_tombstone_seq ,
ReadOptions ( ) ) ;
ASSERT_TRUE ( found & & s . IsNotFound ( ) ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > GetFromHistory (
LookupKey ( " key2 " , seq ) , & value , /*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
LookupKey ( " key2 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context , & max_covering_tombstone_seq ,
ReadOptions ( ) ) ;
ASSERT_TRUE ( found ) ;
ASSERT_EQ ( " value2.2 " , value ) ;
@ -520,42 +529,48 @@ TEST_F(MemTableListTest, GetFromHistoryTest) {
// Verify keys are no longer in MemTableList
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key1 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key1 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key3 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key3 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
// Verify that the second memtable's keys are in the history
merge_context . Clear ( ) ;
found = list . current ( ) - > GetFromHistory (
LookupKey ( " key1 " , seq ) , & value , /*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
LookupKey ( " key1 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context , & max_covering_tombstone_seq ,
ReadOptions ( ) ) ;
ASSERT_TRUE ( found & & s . IsNotFound ( ) ) ;
merge_context . Clear ( ) ;
found = list . current ( ) - > GetFromHistory (
LookupKey ( " key3 " , seq ) , & value , /*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
LookupKey ( " key3 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context , & max_covering_tombstone_seq ,
ReadOptions ( ) ) ;
ASSERT_TRUE ( found ) ;
ASSERT_EQ ( " value3 " , value ) ;
// Verify that key2 from the first memtable is no longer in the history
merge_context . Clear ( ) ;
found = list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value ,
/*timestamp*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
found =
list . current ( ) - > Get ( LookupKey ( " key2 " , seq ) , & value , /*columns=*/ nullptr ,
/*timestamp=*/ nullptr , & s , & merge_context ,
& max_covering_tombstone_seq , ReadOptions ( ) ) ;
ASSERT_FALSE ( found ) ;
// Cleanup