summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_redis_driver.h
diff options
context:
space:
mode:
authorSamarah <samarah.uriarte@ibm.com>2023-12-22 12:10:13 +0100
committerPritha Srivastava <prsrivas@redhat.com>2024-04-02 17:54:50 +0200
commite0639b137b5709b52b3b9a00c59c3693d4d913d1 (patch)
tree6a1e56215396e36dca3126e1439a98d756beba02 /src/rgw/rgw_redis_driver.h
parentrgw/cache: This commit squashes modifications to base class. (diff)
downloadceph-e0639b137b5709b52b3b9a00c59c3693d4d913d1.tar.xz
ceph-e0639b137b5709b52b3b9a00c59c3693d4d913d1.zip
rgw/cache: This commit squashes the following commits for redis driver.
RGW: fix key_exists method for RedisDriver and clean up rgw_sal_d4n.cc RGW: Implement RedisDriver::get_free_space rgw/cache: modifying namespace from rgw::cal to rgw::cache. RGW: Update D4N files to match CacheDriver changes RGW: Fix D4N read workflow crashes RGW: Update RedisDriver to match new CacheDriver structure; define set_attrs method RGW: Switch out D4N cache methods with Redis driver methods RGW: Update Cache Driver structure RGW: Update cache files. RGW: create redis cache driver files Signed-off-by: Samarah <samarah.uriarte@ibm.com>
Diffstat (limited to 'src/rgw/rgw_redis_driver.h')
-rw-r--r--src/rgw/rgw_redis_driver.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/rgw/rgw_redis_driver.h b/src/rgw/rgw_redis_driver.h
new file mode 100644
index 00000000000..01c623acb68
--- /dev/null
+++ b/src/rgw/rgw_redis_driver.h
@@ -0,0 +1,43 @@
+#ifndef CEPH_REDISDRIVER_H
+#define CEPH_REDISDRIVER_H
+
+#include <string>
+#include <iostream>
+#include <cpp_redis/cpp_redis>
+#include "rgw_common.h"
+#include "rgw_cache_driver.h"
+#include "driver/d4n/d4n_directory.h"
+
+namespace rgw { namespace cache {
+
+class RedisDriver : public CacheDriver {
+ private:
+ cpp_redis::client client;
+
+ public:
+ RedisDriver(Partition& _partition_info, std::string host, int port) : CacheDriver() {}
+
+ virtual int initialize(CephContext* cct, const DoutPrefixProvider* dpp) override;
+ virtual int put(const DoutPrefixProvider* dpp, const std::string& key, bufferlist& bl, uint64_t len, rgw::sal::Attrs& attrs) override;
+ virtual int get(const DoutPrefixProvider* dpp, const std::string& key, off_t offset, uint64_t len, bufferlist& bl, rgw::sal::Attrs& attrs) override;
+ virtual int append_data(const DoutPrefixProvider* dpp, const::std::string& key, bufferlist& bl_data) override;
+ virtual int delete_data(const DoutPrefixProvider* dpp, const::std::string& key) override;
+ virtual int get_attrs(const DoutPrefixProvider* dpp, const std::string& key, rgw::sal::Attrs& attrs) override;
+ virtual int set_attrs(const DoutPrefixProvider* dpp, const std::string& key, rgw::sal::Attrs& attrs) override;
+ virtual int update_attrs(const DoutPrefixProvider* dpp, const std::string& key, rgw::sal::Attrs& attrs) override;
+ virtual int delete_attrs(const DoutPrefixProvider* dpp, const std::string& key, rgw::sal::Attrs& del_attrs) override;
+ virtual std::string get_attr(const DoutPrefixProvider* dpp, const std::string& key, const std::string& attr_name) override;
+ virtual int set_attr(const DoutPrefixProvider* dpp, const std::string& key, const std::string& attr_name, const std::string& attr_val) override;
+
+ /* Entry */
+ virtual bool key_exists(const DoutPrefixProvider* dpp, const std::string& key) override;
+ virtual size_t get_num_entries(const DoutPrefixProvider* dpp) override;
+
+ /* Partition */
+ virtual Partition get_current_partition_info(const DoutPrefixProvider* dpp) override;
+ virtual uint64_t get_free_space(const DoutPrefixProvider* dpp) override;
+};
+
+} } // namespace rgw::cal
+
+#endif