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