コード例 #1
0
ファイル: ParitySet.cs プロジェクト: codeicon/disParity
 public ParitySet(Config config, IEnvironment environment)
 {
     drives = new List<DataDrive>();
       Config = config;
       parity = new Parity(Config);
       Empty = true;
       env = environment;
 }
コード例 #2
0
ファイル: ParityChange.cs プロジェクト: codeicon/disParity
 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;
 }
コード例 #3
0
ファイル: ParityBlock.cs プロジェクト: codeicon/disParity
 public ParityBlock(Parity parity)
 {
     this.parity = parity;
       data = new byte[Parity.BLOCK_SIZE];
 }
コード例 #4
0
ファイル: ParityBlock.cs プロジェクト: swn32/disParity
 public ParityBlock(Parity parity)
 {
     this.parity = parity;
     data        = new byte[Parity.BLOCK_SIZE];
 }