Easy mapping between a Table/Namespace name string to ids and vice versa.
More...
#include <NameIdMapper.h>
|
| NameIdMapper (Hyperspace::SessionPtr &hyperspace, const std::string &toplevel_dir) |
|
bool | name_to_id (const std::string &name, std::string &id, bool *is_namespacep=0) |
|
bool | id_to_name (const std::string &id, std::string &name, bool *is_namespacep=0) |
|
void | id_to_sublisting (const std::string &id, bool include_sub_entries, std::vector< NamespaceListing > &listing) |
|
void | add_mapping (const std::string &name, std::string &id, int flags=0, bool ignore_exists=false) |
| Adds a new mapping. More...
|
|
void | drop_mapping (const std::string &name) |
| Drops a mapping. More...
|
|
bool | exists_mapping (const std::string &name, bool *is_namespace) |
|
void | rename (const std::string &old_name, const std::string &new_name) |
| Rename one entity, it doesn't recursively rename all entities under the path specified by old_name. More...
|
|
void | add_entry (const std::string &names_parent, const std::string &names_entry, std::vector< uint64_t > &ids, bool is_namespace) |
|
|
bool | do_mapping (const std::string &input, bool id_in, std::string &output, bool *is_namespacep) |
|
Easy mapping between a Table/Namespace name string to ids and vice versa.
Definition at line 45 of file NameIdMapper.h.
Enumerator |
---|
IS_NAMESPACE |
|
CREATE_INTERMEDIATE |
|
Definition at line 49 of file NameIdMapper.h.
Hypertable::NameIdMapper::NameIdMapper |
( |
Hyperspace::SessionPtr & |
hyperspace, |
|
|
const std::string & |
toplevel_dir |
|
) |
| |
void Hypertable::NameIdMapper::add_entry |
( |
const std::string & |
names_parent, |
|
|
const std::string & |
names_entry, |
|
|
std::vector< uint64_t > & |
ids, |
|
|
bool |
is_namespace |
|
) |
| |
void Hypertable::NameIdMapper::add_mapping |
( |
const std::string & |
name, |
|
|
std::string & |
id, |
|
|
int |
flags = 0 , |
|
|
bool |
ignore_exists = false |
|
) |
| |
Adds a new mapping.
- Parameters
-
name | name to map |
id | output parameter to hold newly mapped ID |
flags | control falgs (IS_NAMESPACE and/or CREATE_INTERMEDIATE) |
ignore_exists | Don't throw an exception if mapping already exists |
Definition at line 146 of file NameIdMapper.cc.
bool Hypertable::NameIdMapper::do_mapping |
( |
const std::string & |
input, |
|
|
bool |
id_in, |
|
|
std::string & |
output, |
|
|
bool * |
is_namespacep |
|
) |
| |
|
protected |
void Hypertable::NameIdMapper::drop_mapping |
( |
const std::string & |
name | ) |
|
bool Hypertable::NameIdMapper::exists_mapping |
( |
const std::string & |
name, |
|
|
bool * |
is_namespace |
|
) |
| |
- Parameters
-
name | name to check for mapping |
is_namespace | if mapping exists set to true if is namespace |
- Returns
- true if mapping exists, false otherwise
Definition at line 282 of file NameIdMapper.cc.
bool Hypertable::NameIdMapper::id_to_name |
( |
const std::string & |
id, |
|
|
std::string & |
name, |
|
|
bool * |
is_namespacep = 0 |
|
) |
| |
- Parameters
-
id | the id of the table/namespace |
name | returned name of the table/namespace specified by id |
is_namespacep | Set to true if name corresponds to a namespace |
- Returns
- true if mapping exists
Definition at line 69 of file NameIdMapper.cc.
void Hypertable::NameIdMapper::id_to_sublisting |
( |
const std::string & |
id, |
|
|
bool |
include_sub_entries, |
|
|
std::vector< NamespaceListing > & |
listing |
|
) |
| |
- Parameters
-
id | the id of the namespace |
include_sub_entries | include or not include all sub entries |
listing | returned names of the table/namespaces contained within the namespace specified by id |
Definition at line 355 of file NameIdMapper.cc.
bool Hypertable::NameIdMapper::name_to_id |
( |
const std::string & |
name, |
|
|
std::string & |
id, |
|
|
bool * |
is_namespacep = 0 |
|
) |
| |
- Parameters
-
name | name of the table/namespace |
id | the returned id of the table/namespace specified by name |
is_namespacep | Set to true if name corresponds to a namespace |
- Returns
- true if mapping exists
Definition at line 64 of file NameIdMapper.cc.
void Hypertable::NameIdMapper::rename |
( |
const std::string & |
old_name, |
|
|
const std::string & |
new_name |
|
) |
| |
Rename one entity, it doesn't recursively rename all entities under the path specified by old_name.
- Parameters
-
old_name | old name |
new_name | new name |
Definition at line 212 of file NameIdMapper.cc.
std::string Hypertable::NameIdMapper::m_ids_dir |
|
protected |
std::mutex Hypertable::NameIdMapper::m_mutex |
|
protected |
std::string Hypertable::NameIdMapper::m_names_dir |
|
protected |
size_t Hypertable::NameIdMapper::m_prefix_components |
|
protected |
std::string Hypertable::NameIdMapper::m_toplevel_dir |
|
protected |
The documentation for this class was generated from the following files: