File indexing completed on 2025-01-18 10:00:10
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <chrono>
0012 #include <string>
0013 #include <vector>
0014
0015 #include "gloo/common/logging.h"
0016 #include "gloo/common/error.h"
0017 #include "gloo/common/store.h"
0018
0019
0020 #define GLOO_STORE_HAS_STORE_V2 1
0021
0022 namespace gloo {
0023 namespace rendezvous {
0024
0025 class Store: public IStore {
0026 public:
0027 static constexpr std::chrono::milliseconds kDefaultTimeout =
0028 std::chrono::seconds(30);
0029
0030 virtual ~Store();
0031
0032 virtual void set(const std::string& key, const std::vector<char>& data) = 0;
0033
0034 virtual std::vector<char> get(const std::string& key) = 0;
0035
0036 virtual void wait(
0037 const std::vector<std::string>& keys) = 0;
0038
0039 virtual void wait(
0040 const std::vector<std::string>& keys,
0041 const std::chrono::milliseconds& ) {
0042
0043
0044 wait(keys);
0045 }
0046
0047 virtual bool has_v2_support() {
0048
0049 return false;
0050 }
0051
0052 virtual std::vector<std::vector<char>> multi_get(const std::vector<std::string>& ) {
0053 GLOO_THROW_INVALID_OPERATION_EXCEPTION("this store doesn't support multi_get");
0054 }
0055
0056 virtual void multi_set(const std::vector<std::string>& , const std::vector<std::vector<char>>& ) {
0057 GLOO_THROW_INVALID_OPERATION_EXCEPTION("this store doesn't support multi_set");
0058 }
0059
0060 virtual void append(const std::string& key, const std::vector<char>& ) {
0061 GLOO_THROW_INVALID_OPERATION_EXCEPTION("this store doesn't support append");
0062 }
0063
0064 virtual int64_t add(const std::string& key, int64_t value) {
0065 GLOO_THROW_INVALID_OPERATION_EXCEPTION("this store doesn't support add");
0066 }
0067
0068 };
0069
0070 }
0071 }