38 const String &toplevel_dir) {
41 std::vector<Hyperspace::DirEntryAttr> listing;
42 hyperspace->readdir_attr(toplevel_dir +
"/tables",
"schema",
true, listing);
45 hyperspace->readdir_attr(toplevel_dir +
"/tables",
"maintenance_disabled",
true, listing);
54 auto iter =
m_map.find(table_id);
55 if (iter ==
m_map.end())
63 const std::vector<Hyperspace::DirEntryAttr> &listing) {
64 String prefix = !parent.empty() ? parent +
"/" :
"";
65 for (
auto &e : listing) {
66 String name = prefix + e.name;
70 m_map.insert(TableEntryMap::value_type(name, entry));
78 const std::vector<Hyperspace::DirEntryAttr> &listing) {
79 String prefix = !parent.empty() ? parent +
"/" :
"";
80 for (
auto &e : listing) {
81 String name = prefix + e.name;
82 auto iter =
m_map.find(name);
83 if (e.has_attr && iter !=
m_map.end())
84 iter->second.maintenance_disabled =
true;
bool get(const String &table_id, Entry &entry)
Returns Hyperspace cache entry for a table.
Cache entry for Hyperspace table data.
std::string String
A String is simply a typedef to std::string.
HyperspaceTableCache(Hyperspace::SessionPtr &hyperspace, const String &toplevel_dir)
Constructor.
std::shared_ptr< Session > SessionPtr
Compatibility Macros for C/C++.
Declarations for HyperspaceTableCache.
static Schema * new_instance(const std::string &buf)
Creates schema object from XML schema string.
void map_maintenance_disabled(const String &parent, const std::vector< Hyperspace::DirEntryAttr > &listing)
Recursively updates maintenance_disabled field in map entries.
void map_table_schemas(const String &parent, const std::vector< Hyperspace::DirEntryAttr > &listing)
Recursively populates map with table schemas.
SchemaPtr schema
Smart pointer to Schema object.
This is a generic exception class for Hypertable.
TableEntryMap m_map
Table ID to Entry map