public final class RocksUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Iterator<T> |
createIterator(org.rocksdb.RocksIterator rocksIterator,
alluxio.master.metastore.rocks.RocksUtils.RocksIteratorParser<T> parser)
Used to wrap an
Iterator over RocksIterator . |
static String |
generateDbPath(String baseDir,
String dbName)
Generates a path to use for a RocksDB database.
|
static long |
readLong(byte[] bytes,
int start) |
static byte[] |
toByteArray(long long1,
long long2) |
static byte[] |
toByteArray(long n,
String str) |
public static String generateDbPath(String baseDir, String dbName)
baseDir
- the base directory pathdbName
- a name for the databasepublic 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> Iterator<T> createIterator(org.rocksdb.RocksIterator rocksIterator, alluxio.master.metastore.rocks.RocksUtils.RocksIteratorParser<T> parser)
Iterator
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.