Description Usage Arguments Details Author(s)
Create a leveldb
object, to interact with a LevelDB
database.
1 2 3 4 |
path |
The path to the database, as stored on the filesystem.
This will create a directory at this path if one does not
exist (and if |
create_if_missing |
Create the database if one does not
already exist at |
error_if_exists |
Throw an error if the database already
exists at |
paranoid_checks |
If |
write_buffer_size |
Amount of data (in bytes) to build up in memory (backed by an unsorted log on disk) before converting to a sorted on-disk file. 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. Also, a larger write buffer will result in a longer recovery time the next time the database is opened. |
max_open_files |
Number of files that can be used by the database. You may need to increase this if your database has a large working set (budget one open file per 2MB of working set). (LevelDB default: 1000). |
block_size |
The approximate size of user data packed per block (user data is stored in a set of blocks, and a block is the unit of reading from disk). The block size here corresponds to uncompressed data; the actual size of the unit read frmo disk may be smaller if compression is enabled (LevelDB default: 4K) |
use_compression |
Compress blocks using the "Snappy"
compression algorithm (LevelDB default: |
cache_capacity |
The size of the cache to use. If
non- |
bloom_filter_bits_per_key |
If non-NULL, this sets up a "filter policy" to reduce disk reads. A good value for bits_per_key // is 10, which yields a filter with ~ 1 positive rate. Further information from the LevelDB headers (filter_policy.h) "This object is responsible for creating a small filter from a set of keys. These filters are stored in leveldb and are consulted automatically by leveldb to decide whether or not to read some information from disk. In many cases, a filter can cut down the number of disk seeks form a handful to a single disk seek per DB::Get() call" |
For all optional arguments (i.e., all but path
) a value of
NULL
means that we use the LevelDB
default; the
LevelDB default of each argument is indicated in the argument
documentation.
This function returns an "R6" class with a number of methods.
Rich FitzJohn
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.