@ -253,8 +253,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
ReadOptions ro ;
ReadOptions ro ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -286,8 +287,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
ReadOptions ro ;
ReadOptions ro ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -313,8 +315,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -346,8 +349,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -382,8 +386,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
@ -412,8 +417,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 7 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 7 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
SetPerfLevel ( kEnableCount ) ;
SetPerfLevel ( kEnableCount ) ;
ASSERT_TRUE ( GetPerfLevel ( ) = = kEnableCount ) ;
ASSERT_TRUE ( GetPerfLevel ( ) = = kEnableCount ) ;
@ -450,8 +456,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 4 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 4 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -476,8 +483,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
@ -499,8 +507,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -535,8 +544,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 7 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 7 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
SetPerfLevel ( kEnableCount ) ;
SetPerfLevel ( kEnableCount ) ;
ASSERT_TRUE ( GetPerfLevel ( ) = = kEnableCount ) ;
ASSERT_TRUE ( GetPerfLevel ( ) = = kEnableCount ) ;
@ -565,8 +575,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
ReadOptions ro ;
ReadOptions ro ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -608,8 +619,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
ReadOptions ro ;
ReadOptions ro ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
@ -640,8 +652,9 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
ReadOptions ro ;
ReadOptions ro ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
@ -671,8 +684,9 @@ TEST_F(DBIteratorTest, DBIteratorEmpty) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 0 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 0 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
}
@ -683,8 +697,9 @@ TEST_F(DBIteratorTest, DBIteratorEmpty) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 0 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 0 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
}
@ -706,8 +721,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkipCountSkips) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 2 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
2 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
@ -751,8 +767,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
options . statistics = ROCKSDB_NAMESPACE : : CreateDBStatistics ( ) ;
options . statistics = ROCKSDB_NAMESPACE : : CreateDBStatistics ( ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , i + 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , i + 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -787,8 +804,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , i + 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , i + 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -816,8 +834,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 202 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 202 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -849,8 +868,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
internal_iter - > Finish ( ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , i , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , i /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
@ -866,8 +886,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
internal_iter - > Finish ( ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 200 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 200 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
@ -901,8 +922,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , i + 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , i + 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -936,8 +958,9 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , i + 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , i + 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -986,8 +1009,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = 0 ;
ro . max_skippable_internal_keys = 0 ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1033,8 +1057,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = 2 ;
ro . max_skippable_internal_keys = 2 ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1078,8 +1103,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = 2 ;
ro . max_skippable_internal_keys = 2 ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1117,8 +1143,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = 2 ;
ro . max_skippable_internal_keys = 2 ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1153,8 +1180,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = 2 ;
ro . max_skippable_internal_keys = 2 ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1184,8 +1212,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = 2 ;
ro . max_skippable_internal_keys = 2 ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1222,8 +1251,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = 2 ;
ro . max_skippable_internal_keys = 2 ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1260,8 +1290,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = i ;
ro . max_skippable_internal_keys = i ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 2 * i + 1 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 2 * i + 1 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1314,8 +1345,9 @@ TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
ro . max_skippable_internal_keys = i ;
ro . max_skippable_internal_keys = i ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 2 * i + 1 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 2 * i + 1 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1353,8 +1385,9 @@ TEST_F(DBIteratorTest, DBIterator1) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 1 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
1 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1381,8 +1414,9 @@ TEST_F(DBIteratorTest, DBIterator2) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 0 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
0 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1406,8 +1440,9 @@ TEST_F(DBIteratorTest, DBIterator3) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 2 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
2 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1431,8 +1466,9 @@ TEST_F(DBIteratorTest, DBIterator4) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 4 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
4 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1465,8 +1501,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 0 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 0 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1488,8 +1525,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 1 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 1 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1511,8 +1549,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1534,8 +1573,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 3 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 3 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1557,8 +1597,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 4 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 4 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1580,8 +1621,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 5 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 5 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1603,8 +1645,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 6 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 6 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1624,8 +1667,9 @@ TEST_F(DBIteratorTest, DBIterator5) {
internal_iter - > Finish ( ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 10 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 10 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > Seek ( " b " ) ;
db_iter - > Seek ( " b " ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
@ -1655,8 +1699,9 @@ TEST_F(DBIteratorTest, DBIterator6) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 0 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 0 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1678,8 +1723,9 @@ TEST_F(DBIteratorTest, DBIterator6) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 1 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 1 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1701,8 +1747,9 @@ TEST_F(DBIteratorTest, DBIterator6) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1724,8 +1771,9 @@ TEST_F(DBIteratorTest, DBIterator6) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 3 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 3 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
}
@ -1743,8 +1791,9 @@ TEST_F(DBIteratorTest, DBIterator6) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 4 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 4 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1766,8 +1815,9 @@ TEST_F(DBIteratorTest, DBIterator6) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 5 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 5 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1789,8 +1839,9 @@ TEST_F(DBIteratorTest, DBIterator6) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 6 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 6 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1832,8 +1883,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 0 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 0 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1867,8 +1919,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 2 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 2 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1908,8 +1961,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 4 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 4 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1949,8 +2003,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 5 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 5 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1995,8 +2050,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 6 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 6 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -2042,8 +2098,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 7 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 7 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -2083,8 +2140,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 9 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 9 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -2130,8 +2188,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 13 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 13 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -2178,8 +2237,9 @@ TEST_F(DBIteratorTest, DBIterator7) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
env_ , ro , cf_options , mutable_cf_options , BytewiseComparator ( ) ,
internal_iter , 14 , options . max_sequential_skip_in_iterations ,
internal_iter , nullptr /* version */ , 14 /* sequence */ ,
nullptr /*read_callback*/ ) ) ;
options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -2209,8 +2269,9 @@ TEST_F(DBIteratorTest, DBIterator8) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
10 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
@ -2240,8 +2301,9 @@ TEST_F(DBIteratorTest, DBIterator9) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
10 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -2307,8 +2369,9 @@ TEST_F(DBIteratorTest, DBIterator10) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
10 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > Seek ( " c " ) ;
db_iter - > Seek ( " c " ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -2347,8 +2410,8 @@ TEST_F(DBIteratorTest, SeekToLastOccurrenceSeq0) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 , 0 /* force seek */,
BytewiseComparator ( ) , internal_iter , nullptr /* version */,
nullptr /*read_callback*/ ) ) ;
10 /* sequence */ , 0 /* force seek */ , nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -2376,8 +2439,9 @@ TEST_F(DBIteratorTest, DBIterator11) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 1 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
1 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -2403,7 +2467,8 @@ TEST_F(DBIteratorTest, DBIterator12) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 , 0 , nullptr /*read_callback*/ ) ) ;
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
10 /* sequence */ , 0 /* force seek */ , nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " c " ) ;
@ -2440,7 +2505,9 @@ TEST_F(DBIteratorTest, DBIterator13) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 2 , 3 , nullptr /*read_callback*/ ) ) ;
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
2 /* sequence */ , 3 /* max_sequential_skip_in_iterations */ ,
nullptr /* read_callback */ ) ) ;
db_iter - > Seek ( " b " ) ;
db_iter - > Seek ( " b " ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , key ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , key ) ;
@ -2468,7 +2535,9 @@ TEST_F(DBIteratorTest, DBIterator14) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 4 , 1 , nullptr /*read_callback*/ ) ) ;
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
4 /* sequence */ , 1 /* max_sequential_skip_in_iterations */ ,
nullptr /* read_callback */ ) ) ;
db_iter - > Seek ( " b " ) ;
db_iter - > Seek ( " b " ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
@ -2495,8 +2564,9 @@ TEST_F(DBIteratorTest, DBIteratorTestDifferentialSnapshots) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 13 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr ) ) ;
13 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
// Expecting InternalKeys in [5,8] range with correct type
// Expecting InternalKeys in [5,8] range with correct type
int seqnums [ 4 ] = { 5 , 8 , 11 , 13 } ;
int seqnums [ 4 ] = { 5 , 8 , 11 , 13 } ;
std : : string user_keys [ 4 ] = { " 1 " , " 2 " , " 3 " , " 4 " } ;
std : : string user_keys [ 4 ] = { " 1 " , " 2 " , " 3 " , " 4 " } ;
@ -2530,8 +2600,9 @@ TEST_F(DBIteratorTest, DBIteratorTestDifferentialSnapshots) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 13 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr ) ) ;
13 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
// Expecting InternalKeys in [5,8] range with correct type
// Expecting InternalKeys in [5,8] range with correct type
int seqnums [ 4 ] = { 5 , 8 , 11 , 13 } ;
int seqnums [ 4 ] = { 5 , 8 , 11 , 13 } ;
EntryType key_types [ 4 ] = { EntryType : : kEntryDelete , EntryType : : kEntryDelete ,
EntryType key_types [ 4 ] = { EntryType : : kEntryDelete , EntryType : : kEntryDelete ,
@ -2580,9 +2651,9 @@ class DBIterWithMergeIterTest : public testing::Test {
db_iter_ . reset ( NewDBIterator (
db_iter_ . reset ( NewDBIterator (
env_ , ro_ , ImmutableCFOptions ( options_ ) , MutableCFOptions ( options_ ) ,
env_ , ro_ , ImmutableCFOptions ( options_ ) , MutableCFOptions ( options_ ) ,
BytewiseComparator ( ) , merge_iter ,
BytewiseComparator ( ) , merge_iter , nullptr /* version */ ,
8 /* read data earlier than seqId 8 */ ,
8 /* read data earlier than seqId 8 */ ,
3 /* max iterators before reseek */ , nullptr /*read_callback*/ ) ) ;
3 /* max iterators before reseek */ , nullptr /* read_callback */ ) ) ;
}
}
Env * env_ ;
Env * env_ ;
@ -3020,8 +3091,9 @@ TEST_F(DBIteratorTest, SeekPrefixTombstones) {
ro . prefix_same_as_start = true ;
ro . prefix_same_as_start = true ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
10 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
int skipped_keys = 0 ;
int skipped_keys = 0 ;
@ -3056,8 +3128,8 @@ TEST_F(DBIteratorTest, SeekToFirstLowerBound) {
Options options ;
Options options ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 /* sequence */,
BytewiseComparator ( ) , internal_iter , nullptr /* version */,
options . max_sequential_skip_in_iterations ,
10 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToFirst ( ) ;
db_iter - > SeekToFirst ( ) ;
@ -3095,8 +3167,9 @@ TEST_F(DBIteratorTest, PrevLowerBound) {
Options options ;
Options options ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 /* sequence */ ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /* read_callback */ ) ) ;
10 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
db_iter - > SeekToLast ( ) ;
db_iter - > SeekToLast ( ) ;
for ( int i = kNumKeys ; i > = kLowerBound ; - - i ) {
for ( int i = kNumKeys ; i > = kLowerBound ; - - i ) {
@ -3123,8 +3196,9 @@ TEST_F(DBIteratorTest, SeekLessLowerBound) {
Options options ;
Options options ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
env_ , ro , ImmutableCFOptions ( options ) , MutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 /* sequence */ ,
BytewiseComparator ( ) , internal_iter , nullptr /* version */ ,
options . max_sequential_skip_in_iterations , nullptr /* read_callback */ ) ) ;
10 /* sequence */ , options . max_sequential_skip_in_iterations ,
nullptr /* read_callback */ ) ) ;
auto before_lower_bound_str = std : : to_string ( kLowerBound - 1 ) ;
auto before_lower_bound_str = std : : to_string ( kLowerBound - 1 ) ;
Slice before_lower_bound ( lower_bound_str ) ;
Slice before_lower_bound ( lower_bound_str ) ;
@ -3148,8 +3222,9 @@ TEST_F(DBIteratorTest, ReverseToForwardWithDisappearingKeys) {
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ReadOptions ( ) , ImmutableCFOptions ( options ) ,
env_ , ReadOptions ( ) , ImmutableCFOptions ( options ) ,
MutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter , 10 ,
MutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
options . max_sequential_skip_in_iterations , nullptr /*read_callback*/ ) ) ;
nullptr /* version */ , 10 /* sequence */ ,
options . max_sequential_skip_in_iterations , nullptr /* read_callback */ ) ) ;
db_iter - > SeekForPrev ( " a " ) ;
db_iter - > SeekForPrev ( " a " ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;