Caffe2 - C++ API
A deep learning, cross platform ML framework
redis_store_handler.h
1 #pragma once
2 
3 #include <caffe2/distributed/store_handler.h>
4 
5 extern "C" {
6 #include <hiredis/hiredis.h>
7 }
8 
9 #include <string>
10 
11 namespace caffe2 {
12 
13 class CAFFE2_API RedisStoreHandler : public StoreHandler {
14  public:
15  explicit RedisStoreHandler(std::string& host, int port, std::string& prefix);
16  virtual ~RedisStoreHandler();
17 
18  virtual void set(const std::string& name, const std::string& data) override;
19 
20  virtual std::string get(
21  const std::string& name,
22  const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
23 
24  virtual int64_t add(const std::string& name, int64_t value) override;
25 
26  virtual bool check(const std::vector<std::string>& names) override;
27 
28  virtual void wait(
29  const std::vector<std::string>& names,
30  const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
31 
32  private:
33  std::string host_;
34  int port_;
35  std::string prefix_;
36 
37  redisContext* redis_;
38 
39  std::string compoundKey(const std::string& name);
40 };
41 
42 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13