public void EnsurePersistenceTest() { var numberOfSectorTesting = 5; _store.Initialize(); // manually make a sector var sector = new Sector(_sectorSize); var contentBytes = new byte[sector.Contents.Length]; for (var i = 0; i < numberOfSectorTesting; i++) { _rnd.NextBytes(contentBytes); contentBytes.AsSpan().CopyTo(sector.Contents); var index = _store.AllocateSectors(4); _store.Write(index, sector); } _store.EnsurePersistence(); _store.Dispose(); // reinit store _store = _storeFixiture.Create(); _store.Initialize(); var sectorIndex = new SectorIndex((numberOfSectorTesting - 1) * 4); var storeProvided = _store.Read(sectorIndex); Assert.True(storeProvided.Contents.SequenceEqual(contentBytes.AsSpan())); }
/// <param name="config"></param> /// <param name="lineage"></param> /// <param name="store"></param> /// <param name="subTable"></param> public SozuTable(SozuConfig config, ILineage lineage, ISectorStore store, SozuTable subTable = null) { _config = config; _lineage = lineage; _store = store; _subTable = subTable; _residue = TxoPack.Create(); _rangeOutputs = TxoPack.Create(); _deserialized = TxoPack.Create(); _complement = TxoPack.Create(); _kept = TxoPack.Create(); _flowDown = TxoPack.Create(); _merged = TxoPack.Create(2); store.Initialize(); if (config.ImplicitSectors && !store.HasSectors()) { store.AllocateSectors(1 << config.SectorBitDepth); EnsurePersistence(); } }
public void StoreInit() { _store.Initialize(); Assert.True(_storeFixiture.CheckFileExistence(), "Cannot find hot store persistence file or store persistence file! "); }