Example #1
0
 public ParitySet(Config config, IEnvironment environment)
 {
     drives = new List<DataDrive>();
       Config = config;
       parity = new Parity(Config);
       Empty = true;
       env = environment;
 }
Example #2
0
 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;
 }
Example #3
0
 public ParityBlock(Parity parity)
 {
     this.parity = parity;
       data = new byte[Parity.BLOCK_SIZE];
 }
Example #4
0
 public ParityBlock(Parity parity)
 {
     this.parity = parity;
     data        = new byte[Parity.BLOCK_SIZE];
 }