當前位置: 首頁>>代碼示例>>C#>>正文


C# Trees.Tree類代碼示例

本文整理匯總了C#中Voron.Trees.Tree的典型用法代碼示例。如果您正苦於以下問題:C# Tree類的具體用法?C# Tree怎麽用?C# Tree使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Tree類屬於Voron.Trees命名空間,在下文中一共展示了Tree類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Searcher

        public Searcher(FullTextIndex index)
        {
            _index = index;
            _tx = _index.StorageEnvironment.NewTransaction(TransactionFlags.Read);

            _docs = _tx.ReadTree("Docs");
        }
開發者ID:votrongdao,項目名稱:Corax,代碼行數:7,代碼來源:Searcher.cs

示例2: PageSplitter

 public PageSplitter(Transaction tx,
     Tree tree,
     SliceComparer cmp,
     Slice newKey,
     int len,
     long pageNumber,
     NodeFlags nodeType,
     ushort nodeVersion,
     Cursor cursor,
     TreeMutableState treeState)
 {
     _tx = tx;
     _tree = tree;
     _cmp = cmp;
     _newKey = newKey;
     _len = len;
     _pageNumber = pageNumber;
     _nodeType = nodeType;
     _nodeVersion = nodeVersion;
     _cursor = cursor;
     _treeState = treeState;
     Page page = _cursor.Pages.First.Value;
     _page = tx.ModifyPage(page.PageNumber, page);
     _cursor.Pop();
 }
開發者ID:WimVergouwe,項目名稱:ravendb,代碼行數:25,代碼來源:PageSplitter.cs

示例3: StorageEnvironmentState

 public StorageEnvironmentState(Tree freeSpaceRoot, Tree root, long nextPageNumber)
 {
     if (freeSpaceRoot != null)
         FreeSpaceRoot = freeSpaceRoot.State;
     if (root != null)
         Root = root.State;
     NextPageNumber = nextPageNumber;
 }
開發者ID:j2jensen,項目名稱:ravendb,代碼行數:8,代碼來源:StorageEnvironmentState.cs

示例4: ParentPageAction

 public ParentPageAction(Page parentPage, Page currentPage, Tree tree, Cursor cursor, Transaction tx)
 {
     _parentPage = parentPage;
     _currentPage = currentPage;
     _tree = tree;
     _cursor = cursor;
     _tx = tx;
 }
開發者ID:IdanHaim,項目名稱:ravendb,代碼行數:8,代碼來源:ParentPageAction.cs

示例5: TreeIterator

		public TreeIterator(Tree tree, Transaction tx)
		{
			_tree = tree;
			_tx = tx;

			if (tree.KeysPrefixing)
				_currentInternalKey = new PrefixedSlice(SliceOptions.Key);
			else
				_currentInternalKey = new Slice(SliceOptions.Key); 
		}
開發者ID:bbqchickenrobot,項目名稱:ravendb,代碼行數:10,代碼來源:TreeIterator.cs

示例6: Init

        protected override void Init()
        {
            _fieldTree = Transaction.ReadTree("@fld_" + _field);
            if (_fieldTree == null)
                return;

            var termFreqInDocs = _fieldTree.State.EntriesCount;
            var numberOfDocs = Transaction.ReadTree("$metadata").Read(Transaction, "docs").Reader.ReadInt64();

            var idf = Index.Conventions.Idf(termFreqInDocs, numberOfDocs);
            _weight = idf*idf;
        }
開發者ID:votrongdao,項目名稱:Corax,代碼行數:12,代碼來源:TermQuery.cs

示例7: Init

        protected override void Init()
        {
            base.Init();

            _positionsTree = Transaction.ReadTree("TermPositions");
            _docsTree = Transaction.ReadTree("Docs");

            _fieldId = Index.GetFieldNumber(Field);
            _prefix = new byte[FullTextIndex.FieldDocumentSize];
            _prefixSlice = new Slice(_prefix);

            _maxKey = new byte[FullTextIndex.FieldDocumentSize];
            _maxKeySlice = new Slice(_maxKey);
        }
開發者ID:votrongdao,項目名稱:Corax,代碼行數:14,代碼來源:PhraseQuery.cs

示例8: Create

		public static Tree Create(Transaction tx, SliceComparer cmp, TreeFlags flags = TreeFlags.None)
		{
			var newRootPage = NewPage(tx, PageFlags.Leaf, 1);
			var tree = new Tree(cmp, newRootPage.PageNumber)
			{
				_state =
				{
					Depth = 1,
					Flags = flags,
                    InWriteTransaction = true
				}
			};
			
			tree.State.RecordNewPage(newRootPage, 1);
			return tree;
		}
