How to use Rocksdb merge in Java?

476 Views Asked by At

The documentation is not clear about how to use the merge operation while using rocksdb-jni, and I am not familiar with C++ API, how could I define an merge operator?

1

There are 1 best solutions below

0
Asad Awadia On

You can't define new merge operators in java. They need to be implemented in C++ and then compiled and brought in Java

Eg how to use the built in uint64add operator val options = Options().setMergeOperator(UInt64AddOperator())

and then you can use rocksDB.merge(keyByteArray, longValueByteArray)