diff options
Diffstat (limited to 'include')
-rwxr-xr-x[-rw-r--r--] | include/leveldb/cache.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/comparator.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/db.h | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/env.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/iterator.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/options.h | 27 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/slice.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/status.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/table.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/table_builder.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | include/leveldb/write_batch.h | 0 |
11 files changed, 23 insertions, 16 deletions
diff --git a/include/leveldb/cache.h b/include/leveldb/cache.h index 79196d1..79196d1 100644..100755 --- a/include/leveldb/cache.h +++ b/include/leveldb/cache.h diff --git a/include/leveldb/comparator.h b/include/leveldb/comparator.h index 4e00e4d..4e00e4d 100644..100755 --- a/include/leveldb/comparator.h +++ b/include/leveldb/comparator.h diff --git a/include/leveldb/db.h b/include/leveldb/db.h index 74d50d3..f18ded3 100644..100755 --- a/include/leveldb/db.h +++ b/include/leveldb/db.h @@ -13,7 +13,7 @@ namespace leveldb { static const int kMajorVersion = 1; -static const int kMinorVersion = 0; +static const int kMinorVersion = 1; struct Options; struct ReadOptions; @@ -49,7 +49,7 @@ class DB { // Set the database entry for "key" to "value". Returns OK on success, // and a non-OK status on error. - // Note: consider setting options.sync = false. + // Note: consider setting options.sync = true. virtual Status Put(const WriteOptions& options, const Slice& key, const Slice& value) = 0; @@ -57,12 +57,12 @@ class DB { // Remove the database entry (if any) for "key". Returns OK on // success, and a non-OK status on error. It is not an error if "key" // did not exist in the database. - // Note: consider setting options.sync = false. + // Note: consider setting options.sync = true. virtual Status Delete(const WriteOptions& options, const Slice& key) = 0; // Apply the specified updates to the database. // Returns OK on success, non-OK on failure. - // Note: consider setting options.sync = false. + // Note: consider setting options.sync = true. virtual Status Write(const WriteOptions& options, WriteBatch* updates) = 0; // If the database contains an entry for "key" store the @@ -103,7 +103,9 @@ class DB { // // "leveldb.num-files-at-level<N>" - return the number of files at level <N>, // where <N> is an ASCII representation of a level number (e.g. "0"). - virtual bool GetProperty(const Slice& property, uint64_t* value) = 0; + // "leveldb.stats" - returns a multi-line string that describes statistics + // about the internal operation of the DB. + virtual bool GetProperty(const Slice& property, std::string* value) = 0; // For each i in [0,n-1], store in "sizes[i]", the approximate // file system space used by keys in "[range[i].start .. range[i].limit)". diff --git a/include/leveldb/env.h b/include/leveldb/env.h index 4b6e712..4b6e712 100644..100755 --- a/include/leveldb/env.h +++ b/include/leveldb/env.h diff --git a/include/leveldb/iterator.h b/include/leveldb/iterator.h index 1866fb5..1866fb5 100644..100755 --- a/include/leveldb/iterator.h +++ b/include/leveldb/iterator.h diff --git a/include/leveldb/options.h b/include/leveldb/options.h index 0b65624..87d388e 100644..100755 --- a/include/leveldb/options.h +++ b/include/leveldb/options.h @@ -69,15 +69,14 @@ struct Options { // ------------------- // Parameters that affect performance - // Amount of data to build up in memory before converting to an - // on-disk file. + // Amount of data to build up in memory (backed by an unsorted log + // on disk) before converting to a sorted on-disk file. // - // Some DB operations may encounter a delay proportional to the size - // of this parameter. Therefore we recommend against increasing - // this parameter unless you are willing to live with an occasional - // slow operation in exchange for faster bulk loading throughput. + // Larger values increase performance, especially during bulk loads. + // Up to two write buffers may be held in memory at the same time, + // so you may wish to adjust this parameter to control memory usage. // - // Default: 1MB + // Default: 4MB size_t write_buffer_size; // Number of open files that can be used by the DB. You may need to @@ -100,7 +99,8 @@ struct Options { // Control over blocks (user data is stored in a set of blocks, and // a block is the unit of reading from disk). - // Use the specified cache for blocks (if non-NULL). + // If non-NULL, use the specified cache for blocks. + // If NULL, leveldb will automatically create and use an 8MB internal cache. // Default: NULL Cache* block_cache; @@ -109,7 +109,7 @@ struct Options { // actual size of the unit read from disk may be smaller if // compression is enabled. This parameter can be changed dynamically. // - // Default: 8K + // Default: 4K int block_size; // Number of keys between restart points for delta encoding of keys. @@ -177,7 +177,12 @@ struct WriteOptions { // crashes (i.e., the machine does not reboot), no writes will be // lost even if sync==false. // - // Default: true + // In other words, a DB write with sync==false has similar + // crash semantics as the "write()" system call. A DB write + // with sync==true has similar crash semantics to a "write()" + // system call followed by "fsync()". + // + // Default: false bool sync; // If "post_write_snapshot" is non-NULL, and the write succeeds, @@ -193,7 +198,7 @@ struct WriteOptions { const Snapshot** post_write_snapshot; WriteOptions() - : sync(true), + : sync(false), post_write_snapshot(NULL) { } }; diff --git a/include/leveldb/slice.h b/include/leveldb/slice.h index 62cb894..62cb894 100644..100755 --- a/include/leveldb/slice.h +++ b/include/leveldb/slice.h diff --git a/include/leveldb/status.h b/include/leveldb/status.h index 47e3edf..47e3edf 100644..100755 --- a/include/leveldb/status.h +++ b/include/leveldb/status.h diff --git a/include/leveldb/table.h b/include/leveldb/table.h index bd99176..bd99176 100644..100755 --- a/include/leveldb/table.h +++ b/include/leveldb/table.h diff --git a/include/leveldb/table_builder.h b/include/leveldb/table_builder.h index 49d2d51..49d2d51 100644..100755 --- a/include/leveldb/table_builder.h +++ b/include/leveldb/table_builder.h diff --git a/include/leveldb/write_batch.h b/include/leveldb/write_batch.h index 3411952..3411952 100644..100755 --- a/include/leveldb/write_batch.h +++ b/include/leveldb/write_batch.h |