public final class RocksUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
RocksUtils.RocksIteratorParser<T>
Used to parse current
RocksIterator element. |
Modifier and Type | Method and Description |
---|---|
static <T> CloseableIterator<T> |
createCloseableIterator(org.rocksdb.RocksIterator rocksIterator,
RocksUtils.RocksIteratorParser<T> parser)
Used to wrap an
CloseableIterator over RocksIterator . |
static long |
readLong(byte[] bytes,
int start) |
static byte[] |
toByteArray(long long1,
long long2) |
static byte[] |
toByteArray(long n,
String str) |
public static byte[] toByteArray(long long1, long long2)
long1
- a long valuelong2
- a long valuepublic static byte[] toByteArray(long n, String str)
n
- a long valuestr
- a string valuepublic static long readLong(byte[] bytes, int start)
bytes
- an array of bytesstart
- the place in the array to read the long frompublic static <T> CloseableIterator<T> createCloseableIterator(org.rocksdb.RocksIterator rocksIterator, RocksUtils.RocksIteratorParser<T> parser)
CloseableIterator
over RocksIterator
.
It seeks given iterator to first entry before returning the iterator.T
- iterator value typerocksIterator
- the rocks iteratorparser
- parser to produce iterated values from rocks key-valueCopyright © 2023. All Rights Reserved.