简体   繁体   English

如何在 Java 中使用 Rocksdb 合并?

[英]How to use Rocksdb merge in Java?

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?文档不清楚如何在使用rocksdb-jni时使用合并操作,我对C++ API不熟悉,如何定义合并操作?

You can't define new merge operators in java.您不能在 java 中定义新的合并运算符。 They need to be implemented in C++ and then compiled and brought in Java它们需要在C++中实现然后编译并引入Java

Eg how to use the built in uint64add operator val options = Options().setMergeOperator(UInt64AddOperator())例如如何使用内置的 uint64add 运算符val options = Options().setMergeOperator(UInt64AddOperator())

and then you can use rocksDB.merge(keyByteArray, longValueByteArray)然后你可以使用rocksDB.merge(keyByteArray, longValueByteArray)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM