4

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!

kjee
  • 359
  • 5
  • 19

1 Answers1

4

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.

Prateek Jain
  • 136
  • 5