/// <returns> true if instantiated tree needs to be rebuilt. </returns> private bool InstantiateTree() { _monitors.addMonitorListener(TreeMonitor()); GBPTree.Monitor monitor = _monitors.newMonitor(typeof(GBPTree.Monitor)); MutableBoolean isRebuilding = new MutableBoolean(); Header.Reader readRebuilding = headerData => isRebuilding.setValue(headerData.get() == _needsRebuilding); try { _index = new GBPTree <LabelScanKey, LabelScanValue>(_pageCache, _storeFile, new LabelScanLayout(), _pageSize, monitor, readRebuilding, _needsRebuildingWriter, _recoveryCleanupWorkCollector, _readOnly); return(isRebuilding.Value); } catch (TreeFileNotFoundException e) { throw new System.InvalidOperationException("Label scan store file could not be found, most likely this database needs to be recovered, file:" + _storeFile, e); } }
public virtual GBPTreeBuilder <KEY, VALUE> With(Header.Reader headerReader) { this._headerReader = headerReader; return(this); }