@ -10,21 +10,21 @@
namespace rocksdb {
namespace rocksdb {
AdaptiveTableFactory : : AdaptiveTableFactory (
AdaptiveTableFactory : : AdaptiveTableFactory (
std : : shared_ptr < TableFactory > table_factory_to_write ,
std : : shared_ptr < TableFactory > block_based_table_factory ,
std : : shared_ptr < TableFactory > block_based_table_factory ,
std : : shared_ptr < TableFactory > plain_table_factory ,
std : : shared_ptr < TableFactory > plain_table_factory )
std : : shared_ptr < TableFactory > table_factory_to_write )
: table_factory_to_write_ ( table_factory_to_write ) ,
: block_based_table_factory_ ( block_based_table_factory ) ,
block_based_table_factory_ ( block_based_table_factory ) ,
plain_table_factory_ ( plain_table_factory ) ,
plain_table_factory_ ( plain_table_factory ) {
table_factory_to_write_ ( table_factory_to_write ) {
if ( ! table_factory_to_write_ ) {
table_factory_to_write_ = block_based_table_factory_ ;
}
if ( ! plain_table_factory_ ) {
if ( ! plain_table_factory_ ) {
plain_table_factory_ . reset ( NewPlainTableFactory ( ) ) ;
plain_table_factory_ . reset ( NewPlainTableFactory ( ) ) ;
}
}
if ( ! block_based_table_factory_ ) {
if ( ! block_based_table_factory_ ) {
block_based_table_factory_ . reset ( NewBlockBasedTableFactory ( ) ) ;
block_based_table_factory_ . reset ( NewBlockBasedTableFactory ( ) ) ;
}
}
if ( ! table_factory_to_write_ ) {
table_factory_to_write_ = block_based_table_factory_ ;
}
}
}
extern const uint64_t kPlainTableMagicNumber ;
extern const uint64_t kPlainTableMagicNumber ;
@ -62,11 +62,11 @@ TableBuilder* AdaptiveTableFactory::NewTableBuilder(
}
}
extern TableFactory * NewAdaptiveTableFactory (
extern TableFactory * NewAdaptiveTableFactory (
std : : shared_ptr < TableFactory > table_factory_to_write ,
std : : shared_ptr < TableFactory > block_based_table_factory ,
std : : shared_ptr < TableFactory > block_based_table_factory ,
std : : shared_ptr < TableFactory > plain_table_factory ,
std : : shared_ptr < TableFactory > plain_table_factory ) {
std : : shared_ptr < TableFactory > table_factory_to_write ) {
return new AdaptiveTableFactory (
return new AdaptiveTableFactory (
block_based_table_factory , plain_table_factory , table_factory_to_write ) ;
table_factory_to_write , block_based_table_factory , plain_table_factory ) ;
}
}
} // namespace rocksdb
} // namespace rocksdb