예제 #1
0
        private static FreeListIdProvider GetFreelist(PagedFile pagedFile, TreeState treeState)
        {
            FreeListIdProvider freelist = new FreeListIdProvider(pagedFile, pagedFile.PageSize(), treeState.LastId(), FreeListIdProvider.NO_MONITOR);

            freelist.Initialize(treeState.LastId(), treeState.FreeListWritePageId(), treeState.FreeListReadPageId(), treeState.FreeListWritePos(), freelist.ReadPos());
            return(freelist);
        }
예제 #2
0
 private void Write(PageCursor cursor, TreeState origin)
 {
     TreeState.Write(cursor, origin.StableGeneration(), origin.UnstableGeneration(), origin.RootId(), origin.RootGeneration(), origin.LastId(), origin.FreeListWritePageId(), origin.FreeListReadPageId(), origin.FreeListWritePos(), origin.FreeListReadPos(), origin.Clean);
 }
예제 #3
0
 public static IndexCorruption <KEY, VALUE> setTreeState <KEY, VALUE>(TreeState target)
 {
     return((pagedFile, layout, node, treeState) =>
     {
         using (PageCursor cursor = pagedFile.io(0, PagedFile.PF_SHARED_WRITE_LOCK))
         {
             goTo(cursor, "", treeState.pageId());                        // Write new tree state to current tree states page
             TreeState.Write(cursor, target.StableGeneration(), target.UnstableGeneration(), target.RootId(), target.RootGeneration(), target.LastId(), target.FreeListWritePageId(), target.FreeListReadPageId(), target.FreeListWritePos(), target.FreeListReadPos(), target.Clean);
         }
     });
 }