コード例 #1
0
ファイル: ObjectDB.cs プロジェクト: Waizik/BTDB
 internal static IEnumerable <KeyValuePair <uint, string> > LoadRelationNamesEnum(IKeyValueDBTransaction tr)
 {
     tr.InvalidateCurrentKey();
     while (tr.FindNextKey(RelationNamesPrefix))
     {
         yield return(new KeyValuePair <uint, string>((uint)PackUnpack.UnpackVUInt(tr.GetValue()), new SpanReader(tr.GetKey().Slice(RelationNamesPrefixLen)).ReadString()));
     }
 }
コード例 #2
0
 public static bool Enumerate(this IKeyValueDBTransaction transaction)
 {
     if (transaction.GetKeyIndex() < 0)
     {
         return(transaction.FindFirstKey());
     }
     if (transaction.FindNextKey())
     {
         return(true);
     }
     transaction.InvalidateCurrentKey();
     return(false);
 }
コード例 #3
0
ファイル: ODBIterator.cs プロジェクト: yardee/BTDB
        public void LoadGlobalInfo(bool sortTableByNameAsc = false)
        {
            LoadTableNamesDict();
            LoadRelationInfoDict();
            MarkLastDictId();
            _trkv.InvalidateCurrentKey();
            _singletons = new Dictionary <uint, ulong>();
            while (_trkv.FindNextKey(ObjectDB.TableSingletonsPrefix))
            {
                _singletons.Add(new SpanReader(_trkv.GetKey().Slice((int)ObjectDB.TableSingletonsPrefixLen)).ReadVUInt32(), new SpanReader(_trkv.GetValue()).ReadVUInt64());
            }

            if (sortTableByNameAsc)
            {
                _singletons = _singletons.OrderBy(item => _tableId2Name.TryGetValue(item.Key, out var name) ? name : "").ToDictionary(item => item.Key, item => item.Value);
            }
        }
コード例 #4
0
 public void InvalidateCurrentKey()
 {
     LogSimpleOperation(KVReplayOperation.InvalidateCurrentKey);
     _tr.InvalidateCurrentKey();
 }
コード例 #5
0
 public void InvalidateCurrentKey()
 {
     _keyValueDBTransaction.InvalidateCurrentKey();
 }