@ -44,15 +44,15 @@ using std::shared_ptr;
enum CompressionType : char {
enum CompressionType : char {
// NOTE: do not change the values of existing entries, as these are
// NOTE: do not change the values of existing entries, as these are
// part of the persistent format on disk.
// part of the persistent format on disk.
kNoCompression = 0x0 ,
kNoCompression = 0x0 ,
kSnappyCompression = 0x1 ,
kSnappyCompression = 0x1 ,
kZlibCompression = 0x2 ,
kZlibCompression = 0x2 ,
kBZip2Compression = 0x3
kBZip2Compression = 0x3
} ;
} ;
enum CompactionStyle : char {
enum CompactionStyle : char {
kCompactionStyleLevel = 0x0 , // level based compaction style
kCompactionStyleLevel = 0x0 , // level based compaction style
kCompactionStyleUniversal = 0x1 // Universal compaction style
kCompactionStyleUniversal = 0x1 // Universal compaction style
} ;
} ;
// Compression options for different compression algorithms like Zlib
// Compression options for different compression algorithms like Zlib
@ -60,12 +60,9 @@ struct CompressionOptions {
int window_bits ;
int window_bits ;
int level ;
int level ;
int strategy ;
int strategy ;
CompressionOptions ( ) : window_bits ( - 14 ) ,
CompressionOptions ( ) : window_bits ( - 14 ) , level ( - 1 ) , strategy ( 0 ) { }
level ( - 1 ) ,
CompressionOptions ( int wbits , int lev , int strategy )
strategy ( 0 ) { }
: window_bits ( wbits ) , level ( lev ) , strategy ( strategy ) { }
CompressionOptions ( int wbits , int lev , int strategy ) : window_bits ( wbits ) ,
level ( lev ) ,
strategy ( strategy ) { }
} ;
} ;
// Options to control the behavior of a database (passed to DB::Open)
// Options to control the behavior of a database (passed to DB::Open)
@ -216,7 +213,6 @@ struct Options {
// Default: 16
// Default: 16
int block_restart_interval ;
int block_restart_interval ;
// Compress blocks using the specified compression algorithm. This
// Compress blocks using the specified compression algorithm. This
// parameter can be changed dynamically.
// parameter can be changed dynamically.
//
//
@ -247,7 +243,7 @@ struct Options {
// java/C api hard to construct.
// java/C api hard to construct.
std : : vector < CompressionType > compression_per_level ;
std : : vector < CompressionType > compression_per_level ;
//different options for compression algorithms
// different options for compression algorithms
CompressionOptions compression_opts ;
CompressionOptions compression_opts ;
// If non-nullptr, use the specified filter policy to reduce disk reads.
// If non-nullptr, use the specified filter policy to reduce disk reads.
@ -326,7 +322,6 @@ struct Options {
// will be 20MB, total file size for level-2 will be 200MB,
// will be 20MB, total file size for level-2 will be 200MB,
// and total file size for level-3 will be 2GB.
// and total file size for level-3 will be 2GB.
// by default 'max_bytes_for_level_base' is 10MB.
// by default 'max_bytes_for_level_base' is 10MB.
uint64_t max_bytes_for_level_base ;
uint64_t max_bytes_for_level_base ;
// by default 'max_bytes_for_level_base' is 10.
// by default 'max_bytes_for_level_base' is 10.
@ -484,10 +479,19 @@ struct Options {
// order.
// order.
int table_cache_remove_scan_count_limit ;
int table_cache_remove_scan_count_limit ;
// size of one block in arena memory allocation.
// Size of one block in arena memory allocation.
// If <= 0, a proper value is automatically calculated (usually 1/10 of
//
// If <= 0, a proper value is automatically calculated (usually about 1/10 of
// writer_buffer_size).
// writer_buffer_size).
//
//
// There are two additonal restriction of the The specified size:
// (1) size should be in the range of [4096, 2 << 30] and
// (2) be the multiple of the CPU word (which helps with the memory
// alignment).
//
// We'll automatically check and adjust the size number to make sure it
// conforms to the restrictions.
//
// Default: 0
// Default: 0
size_t arena_block_size ;
size_t arena_block_size ;
@ -572,7 +576,12 @@ struct Options {
// Specify the file access pattern once a compaction is started.
// Specify the file access pattern once a compaction is started.
// It will be applied to all input files of a compaction.
// It will be applied to all input files of a compaction.
// Default: NORMAL
// Default: NORMAL
enum { NONE , NORMAL , SEQUENTIAL , WILLNEED } access_hint_on_compaction_start ;
enum {
NONE ,
NORMAL ,
SEQUENTIAL ,
WILLNEED
} access_hint_on_compaction_start ;
// Use adaptive mutex, which spins in the user space before resorting
// Use adaptive mutex, which spins in the user space before resorting
// to kernel. This could reduce context switch when the mutex is not
// to kernel. This could reduce context switch when the mutex is not
@ -622,7 +631,7 @@ struct Options {
// Default: emtpy vector -- no user-defined statistics collection will be
// Default: emtpy vector -- no user-defined statistics collection will be
// performed.
// performed.
std : : vector < std : : shared_ptr < TablePropertiesCollector > >
std : : vector < std : : shared_ptr < TablePropertiesCollector > >
table_properties_collectors ;
table_properties_collectors ;
// Allows thread-safe inplace updates. Requires Updates iff
// Allows thread-safe inplace updates. Requires Updates iff
// * key exists in current memtable
// * key exists in current memtable
@ -644,7 +653,7 @@ struct Options {
// the block cache. It will not page in data from the OS cache or data that
// the block cache. It will not page in data from the OS cache or data that
// resides in storage.
// resides in storage.
enum ReadTier {
enum ReadTier {
kReadAllTier = 0x0 , // data in memtable, block cache, OS cache or storage
kReadAllTier = 0x0 , // data in memtable, block cache, OS cache or storage
kBlockCacheTier = 0x1 // data in memtable or block cache
kBlockCacheTier = 0x1 // data in memtable or block cache
} ;
} ;
@ -697,13 +706,14 @@ struct ReadOptions {
prefix_seek ( false ) ,
prefix_seek ( false ) ,
snapshot ( nullptr ) ,
snapshot ( nullptr ) ,
prefix ( nullptr ) ,
prefix ( nullptr ) ,
read_tier ( kReadAllTier ) {
read_tier ( kReadAllTier ) { }
}
ReadOptions ( bool cksum , bool cache )
ReadOptions ( bool cksum , bool cache ) :
: verify_checksums ( cksum ) ,
verify_checksums ( cksum ) , fill_cache ( cache ) ,
fill_cache ( cache ) ,
prefix_seek ( false ) , snapshot ( nullptr ) , prefix ( nullptr ) ,
prefix_seek ( false ) ,
read_tier ( kReadAllTier ) {
snapshot ( nullptr ) ,
}
prefix ( nullptr ) ,
read_tier ( kReadAllTier ) { }
} ;
} ;
// Options that control write operations
// Options that control write operations
@ -730,10 +740,7 @@ struct WriteOptions {
// and the write may got lost after a crash.
// and the write may got lost after a crash.
bool disableWAL ;
bool disableWAL ;
WriteOptions ( )
WriteOptions ( ) : sync ( false ) , disableWAL ( false ) { }
: sync ( false ) ,
disableWAL ( false ) {
}
} ;
} ;
// Options that control flush operations
// Options that control flush operations
@ -742,9 +749,7 @@ struct FlushOptions {
// Default: true
// Default: true
bool wait ;
bool wait ;
FlushOptions ( )
FlushOptions ( ) : wait ( true ) { }
: wait ( true ) {
}
} ;
} ;
} // namespace rocksdb
} // namespace rocksdb