January 2019
Intermediate to advanced
606 pages
15h 1m
English
Finally, the last code sample is the librados application, which instructs OSD to calculate the MD5 hash locally without transferring any data to or from the client. You will note that the code given later has no librados read or write statements and relies purely on the exec function to trigger the MD5 hash creation.
Create a new file named rados_class_md5.cc and place the following into it:
#include <cctype>#include <rados/librados.hpp>#include <iostream>#include <string>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 io_ctx; // Create the ...Read now
Unlock full access