Options class abstract

Options to control the behavior of a database (passed to LevelDB.open)

Constructors

Options.byDefault({Comparator? comparator, FilterPolicy? filterPolicy, bool createIfMissing = false, bool errorIfExists = false, bool paranoidChecks = false, Env? env, int writeBufferSize = 4 * 1024 * 1024, int maxOpenFiles = 1000, Cache? blockCache, int blockSize = 4 * 1024, int blockRestartInterval = 16, int maxFileSize = 2 * 1024 * 1024, CompressionType compressionType = CompressionType.snappy})
Create an Options object with default values for all fields.
factory

Properties

blockCache → Cache?
Control over blocks (user data is stored in a set of blocks, and a block is the unit of reading from disk).
no setter
blockRestartInterval int
Number of keys between restart points for delta encoding of keys. This parameter can be changed dynamically. Most clients should leave this parameter alone.
getter/setter pair
blockSize int
Approximate size of user data packed per block. Note that the block size specified here corresponds to uncompressed data. The actual size of the unit read from disk may be smaller if compression is enabled. This parameter can be changed dynamically.
getter/setter pair
comparator → Comparator?
Comparator used to define the order of keys in the table. Default: a comparator that uses lexicographic byte-wise ordering
no setter
compressionType CompressionType
Compress blocks using the specified compression algorithm. This parameter can be changed dynamically.
no setter
createIfMissing bool
If true, the database will be created if it is missing.
no setter
env → Env?
Use the specified object to interact with the environment, e.g. to read/write files, schedule background work, etc. Default: Env.byDefault
no setter
errorIfExists bool
If true, an error is raised if the database already exists.
no setter
filterPolicy → FilterPolicy?
If non-null, use the specified filter policy to reduce disk reads. Many applications will benefit from passing the result of FilterPolicy.bloom() here.
no setter
hashCode int
The hash code for this object.
no setteroverride
maxFileSize int
Leveldb will write up to this amount of bytes to a file before switching to a new one. Most clients should leave this parameter alone. However if your filesystem is more efficient with larger files, you could consider increasing the value. The downside will be longer compactions and hence longer latency/performance hiccups. Another reason to increase this parameter might be when you are initially populating a large database.
no setter
maxOpenFiles int
Number of open files that can be used by the DB. You may need to increase this if your database has a large working set (budget one open file per 2MB of working set).
no setter
paranoidChecks bool
If true, the implementation will do aggressive checking of the data it is processing and will stop early if it detects any errors. This may have unforeseen ramifications: for example, a corruption of one DB entry may cause a large number of entries to become unreadable or for the entire DB to become unopenable.
no setter
ptr Pointer<NativeType>
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
writeBufferSize int
Amount of data to build up in memory (backed by an unsorted log on disk) before converting to a sorted on-disk file.
no setter

Methods

dispose() → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object o) bool
The equality operator.
override