StorageEngine constructor
StorageEngine({
- required SyncStorageDirectory directory,
- int arenaChunkSize = 1 << 20,
- int maxMemtableBytes = 64 << 20,
- int blockTargetSize = 64 * 1024,
- Durability durability = Durability.batched,
- bool autoFlush = false,
- bool autoCompact = true,
- int compactionThreshold = 4,
- MaintenanceScheduler? maintenanceScheduler,
- SegmentBuildFunction? backgroundSegmentBuilder,
- bool readOnly = false,
Creates an engine over directory.
Implementation
StorageEngine({
required SyncStorageDirectory directory,
int arenaChunkSize = 1 << 20,
this.maxMemtableBytes = 64 << 20,
this.blockTargetSize = 64 * 1024,
this.durability = Durability.batched,
this.autoFlush = false,
this.autoCompact = true,
this.compactionThreshold = 4,
this.maintenanceScheduler,
this.backgroundSegmentBuilder,
bool readOnly = false,
}) : _directory = directory,
_arenaChunkSize = arenaChunkSize,
readOnly = readOnly,
_walFile = readOnly
? (directory.existsSync(walFileName)
? directory.openSync(walFileName, create: false)
: MemoryStorageFile())
: directory.openSync(walFileName),
_arena = DocArena(chunkSize: arenaChunkSize) {
_wal = Wal(_walFile);
}