RaidConfig constructor

const RaidConfig({
  1. required RaidType type,
  2. required int diskCount,
  3. bool enableCompression = false,
  4. bool enableEncryption = false,
  5. List<int>? encryptionKey,
  6. int chunkSize = _defaultChunkSize,
  7. Duration healthCheckInterval = const Duration(hours: 24),
  8. ParityAlgorithm parityAlgorithm = ParityAlgorithm.xor,
  9. int maxRetries = 3,
  10. bool writeVerification = true,
  11. RaidLogLevel logLevel = RaidLogLevel.info,
})

Creates a RaidConfig.

Implementation

const RaidConfig({
  required this.type,
  required this.diskCount,
  this.enableCompression = false,
  this.enableEncryption = false,
  this.encryptionKey,
  this.chunkSize = _defaultChunkSize,
  this.healthCheckInterval = const Duration(hours: 24),
  this.parityAlgorithm = ParityAlgorithm.xor,
  this.maxRetries = 3,
  this.writeVerification = true,
  this.logLevel = RaidLogLevel.info,
})  : assert(diskCount >= 1, 'At least 1 disk is required.'),
      assert(
        type == RaidType.raid0 || diskCount >= 2,
        'RAID 1 and RAID 5 require at least 2 disks.',
      ),
      assert(chunkSize > 0, 'chunkSize must be positive.'),
      assert(
        !enableEncryption || encryptionKey != null,
        'encryptionKey must be supplied when enableEncryption is true.',
      ),
      assert(
        type != RaidType.raid5 || diskCount >= 3,
        'RAID 5 requires at least 3 disks.',
      );