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 
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(const std::string& name) override;
21 
22  virtual int64_t add(const std::string& name, int64_t value) override;
23 
24  virtual bool check(const std::vector<std::string>& names) override;
25 
26  virtual void wait(
27  const std::vector<std::string>& names,
28  const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
29 
30  private:
31  std::string host_;
32  int port_;
33  std::string prefix_;
34 
35  redisContext* redis_;
36 
37  std::string compoundKey(const std::string& name);
38 };
39 
40 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...