@ -394,10 +394,9 @@ class TableConstructor : public Constructor {
InternalIterator * NewIterator (
InternalIterator * NewIterator (
const SliceTransform * prefix_extractor ) const override {
const SliceTransform * prefix_extractor ) const override {
ReadOptions ro ;
InternalIterator * iter = table_reader_ - > NewIterator (
InternalIterator * iter = table_reader_ - > NewIterator (
ro , prefix_extractor , /*arena=*/ nullptr , /*skip_filters=*/ false ,
read_ options_ , prefix_extractor , /*arena=*/ nullptr ,
TableReaderCaller : : kUncategorized ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ;
if ( convert_to_internal_key_ ) {
if ( convert_to_internal_key_ ) {
return new KeyConvertingIterator ( iter ) ;
return new KeyConvertingIterator ( iter ) ;
} else {
} else {
@ -452,6 +451,7 @@ class TableConstructor : public Constructor {
file_reader_ . reset ( ) ;
file_reader_ . reset ( ) ;
}
}
const ReadOptions read_options_ ;
uint64_t uniq_id_ ;
uint64_t uniq_id_ ;
std : : unique_ptr < WritableFileWriter > file_writer_ ;
std : : unique_ptr < WritableFileWriter > file_writer_ ;
std : : unique_ptr < RandomAccessFileReader > file_reader_ ;
std : : unique_ptr < RandomAccessFileReader > file_reader_ ;
@ -1883,8 +1883,9 @@ TEST_P(BlockBasedTableTest, SkipPrefixBloomFilter) {
const MutableCFOptions new_moptions ( options ) ;
const MutableCFOptions new_moptions ( options ) ;
c . Reopen ( new_ioptions , new_moptions ) ;
c . Reopen ( new_ioptions , new_moptions ) ;
auto reader = c . GetTableReader ( ) ;
auto reader = c . GetTableReader ( ) ;
ReadOptions read_options ;
std : : unique_ptr < InternalIterator > db_iter ( reader - > NewIterator (
std : : unique_ptr < InternalIterator > db_iter ( reader - > NewIterator (
ReadOptions ( ) , new_moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
read_options , new_moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
// Test point lookup
// Test point lookup
@ -1945,8 +1946,9 @@ void TableTest::IndexTest(BlockBasedTableOptions table_options) {
ASSERT_EQ ( 5u , props - > num_data_blocks ) ;
ASSERT_EQ ( 5u , props - > num_data_blocks ) ;
// TODO(Zhongyi): update test to use MutableCFOptions
// TODO(Zhongyi): update test to use MutableCFOptions
ReadOptions read_options ;
std : : unique_ptr < InternalIterator > index_iter ( reader - > NewIterator (
std : : unique_ptr < InternalIterator > index_iter ( reader - > NewIterator (
ReadOptions ( ) , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
read_options , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
// -- Find keys do not exist, but have common prefix.
// -- Find keys do not exist, but have common prefix.
@ -2254,8 +2256,9 @@ TEST_P(BlockBasedTableTest, BinaryIndexWithFirstKey2) {
auto reader = c . GetTableReader ( ) ;
auto reader = c . GetTableReader ( ) ;
auto props = reader - > GetTableProperties ( ) ;
auto props = reader - > GetTableProperties ( ) ;
ASSERT_EQ ( 4u , props - > num_data_blocks ) ;
ASSERT_EQ ( 4u , props - > num_data_blocks ) ;
ReadOptions read_options ;
std : : unique_ptr < InternalIterator > iter ( reader - > NewIterator (
std : : unique_ptr < InternalIterator > iter ( reader - > NewIterator (
ReadOptions ( ) , /*prefix_extractor=*/ nullptr , /*arena=*/ nullptr ,
read_options , /*prefix_extractor=*/ nullptr , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ,
/*compaction_readahead_size=*/ 0 , /*allow_unprepared_value=*/ true ) ) ;
/*compaction_readahead_size=*/ 0 , /*allow_unprepared_value=*/ true ) ) ;
@ -2438,8 +2441,9 @@ TEST_P(BlockBasedTableTest, BinaryIndexWithFirstKeyGlobalSeqno) {
auto reader = c . GetTableReader ( ) ;
auto reader = c . GetTableReader ( ) ;
auto props = reader - > GetTableProperties ( ) ;
auto props = reader - > GetTableProperties ( ) ;
ASSERT_EQ ( 1u , props - > num_data_blocks ) ;
ASSERT_EQ ( 1u , props - > num_data_blocks ) ;
ReadOptions read_options ;
std : : unique_ptr < InternalIterator > iter ( reader - > NewIterator (
std : : unique_ptr < InternalIterator > iter ( reader - > NewIterator (
ReadOptions ( ) , /*prefix_extractor=*/ nullptr , /*arena=*/ nullptr ,
read_options , /*prefix_extractor=*/ nullptr , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ,
/*compaction_readahead_size=*/ 0 , /*allow_unprepared_value=*/ true ) ) ;
/*compaction_readahead_size=*/ 0 , /*allow_unprepared_value=*/ true ) ) ;
@ -2668,8 +2672,9 @@ TEST_P(BlockBasedTableTest, TracingIterator) {
GetPlainInternalComparator ( options . comparator ) , & keys , & kvmap ) ;
GetPlainInternalComparator ( options . comparator ) , & keys , & kvmap ) ;
for ( uint32_t i = 1 ; i < = 2 ; i + + ) {
for ( uint32_t i = 1 ; i < = 2 ; i + + ) {
ReadOptions read_options ;
std : : unique_ptr < InternalIterator > iter ( c . GetTableReader ( ) - > NewIterator (
std : : unique_ptr < InternalIterator > iter ( c . GetTableReader ( ) - > NewIterator (
ReadOptions ( ) , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
read_options , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUserIterator ) ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUserIterator ) ) ;
iter - > SeekToFirst ( ) ;
iter - > SeekToFirst ( ) ;
while ( iter - > Valid ( ) ) {
while ( iter - > Valid ( ) ) {
@ -3883,8 +3888,9 @@ TEST_P(IndexBlockRestartIntervalTest, IndexBlockRestartInterval) {
& kvmap ) ;
& kvmap ) ;
auto reader = c . GetTableReader ( ) ;
auto reader = c . GetTableReader ( ) ;
ReadOptions read_options ;
std : : unique_ptr < InternalIterator > db_iter ( reader - > NewIterator (
std : : unique_ptr < InternalIterator > db_iter ( reader - > NewIterator (
ReadOptions ( ) , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
read_options , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
// Test point lookup
// Test point lookup
@ -4070,6 +4076,7 @@ TEST_P(BlockBasedTableTest, DISABLED_TableWithGlobalSeqno) {
// Helper function to get the contents of the table InternalIterator
// Helper function to get the contents of the table InternalIterator
std : : unique_ptr < TableReader > table_reader ;
std : : unique_ptr < TableReader > table_reader ;
const ReadOptions read_options ;
std : : function < InternalIterator * ( ) > GetTableInternalIter = [ & ] ( ) {
std : : function < InternalIterator * ( ) > GetTableInternalIter = [ & ] ( ) {
std : : unique_ptr < RandomAccessFileReader > file_reader (
std : : unique_ptr < RandomAccessFileReader > file_reader (
test : : GetRandomAccessFileReader (
test : : GetRandomAccessFileReader (
@ -4081,7 +4088,7 @@ TEST_P(BlockBasedTableTest, DISABLED_TableWithGlobalSeqno) {
std : : move ( file_reader ) , ss_rw . contents ( ) . size ( ) , & table_reader ) ;
std : : move ( file_reader ) , ss_rw . contents ( ) . size ( ) , & table_reader ) ;
return table_reader - > NewIterator (
return table_reader - > NewIterator (
ReadOptions ( ) , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
read_options , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ;
} ;
} ;
@ -4252,8 +4259,9 @@ TEST_P(BlockBasedTableTest, BlockAlignTest) {
GetPlainInternalComparator ( options2 . comparator ) ) ,
GetPlainInternalComparator ( options2 . comparator ) ) ,
std : : move ( file_reader ) , ss_rw . contents ( ) . size ( ) , & table_reader ) ) ;
std : : move ( file_reader ) , ss_rw . contents ( ) . size ( ) , & table_reader ) ) ;
ReadOptions read_options ;
std : : unique_ptr < InternalIterator > db_iter ( table_reader - > NewIterator (
std : : unique_ptr < InternalIterator > db_iter ( table_reader - > NewIterator (
ReadOptions ( ) , moptions2 . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
read_options , moptions2 . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
int expected_key = 1 ;
int expected_key = 1 ;
@ -4548,8 +4556,9 @@ TEST_P(BlockBasedTableTest, DataBlockHashIndex) {
auto reader = c . GetTableReader ( ) ;
auto reader = c . GetTableReader ( ) ;
std : : unique_ptr < InternalIterator > seek_iter ;
std : : unique_ptr < InternalIterator > seek_iter ;
ReadOptions read_options ;
seek_iter . reset ( reader - > NewIterator (
seek_iter . reset ( reader - > NewIterator (
ReadOptions ( ) , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
read_options , moptions . prefix_extractor . get ( ) , /*arena=*/ nullptr ,
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
/*skip_filters=*/ false , TableReaderCaller : : kUncategorized ) ) ;
for ( int i = 0 ; i < 2 ; + + i ) {
for ( int i = 0 ; i < 2 ; + + i ) {
ReadOptions ro ;
ReadOptions ro ;