public void Close() { _pageStore.Close(); _pageStore.Dispose(); _resourceIndex.Dispose(); _resourceTable.Dispose(); }
private void Dispose(bool disposing) { if (disposing) { if (!_disposed) { _pageStore.Close(); _disposed = true; } } }
private void BuildAndScan(IPageStore pageStore, string pageStoreName, PersistenceType persistenceType, int keyCount) { var config = new BPlusTreeConfiguration(8, 64, pageStore.PageSize); var builder = new BPlusTreeBuilder(pageStore, config); var treeRoot = builder.Build(1, _testOrderedValues.Take(keyCount)); var treeBeforeSave = new BPlusTree(pageStore, treeRoot); treeBeforeSave.Save(1, null); //ValidateScan(treeBeforeSave.Scan(null), keyCount, pageStoreName + " before save"); pageStore.Commit(1, null); pageStore.Close(); using(var ps = TestUtils.OpenPageStore(pageStoreName, true, persistenceType, 1)) { var tree = new BPlusTree(ps, treeRoot); tree.DumpStructure(); ValidateScan(tree.Scan(null), keyCount, pageStoreName + " after save"); ValidateSearch(tree, keyCount, pageStoreName + "after save"); } }
private void BuildAndScan(IPageStore pageStore, string pageStoreName, PersistenceType persistenceType, int keyCount) { var config = new BPlusTreeConfiguration(8, 64, pageStore.PageSize); var builder = new BPlusTreeBuilder(pageStore, config); var treeRoot = builder.Build(1, _testOrderedValues.Take(keyCount)); var treeBeforeSave = new BPlusTree(pageStore, treeRoot); treeBeforeSave.Save(1, null); //ValidateScan(treeBeforeSave.Scan(null), keyCount, pageStoreName + " before save"); pageStore.Commit(1, null); pageStore.Close(); using (var ps = TestUtils.OpenPageStore(pageStoreName, true, persistenceType, 1)) { var tree = new BPlusTree(ps, treeRoot); tree.DumpStructure(); ValidateScan(tree.Scan(null), keyCount, pageStoreName + " after save"); ValidateSearch(tree, keyCount, pageStoreName + "after save"); } }