@ -3,6 +3,7 @@
// LICENSE file in the root directory of this source tree. An additional grant
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
// of patent rights can be found in the PATENTS file in the same directory.
# include "db/db_impl_readonly.h"
# include "db/db_impl_readonly.h"
# include "utilities/compacted_db/compacted_db_impl.h"
# include "utilities/compacted_db/compacted_db_impl.h"
# include "db/db_impl.h"
# include "db/db_impl.h"
@ -13,6 +14,8 @@
namespace rocksdb {
namespace rocksdb {
# ifndef ROCKSDB_LITE
DBImplReadOnly : : DBImplReadOnly ( const DBOptions & db_options ,
DBImplReadOnly : : DBImplReadOnly ( const DBOptions & db_options ,
const std : : string & dbname )
const std : : string & dbname )
: DBImpl ( db_options , dbname ) {
: DBImpl ( db_options , dbname ) {
@ -97,12 +100,10 @@ Status DB::OpenForReadOnly(const Options& options, const std::string& dbname,
// Try to first open DB as fully compacted DB
// Try to first open DB as fully compacted DB
Status s ;
Status s ;
# ifndef ROCKSDB_LITE
s = CompactedDBImpl : : Open ( options , dbname , dbptr ) ;
s = CompactedDBImpl : : Open ( options , dbname , dbptr ) ;
if ( s . ok ( ) ) {
if ( s . ok ( ) ) {
return s ;
return s ;
}
}
# endif
DBOptions db_options ( options ) ;
DBOptions db_options ( options ) ;
ColumnFamilyOptions cf_options ( options ) ;
ColumnFamilyOptions cf_options ( options ) ;
@ -167,5 +168,20 @@ Status DB::OpenForReadOnly(
return s ;
return s ;
}
}
# else // !ROCKSDB_LITE
Status DB : : OpenForReadOnly ( const Options & options , const std : : string & dbname ,
DB * * dbptr , bool error_if_log_file_exist ) {
return Status : : NotSupported ( " Not supported in ROCKSDB_LITE. " ) ;
}
Status DB : : OpenForReadOnly (
const DBOptions & db_options , const std : : string & dbname ,
const std : : vector < ColumnFamilyDescriptor > & column_families ,
std : : vector < ColumnFamilyHandle * > * handles , DB * * dbptr ,
bool error_if_log_file_exist ) {
return Status : : NotSupported ( " Not supported in ROCKSDB_LITE. " ) ;
}
# endif // !ROCKSDB_LITE
} // namespace rocksdb
} // namespace rocksdb