@ -60,12 +60,9 @@ struct CompressionOptions {
int window_bits ;
int level ;
int strategy ;
CompressionOptions ( ) : window_bits ( - 14 ) ,
level ( - 1 ) ,
strategy ( 0 ) { }
CompressionOptions ( int wbits , int lev , int strategy ) : window_bits ( wbits ) ,
level ( lev ) ,
strategy ( strategy ) { }
CompressionOptions ( ) : window_bits ( - 14 ) , level ( - 1 ) , strategy ( 0 ) { }
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)
@ -216,7 +213,6 @@ struct Options {
// Default: 16
int block_restart_interval ;
// Compress blocks using the specified compression algorithm. This
// parameter can be changed dynamically.
//
@ -247,7 +243,7 @@ struct Options {
// java/C api hard to construct.
std : : vector < CompressionType > compression_per_level ;
//different options for compression algorithms
// different options for compression algorithms
CompressionOptions compression_opts ;
// 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,
// and total file size for level-3 will be 2GB.
// by default 'max_bytes_for_level_base' is 10MB.
uint64_t max_bytes_for_level_base ;
// by default 'max_bytes_for_level_base' is 10.
@ -484,10 +479,19 @@ struct Options {
// order.
int table_cache_remove_scan_count_limit ;
// size of one block in arena memory allocation.
// If <= 0, a proper value is automatically calculated (usually 1/10 of
// Size of one block in arena memory allocation.
//
// If <= 0, a proper value is automatically calculated (usually about 1/10 of
// 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
size_t arena_block_size ;
@ -572,7 +576,12 @@ struct Options {
// Specify the file access pattern once a compaction is started.
// It will be applied to all input files of a compaction.
// 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
// to kernel. This could reduce context switch when the mutex is not
@ -697,13 +706,14 @@ struct ReadOptions {
prefix_seek ( false ) ,
snapshot ( nullptr ) ,
prefix ( nullptr ) ,
read_tier ( kReadAllTier ) {
}
ReadOptions ( bool cksum , bool cache ) :
verify_checksums ( cksum ) , fill_cache ( cache ) ,
prefix_seek ( false ) , snapshot ( nullptr ) , prefix ( nullptr ) ,
read_tier ( kReadAllTier ) {
}
read_tier ( kReadAllTier ) { }
ReadOptions ( bool cksum , bool cache )
: verify_checksums ( cksum ) ,
fill_cache ( cache ) ,
prefix_seek ( false ) ,
snapshot ( nullptr ) ,
prefix ( nullptr ) ,
read_tier ( kReadAllTier ) { }
} ;
// Options that control write operations
@ -730,10 +740,7 @@ struct WriteOptions {
// and the write may got lost after a crash.
bool disableWAL ;
WriteOptions ( )
: sync ( false ) ,
disableWAL ( false ) {
}
WriteOptions ( ) : sync ( false ) , disableWAL ( false ) { }
} ;
// Options that control flush operations
@ -742,9 +749,7 @@ struct FlushOptions {
// Default: true
bool wait ;
FlushOptions ( )
: wait ( true ) {
}
FlushOptions ( ) : wait ( true ) { }
} ;
} // namespace rocksdb