Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:10

0001 /**
0002  * Copyright (c) 2017-present, Facebook, Inc.
0003  * All rights reserved.
0004  *
0005  * This source code is licensed under the BSD-style license found in the
0006  * LICENSE file in the root directory of this source tree.
0007  */
0008 
0009 #pragma once
0010 
0011 #include "store.h"
0012 
0013 #include <memory>
0014 
0015 namespace gloo {
0016 namespace rendezvous {
0017 
0018 class PrefixStore : public Store {
0019  public:
0020   PrefixStore(const std::string& prefix, Store& store);
0021 
0022   virtual ~PrefixStore() {}
0023 
0024   virtual void set(const std::string& key, const std::vector<char>& data)
0025       override;
0026 
0027   virtual std::vector<char> get(const std::string& key) override;
0028 
0029   virtual void wait(const std::vector<std::string>& keys) override {
0030     wait(keys, Store::kDefaultTimeout);
0031   }
0032 
0033   virtual void wait(
0034       const std::vector<std::string>& keys,
0035       const std::chrono::milliseconds& timeout) override;
0036 
0037   virtual bool has_v2_support() override;
0038   virtual std::vector<std::vector<char>> multi_get(const std::vector<std::string>& keys) override;
0039   virtual void multi_set(const std::vector<std::string>& keys, const std::vector<std::vector<char>>& values) override;
0040   virtual void append(const std::string& key, const std::vector<char>& data) override;
0041   virtual int64_t add(const std::string& key, int64_t value) override;
0042 
0043  protected:
0044   const std::string prefix_;
0045   Store& store_;
0046 
0047   std::string joinKey(const std::string& key);
0048 };
0049 
0050 } // namespace rendezvous
0051 } // namespace gloo