Пример #1
0
        internal async ValueTask <LTrie> GetTrie()
        {
            if (trie is LTrie)
            {
                return(trie);
            }
            AssertNotClosed();
            trie = await LTrie.OpenOrInitFromStorage(await GetCacheStorage());

            trie.ConsistencyCheck = checkConsistency;
            return(trie);
        }
Пример #2
0
        private static async ValueTask <DBTrieEngine> OpenFromStorages(IStorages storages)
        {
            if (storages == null)
            {
                throw new ArgumentNullException(nameof(storages));
            }
            var schemaFile = await storages.OpenStorage(Schema.StorageName);

            var trie = await LTrie.OpenOrInitFromStorage(schemaFile);

            var s = await Schema.OpenOrInitFromTrie(trie);

            return(new DBTrieEngine(storages, s));
        }