+ /**
+ * Writes an object to a server specified by the master_key parameter.
+ * If the object already exists, it will overwrite the existing object.
+ *
+ * @param[in] master_key key that specifies server to write to
+ * @param[in] key key of object to write to server
+ * @param[in] value value of object to write to server
+ * @param[in] expiration time to keep the object stored in the server for
+ * @param[in] flags flags to store with the object
+ * @return true on succcess; false otherwise
+ */
+ bool setByKey(const std::string &master_key,
+ const std::string &key,
+ const std::vector<char> &value,
+ time_t expiration,
+ uint32_t flags)
+ {
+ return memcached_success(memcached_set_by_key(memc, master_key.c_str(),
+ master_key.length(),
+ key.c_str(), key.length(),
+ &value[0], value.size(),
+ expiration,
+ flags));
+ }
+
+ /**
+ * Writes a list of objects to the server. Objects are specified by
+ * 2 vectors - 1 vector of keys and 1 vector of values.
+ *
+ * @param[in] keys vector of keys of objects to write to server
+ * @param[in] values vector of values of objects to write to server
+ * @param[in] expiration time to keep the objects stored in server for
+ * @param[in] flags flags to store with the objects
+ * @return true on success; false otherwise
+ */