/// <summary> /// Constructor expecting DataBlockSize. /// </summary> /// <param name="dataBlockSize"></param> public DataBlock(DataBlockSize dataBlockSize) { if ((int)dataBlockSize > 0) { Data = new byte[(int)dataBlockSize - OverheadSize]; } }
/// <summary> /// Constructor expecting DataBlockSize. /// </summary> /// <param name="dataBlockSize"></param> public DataBlock(DataBlockSize dataBlockSize, List<Info> metaBlocks = null) { if ((int)dataBlockSize > 0) Data = new byte[(int)dataBlockSize - OverheadSize]; if (metaBlocks != null) { foldedDataAddresses = metaBlocks.ToArray(); contiguousBlockCount = metaBlocks[0].BlockCount; } }
/// <summary> /// Create a block of Data /// </summary> /// <param name="blockSize"></param> /// <returns></returns> public Sop.DataBlock CreateBlock(DataBlockSize blockSize) { Sop.DataBlock db = null; if (BlockRecycler != null) { db = BlockRecycler.GetRecycledObject(); } if (db == null) { db = new Sop.DataBlock(blockSize); } return(db); }
public void PreAllocateBlocks(DataBlockSize size) { if (!Enabled) { return; } int c = (int)(Capacity * .2); if (c < 10) { c = 10; } for (int i = 0; i < c; i++) { DataBlock d = new DataBlock(size); d.Orphaned = true; Recycle(d); } }
public LinkedItemOnDisk(DataBlockSize dataBlockSize) : base(dataBlockSize) { DiskBuffer = new Sop.DataBlock(dataBlockSize); }
/// <summary> /// Constructor expecting DataBlockSize /// </summary> /// <param name="dataBlockSize"></param> public HeaderData(DataBlockSize dataBlockSize) { this.diskBuffer = new Sop.DataBlock(dataBlockSize); }
/// <summary> /// Constructor expecting block size and Data to be persisted to disk /// </summary> /// <param name="dataBlockSize"></param> /// <param name="data"></param> public ItemOnDisk(DataBlockSize dataBlockSize, object data) : base(dataBlockSize) { Data = data; }
/// <summary> /// Constructor expecting block size /// </summary> /// <param name="dataBlockSize"></param> public ItemOnDisk(DataBlockSize dataBlockSize) : this(dataBlockSize, null) { }
public BTreeItemOnDisk(DataBlockSize dataBlockSize, object key, object value) { Key = key; Value = new ItemOnDisk(dataBlockSize, value); }
internal Sop.DataBlock CreateBlock(DataBlockSize size) { return(DataBlockDriver.CreateBlock(size)); }
/// <summary> /// Initialize InternalPersistent Object's DiskBuffer. /// </summary> /// <param name="dataBlockSize">Data Block of 'DataBlockSize' will be created and assigned as DiskBuffer</param> protected InternalPersistent(DataBlockSize dataBlockSize) { this.DataBlockSize = dataBlockSize; //this.DiskBuffer = new Sop.DataBlock(DataBlockSize); }