public IEnumerable<UnseenKey> UnseenKeys() { using (var trkv = _keyValueDb.StartReadOnlyTransaction()) { foreach (var prefix in SupportedKeySpaces()) { trkv.SetKeyPrefixUnsafe(prefix); if (!trkv.FindFirstKey()) continue; var reader = new KeyValueDBValueReader(trkv); do { reader.Restart(); yield return new UnseenKey { Key = Merge(prefix, trkv.GetKeyAsByteArray()), ValueSize = reader.ReadVUInt32() }; } while (trkv.FindNextKey()); } } }
internal static IEnumerable<KeyValuePair<uint, string>> LoadTablesEnum(IKeyValueDBTransaction tr) { tr.SetKeyPrefixUnsafe(TableNamesPrefix); var keyReader = new KeyValueDBKeyReader(tr); var valueReader = new KeyValueDBValueReader(tr); while (tr.FindNextKey()) { keyReader.Restart(); valueReader.Restart(); yield return new KeyValuePair<uint, string>(keyReader.ReadVUInt32(), valueReader.ReadString()); } }