January 2019
Intermediate to advanced
606 pages
15h 1m
English
The following code sample is the librados client-side application, which will read the object from the OSD, calculate the MD5 hash of the object on the client, and write it back as an attribute to the object. This is doing the calculation and storage in the same way as the RADOS class, with the only difference being the location of the processing.
Create a new file named rados_md5.cc and place the following into it:
#include <cctype>#include <rados/librados.hpp>#include <iostream>#include <string>#include <openssl/md5.h>void exit_func(int ret);librados::Rados rados;int main(int argc, const char **argv){ int ret = 0; // Define variables const char *pool_name = "rbd"; std::string object_name("LowerObject"); librados::IoCtx ...Read now
Unlock full access