17 #ifndef JUBATUS_CORE_COMMON_PORTABLE_MIXER_HPP_
18 #define JUBATUS_CORE_COMMON_PORTABLE_MIXER_HPP_
22 #include "jubatus/util/math/random.h"
23 #include "../common/hash.hpp"
29 template <
typename Storage,
typename Diff = std::
string>
43 void add(Storage* storage) {
51 Storage*
get_hash(
const std::string&
id)
const {
63 for (
size_t i = 1; i <
storages_.size(); ++i) {
69 for (
size_t i = 0; i <
storages_.size(); ++i) {
76 jubatus::util::math::random::mtrand
rand_;
83 #endif // JUBATUS_CORE_COMMON_PORTABLE_MIXER_HPP_
std::vector< Storage * > storages_
Storage * get_hash(const std::string &id) const
void add(Storage *storage)
jubatus::util::math::random::mtrand rand_
static uint64_t calc_string_hash(const std::string &s)
portable_mixer(uint32_t seed)