Exemplo n.º 1
0
        internal BTreeNodeSearchResult SearchLeaf(Transaction trans, IPreparedComparison
                                                  preparedComparison, SearchTarget target)
        {
            ByteArrayBuffer reader = PrepareRead(trans);
            Searcher        s      = Search(trans, preparedComparison, reader, target);

            if (!_isLeaf)
            {
                return(Child(reader, s.Cursor()).SearchLeaf(trans, preparedComparison, target));
            }
            if (!s.FoundMatch() || target == SearchTarget.Any || target == SearchTarget.Highest)
            {
                return(new BTreeNodeSearchResult(trans, reader, Btree(), s, this));
            }
            if (target == SearchTarget.Lowest)
            {
                BTreeNodeSearchResult res = FindLowestLeafMatch(trans, preparedComparison, s.Cursor
                                                                    () - 1);
                if (res != null)
                {
                    return(res);
                }
                return(CreateMatchingSearchResult(trans, reader, s.Cursor()));
            }
            throw new InvalidOperationException();
        }
Exemplo n.º 2
0
        private bool WasRemoved(Transaction trans, Searcher s)
        {
            if (!s.FoundMatch())
            {
                return(false);
            }
            BTreePatch patch = KeyPatch(trans, s.Cursor());

            return(patch != null && patch.IsRemove());
        }
Exemplo n.º 3
0
		private bool WasRemoved(Transaction trans, Searcher s)
		{
			if (!s.FoundMatch())
			{
				return false;
			}
			BTreePatch patch = KeyPatch(trans, s.Cursor());
			return patch != null && patch.IsRemove();
		}
		internal BTreeNodeSearchResult(Transaction trans, ByteArrayBuffer nodeReader, BTree
			 btree, Searcher searcher, BTreeNode node) : this(trans, btree, NextPointerIf(PointerOrNull
			(trans, nodeReader, node, searcher.Cursor()), searcher.IsGreater()), searcher.FoundMatch
			())
		{
		}
 internal BTreeNodeSearchResult(Transaction trans, ByteArrayBuffer nodeReader, BTree
                                btree, Searcher searcher, BTreeNode node) : this(trans, btree, NextPointerIf(PointerOrNull
                                                                                                                 (trans, nodeReader, node, searcher.Cursor()), searcher.IsGreater()), searcher.FoundMatch
                                                                                     ())
 {
 }