RaidConfig constructor
const
RaidConfig({
- required RaidType type,
- required int diskCount,
- bool enableCompression = false,
- bool enableEncryption = false,
- List<
int> ? encryptionKey, - int chunkSize = _defaultChunkSize,
- Duration healthCheckInterval = const Duration(hours: 24),
- ParityAlgorithm parityAlgorithm = ParityAlgorithm.xor,
- int maxRetries = 3,
- bool writeVerification = true,
- 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.',
);