StorageEngine constructor

StorageEngine({
  1. required SyncStorageDirectory directory,
  2. int arenaChunkSize = 1 << 20,
  3. int maxMemtableBytes = 64 << 20,
  4. int blockTargetSize = 64 * 1024,
  5. Durability durability = Durability.batched,
  6. bool autoFlush = false,
  7. bool autoCompact = true,
  8. int compactionThreshold = 4,
  9. MaintenanceScheduler? maintenanceScheduler,
  10. SegmentBuildFunction? backgroundSegmentBuilder,
  11. 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);
}