開發者ID:paulcbetts,項目名稱:ravendb,代碼行數:16,代碼來源:Tree.cs

示例9: Create

        public static Tree Create(Transaction tx, bool keysPrefixing, TreeFlags flags = TreeFlags.None)
        {
            var newRootPage = NewPage(tx, keysPrefixing ? PageFlags.Leaf | PageFlags.KeysPrefixed : PageFlags.Leaf, 1);
            var tree = new Tree(tx, newRootPage.PageNumber)
            {
                _state =
                {
                    Depth = 1,
                    Flags = flags,
                    InWriteTransaction = true,
                    KeysPrefixing = keysPrefixing
                }
            };

            tree.State.RecordNewPage(newRootPage, 1);
            return tree;
        }
開發者ID:jesuslpm,項目名稱:ravendb,代碼行數:17,代碼來源:Tree.cs

示例10: Keys

 public unsafe List<Slice> Keys(Tree t, Transaction tx)
 {
     var results = new List<Slice>();
     using (var it = t.Iterate())
     {
         if (it.Seek(Slice.BeforeAllKeys) == false)
             return results;
         do
         {
             results.Add(it.CurrentKey);
         } while (it.MoveNext());
     }
     return results;
 }
開發者ID:cocytus,項目名稱:ravendb,代碼行數:14,代碼來源:Deletes.cs

示例11: RenderAndShow

		protected void RenderAndShow(Transaction tx, Tree root, int showEntries = 25)
		{
			if (Debugger.IsAttached == false)
				return;
			var path = Path.Combine(Environment.CurrentDirectory, "test-tree.dot");
			var rootPageNumber = tx.Environment.State.GetTree(tx,root.Name).State.RootPageNumber;
			TreeDumper.Dump(tx, path, tx.GetReadOnlyPage(rootPageNumber), showEntries);

			var output = Path.Combine(Environment.CurrentDirectory, "output.svg");
			var p = Process.Start(DebugStuff.FindGraphviz() + @"\bin\dot.exe", "-Tsvg  " + path + " -o " + output);
			p.WaitForExit();
			Process.Start(output);
		}
開發者ID:randacc,項目名稱:ravendb,代碼行數:13,代碼來源:StorageTest.cs

示例12: StorageEnvironmentState

 public StorageEnvironmentState(Tree freeSpaceRoot, Tree root, long nextPageNumber)
 {
     FreeSpaceRoot = freeSpaceRoot;
     Root = root;
     NextPageNumber = nextPageNumber;
 }
開發者ID:WimVergouwe,項目名稱:ravendb,代碼行數:6,代碼來源:StorageEnvironmentState.cs

示例13: TryRemoveMultiValueTree

		internal bool TryRemoveMultiValueTree(Tree parentTree, MemorySlice key)
		{
			var keyToRemove = Tuple.Create(parentTree, key);
			if (_multiValueTrees == null || !_multiValueTrees.ContainsKey(keyToRemove))
				return false;

			return _multiValueTrees.Remove(keyToRemove);
		}
開發者ID:GorelH,項目名稱:ravendb,代碼行數:8,代碼來源:Transaction.cs

示例14: ModifyPage

		internal Page ModifyPage(long num, Tree tree, Page page)
		{
			_env.AssertFlushingNotFailed();

			page = page ?? GetReadOnlyPage(num);
			if (page.Dirty)
				return page;

			if (_dirtyPages.Contains(num))
			{
				page.Dirty = true;
				return page;
			}

		    var newPage = AllocatePage(1, PageFlags.None, num); // allocate new page in a log file but with the same number

            Memory.Copy(newPage.Base, page.Base, AbstractPager.PageSize);
			newPage.LastSearchPosition = page.LastSearchPosition;
			newPage.LastMatch = page.LastMatch;
			tree.RecentlyFoundPages.Reset(num);

			return newPage;
		}
開發者ID:GorelH,項目名稱:ravendb,代碼行數:23,代碼來源:Transaction.cs

示例15: AddMultiValueTree

		internal void AddMultiValueTree(Tree tree, MemorySlice key, Tree mvTree)
		{
			if (_multiValueTrees == null)
				_multiValueTrees = new Dictionary<Tuple<Tree, MemorySlice>, Tree>(new TreeAndSliceComparer());
			mvTree.IsMultiValueTree = true;
			_multiValueTrees.Add(Tuple.Create(tree, key), mvTree);
		}
開發者ID:GorelH,項目名稱:ravendb,代碼行數:7,代碼來源:Transaction.cs


注:本文中的Voron.Trees.Tree類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。