BplusDotNet.BplusTreeBytes.Recover C# (CSharp) Method

Recover() public method

public Recover ( bool CorrectErrors ) : void
CorrectErrors bool
return void
        public void Recover(bool CorrectErrors)
        {
            this.tree.Recover(CorrectErrors);
            Hashtable ChunksInUse = new Hashtable();
            string key = this.tree.FirstKey();
            while (key!=null)
            {
                long buffernumber = this.tree[key];
                if (ChunksInUse.ContainsKey(buffernumber))
                {
                    throw new BplusTreeException("buffer number "+buffernumber+" associated with more than one key '"
                        +key+"' and '"+ChunksInUse[buffernumber]+"'");
                }
                ChunksInUse[buffernumber] = key;
                key = this.tree.NextKey(key);
            }
            // also consider the un-deallocated chunks to be in use
            foreach (DictionaryEntry thing in this.FreeChunksOnCommit)
            {
                long buffernumber = (long) thing.Key;
                ChunksInUse[buffernumber] = "awaiting commit";
            }
            this.archive.Recover(ChunksInUse, CorrectErrors);
        }