public ParitySet(Config config, IEnvironment environment) { drives = new List<DataDrive>(); Config = config; parity = new Parity(Config); Empty = true; env = environment; }
public ParityChange(Parity parity, Config config, UInt32 startBlock, UInt32 lengthInBlocks) { this.parity = parity; this.startBlock = startBlock; tempDir = config.TempDir; writingToMMF = true; UInt32 maxMMFBlocks = Parity.LengthInBlocks((long)config.MaxTempRAM * 1024 * 1024); UInt32 mmfBlocks = (lengthInBlocks < maxMMFBlocks) ? lengthInBlocks : maxMMFBlocks; try { mmf = MemoryMappedFile.CreateNew("disparity.tmp", (long)mmfBlocks * Parity.BLOCK_SIZE); mmfStream = mmf.CreateViewStream(); } catch (Exception e) { LogFile.Log("Could not create memory mapped file: " + e.Message); // We'll use a temp file only mmf = null; mmfStream = null; writingToMMF = false; } tempFileStream = null; parityBlock = new ParityBlock(parity); block = startBlock; }
public ParityBlock(Parity parity) { this.parity = parity; data = new byte[Parity.BLOCK_SIZE]; }