Esempio n. 1
0
 public long GetKeyValueCount()
 {
     if (_prefixKeyCount >= 0)
     {
         return(_prefixKeyCount);
     }
     if (_prefix.Length == 0)
     {
         _prefixKeyCount = ArtRoot.GetCount();
         return(_prefixKeyCount);
     }
     CalcPrefixKeyStart();
     if (_prefixKeyStart < 0)
     {
         _prefixKeyCount = 0;
         return(0);
     }
     if (_cursor2 == null)
     {
         _cursor2 = ArtRoot.CreateCursor();
     }
     _cursor2.FindLast(_prefix);
     _prefixKeyCount = _cursor2.CalcIndex() - _prefixKeyStart + 1;
     return(_prefixKeyCount);
 }
Esempio n. 2
0
 public BTreeKeyValueDBTransaction(BTreeKeyValueDB keyValueDB, IRootNode root, bool writing, bool readOnly)
 {
     _preapprovedWriting = writing;
     _readOnly           = readOnly;
     _keyValueDB         = keyValueDB;
     _keyIndex           = -1;
     _cursor             = root.CreateCursor();
     _cursor2            = null;
     BTreeRoot           = root;
     _cursorMovedCounter = 0;
 }
 public BTreeKeyValueDBTransaction(BTreeKeyValueDB keyValueDB, IRootNode artRoot, bool writing, bool readOnly)
 {
     _preapprovedWriting = writing;
     _readOnly           = readOnly;
     _keyValueDB         = keyValueDB;
     _prefix             = Array.Empty <byte>();
     _prefixKeyStart     = 0;
     _prefixKeyCount     = -1;
     _keyIndex           = -1;
     _cursor             = artRoot.CreateCursor();
     _cursor2            = null;
     BTreeRoot           = artRoot;
 }
Esempio n. 4
0
 public ArtInMemoryKeyValueDBTransaction(ArtInMemoryKeyValueDB keyValueDB, IRootNode artRoot, bool writting, bool readOnly)
 {
     _preapprovedWritting = writting;
     _readOnly            = readOnly;
     _keyValueDB          = keyValueDB;
     _prefix         = BitArrayManipulation.EmptyByteArray;
     _prefixKeyStart = 0;
     _prefixKeyCount = -1;
     _keyIndex       = -1;
     _cursor         = artRoot.CreateCursor();
     _cursor2        = null;
     ArtRoot         = artRoot;
 }
Esempio n. 5
0
 public CursorTestsBase()
 {
     _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator());
     _root      = ARTImpl.CreateEmptyRoot(_allocator, Is12);
     _cursor    = _root.CreateCursor();
 }
Esempio n. 6
0
 public CursorTestsBase()
 {
     _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator());
     _root      = Is12 ? BTreeImpl12.CreateEmptyRoot(_allocator) : null /*ARTImplV.CreateEmptyRoot(_allocator)*/;
     _cursor    = _root.CreateCursor();
 }