I want to write a C++ program using Rocksdb to store key, value pairs which are not in std::string type. For instance, I want use int data-type as the key and values in following data type as the value.
typedef struct custom_type {
    int timestamp;
    int count;
    char* path;
} custom_type_t
Would you let me know how can I achieve this or recommend me some else choices that I can try for?
Thanks a lot for your help in advance!
You can serialize your custom data as a string using serialization libraries. You can use a bunch of protocols provided by Apache Thrift to seriazlie them to a string and store them to rocksdb.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With