Esempio n. 1
0
 public IndexNode(IndexPage indexPage)
 {
     ID         = Guid.Empty;
     IsDeleted  = true; // Start with index node mark as deleted. Update this after save all stream on disk
     Right      = new IndexLink();
     Left       = new IndexLink();
     DataPageID = uint.MaxValue;
     IndexPage  = indexPage;
 }
Esempio n. 2
0
        public const int INDEX_NODE_SIZE = 81; // Node Index size

        #endregion Fields

        #region Constructors

        public IndexNode(IndexPage indexPage)
        {
            ID = Guid.Empty;
            IsDeleted = true; // Start with index node mark as deleted. Update this after save all stream on disk
            Right = new IndexLink();
            Left = new IndexLink();
            DataPageID = uint.MaxValue;
            IndexPage = indexPage;
        }
Esempio n. 3
0
        private static IndexNode BinaryInsertNode(IndexLink baseLink, IndexNode baseNode, EntryInfo entry, Engine engine)
        {
            // Must insert my new nodo
            var pageIndex = engine.GetFreeIndexPage();
            var newNode = pageIndex.Nodes[pageIndex.NodeIndex];

            baseLink.PageID = pageIndex.PageID;
            baseLink.Index = pageIndex.NodeIndex;

            newNode.UpdateFromEntry(entry);
            newNode.DataPageID = DataFactory.GetStartDataPageID(engine);

            if (pageIndex.PageID != baseNode.IndexPage.PageID)
                engine.CacheIndexPage.AddPage(baseNode.IndexPage, true);

            engine.CacheIndexPage.AddPage(pageIndex, true);

            return newNode;
        }
Esempio n. 4
0
        private static IndexNode BinaryInsertNode(IndexLink baseLink, IndexNode baseNode, EntryInfo entry, Engine engine)
        {
            // Must insert my new nodo
            var pageIndex = engine.GetFreeIndexPage();
            var newNode   = pageIndex.Nodes[pageIndex.UsedNodeCount];

            baseLink.PageID = pageIndex.PageID;
            baseLink.Index  = pageIndex.UsedNodeCount;

            newNode.UpdateFromEntry(entry);
            newNode.DataPageID = DataFactory.GetStartDataPageID(engine);

            if (pageIndex.PageID != baseNode.IndexPage.PageID)
            {
                engine.CacheIndexPage.AddPage(baseNode.IndexPage, true);
            }

            engine.CacheIndexPage.AddPage(pageIndex, true);

            return(newNode);
        }
Esempio n. 5
0
        private static IndexNode GetChildIndexNode(IndexLink link, Engine engine)
        {
            var pageIndex = engine.CacheIndexPage.GetPage(link.PageID);

            return(pageIndex.Nodes[link.Index]);
        }
Esempio n. 6
0
 private static IndexNode GetChildIndexNode(IndexLink link, Engine engine)
 {
     var pageIndex = engine.CacheIndexPage.GetPage(link.PageID);
     return pageIndex.Nodes[link.Index];
 }