jubatus_core
0.1.2
Jubatus: Online machine learning framework for distributed environment
|
#include <key_manager.hpp>
Public Types | |
enum | { NOTFOUND = 0xFFFFFFFFFFFFFFFFLLU } |
Public Member Functions | |
void | clear () |
void | delete_key (const std::string &name) |
std::vector< std::string > | get_all_id2key () const |
uint64_t | get_id (const std::string &key) |
uint64_t | get_id_const (const std::string &key) const |
const std::string & | get_key (const uint64_t id) const |
uint64_t | get_max_id () const |
void | init_by_id2key (const std::vector< std::string > &id2key) |
key_manager () | |
MSGPACK_DEFINE (key2id_, id2key_, next_id_) | |
bool | set_key (const std::string &key) |
size_t | size () const |
void | swap (key_manager &km) |
Private Member Functions | |
uint64_t | append_key (const std::string &key) |
Private Attributes | |
util::data::unordered_map< uint64_t, std::string > | id2key_ |
util::data::unordered_map< std::string, uint64_t > | key2id_ |
uint64_t | next_id_ |
Friends | |
std::ostream & | operator<< (std::ostream &os, const key_manager &km) |
Definition at line 34 of file key_manager.hpp.
anonymous enum |
jubatus::core::common::key_manager::key_manager | ( | ) |
Definition at line 35 of file key_manager.cpp.
|
private |
Definition at line 39 of file key_manager.cpp.
References id2key_, JUBATUS_ASSERT_EQ, key2id_, and next_id_.
Referenced by get_id(), and set_key().
void jubatus::core::common::key_manager::clear | ( | ) |
Definition at line 98 of file key_manager.cpp.
References id2key_, key2id_, next_id_, and swap().
Referenced by jubatus::core::storage::lsh_index_storage::clear().
void jubatus::core::common::key_manager::delete_key | ( | const std::string & | name | ) |
Definition at line 115 of file key_manager.cpp.
References get_id_const(), id2key_, key2id_, and NOTFOUND.
Referenced by jubatus::core::storage::local_storage::delete_label_nolock(), and jubatus::core::storage::local_storage_mixture::delete_label_nolock().
std::vector< std::string > jubatus::core::common::key_manager::get_all_id2key | ( | ) | const |
Definition at line 87 of file key_manager.cpp.
References id2key_.
Referenced by jubatus::core::storage::local_storage::get_labels(), jubatus::core::storage::local_storage_mixture::get_labels(), jubatus::core::storage::local_storage_mixture::inp(), and jubatus::core::storage::local_storage::inp().
uint64_t jubatus::core::common::key_manager::get_id | ( | const std::string & | key | ) |
Definition at line 48 of file key_manager.cpp.
References append_key(), and key2id_.
Referenced by jubatus::core::storage::local_storage_mixture::bulk_update(), jubatus::core::storage::local_storage::bulk_update(), jubatus::core::storage::inverted_index_storage::put_diff(), jubatus::core::storage::local_storage::register_label(), jubatus::core::storage::local_storage_mixture::register_label(), jubatus::core::storage::sparse_matrix_storage::set(), jubatus::core::storage::inverted_index_storage::set(), jubatus::core::storage::local_storage::set(), jubatus::core::storage::local_storage_mixture::set2_nolock(), jubatus::core::storage::local_storage::set2_nolock(), jubatus::core::storage::local_storage_mixture::set3_nolock(), jubatus::core::storage::local_storage::set3_nolock(), jubatus::core::storage::local_storage_mixture::set_average_and_clear_diff(), jubatus::core::storage::lsh_index_storage::set_mixed_row(), jubatus::core::storage::local_storage_mixture::set_nolock(), jubatus::core::storage::local_storage::set_nolock(), jubatus::core::storage::sparse_matrix_storage::set_row(), jubatus::core::storage::lsh_index_storage::set_row(), jubatus::core::storage::local_storage_mixture::update(), and jubatus::core::storage::local_storage::update().
uint64_t jubatus::core::common::key_manager::get_id_const | ( | const std::string & | key | ) | const |
Definition at line 67 of file key_manager.cpp.
References key2id_, and NOTFOUND.
Referenced by delete_key(), jubatus::core::storage::local_storage::delete_label_nolock(), jubatus::core::storage::local_storage_mixture::delete_label_nolock(), jubatus::core::storage::sparse_matrix_storage::get(), jubatus::core::storage::inverted_index_storage::get(), jubatus::core::storage::local_storage_mixture::inp(), jubatus::core::storage::local_storage::inp(), jubatus::core::storage::inverted_index_storage::remove(), jubatus::core::storage::sparse_matrix_storage::remove(), jubatus::core::storage::lsh_index_storage::remove_and_get_row(), jubatus::core::storage::lsh_index_storage::remove_model_row(), jubatus::core::storage::lsh_index_storage::remove_row(), and jubatus::core::storage::inverted_index_storage::set().
const string & jubatus::core::common::key_manager::get_key | ( | const uint64_t | id | ) | const |
Definition at line 78 of file key_manager.cpp.
References id2key_, and jubatus::core::common::key_not_found.
Referenced by jubatus::core::storage::inverted_index_storage::calc_scores(), jubatus::core::storage::local_storage_mixture::get2_nolock(), jubatus::core::storage::local_storage::get2_nolock(), jubatus::core::storage::local_storage_mixture::get3_nolock(), jubatus::core::storage::local_storage::get3_nolock(), jubatus::core::storage::inverted_index_storage::get_all_column_ids(), jubatus::core::storage::local_storage_mixture::get_diff(), jubatus::core::storage::inverted_index_storage::get_diff(), jubatus::core::storage::local_storage_mixture::get_nolock(), jubatus::core::storage::local_storage::get_nolock(), jubatus::core::storage::sparse_matrix_storage::get_row(), and jubatus::core::storage::lsh_index_storage::get_sorted_similar_rows().
uint64_t jubatus::core::common::key_manager::get_max_id | ( | ) | const |
Definition at line 123 of file key_manager.cpp.
References next_id_.
Referenced by jubatus::core::storage::inverted_index_storage::calc_scores().
void jubatus::core::common::key_manager::init_by_id2key | ( | const std::vector< std::string > & | id2key | ) |
Definition at line 104 of file key_manager.cpp.
References id2key_, key2id_, and next_id_.
bool jubatus::core::common::key_manager::set_key | ( | const std::string & | key | ) |
Definition at line 57 of file key_manager.cpp.
References append_key(), and key2id_.
Referenced by jubatus::core::storage::local_storage::set_label(), and jubatus::core::storage::local_storage_mixture::set_label().
|
inline |
Definition at line 50 of file key_manager.hpp.
References key2id_.
Referenced by jubatus::core::storage::local_storage_mixture::get_status(), and jubatus::core::storage::local_storage::get_status().
|
inline |
Definition at line 45 of file key_manager.hpp.
References id2key_, and key2id_.
Referenced by jubatus::core::storage::inverted_index_storage::clear(), jubatus::core::storage::sparse_matrix_storage::clear(), clear(), jubatus::core::storage::local_storage::clear(), jubatus::core::storage::local_storage_mixture::clear(), and jubatus::core::common::swap().
|
friend |
Definition at line 66 of file key_manager.hpp.
|
private |
Definition at line 84 of file key_manager.hpp.
Referenced by append_key(), clear(), delete_key(), get_all_id2key(), get_key(), init_by_id2key(), and swap().
|
private |
Definition at line 83 of file key_manager.hpp.
Referenced by append_key(), clear(), delete_key(), get_id(), get_id_const(), init_by_id2key(), set_key(), size(), and swap().
|
private |
Definition at line 82 of file key_manager.hpp.
Referenced by append_key(), clear(), get_max_id(), and init_by_id2key().