proxygen
ConsistentHash.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 
11 #pragma once
12 
13 #include <string>
14 #include <vector>
15 
16 namespace proxygen {
17 
19  public:
20  virtual ~ConsistentHash() {}
21 
30  virtual void build(std::vector<std::pair<std::string, uint64_t> > &) = 0;
31 
38  virtual size_t get(const uint64_t key, const size_t rank = 0) const = 0;
39 
44  virtual double getMaxErrorRate() const = 0;
45 };
46 }
virtual void build(std::vector< std::pair< std::string, uint64_t > > &)=0
virtual double getMaxErrorRate() const =0