Merge PR #5435: Added iterator that allows to read only requested values

This commit is contained in:
Dmitry Shulyak
2019-12-26 10:33:34 -05:00
committed by Alexander Bezobchuk
parent 5188c3565b
commit b314b851e4
4 changed files with 195 additions and 0 deletions
+12
View File
@@ -40,6 +40,18 @@ func KVStoreReversePrefixIterator(kvs KVStore, prefix []byte) Iterator {
return types.KVStoreReversePrefixIterator(kvs, prefix)
}
// KVStorePrefixIteratorPaginated returns iterator over items in the selected page.
// Items iterated and skipped in ascending order.
func KVStorePrefixIteratorPaginated(kvs KVStore, prefix []byte, page, limit uint) Iterator {
return types.KVStorePrefixIteratorPaginated(kvs, prefix, page, limit)
}
// KVStoreReversePrefixIteratorPaginated returns iterator over items in the selected page.
// Items iterated and skipped in descending order.
func KVStoreReversePrefixIteratorPaginated(kvs KVStore, prefix []byte, page, limit uint) Iterator {
return types.KVStorePrefixIteratorPaginated(kvs, prefix, page, limit)
}
// DiffKVStores compares two KVstores and returns all the key/value pairs
// that differ from one another. It also skips value comparison for a set of provided prefixes
func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvAs, kvBs []cmn.KVPair) {