Provides efficient lookup of Hyperspace table data. More...
#include <HyperspaceTableCache.h>
Classes | |
class | Entry |
Cache entry for Hyperspace table data. More... | |
Public Member Functions | |
HyperspaceTableCache (Hyperspace::SessionPtr &hyperspace, const String &toplevel_dir) | |
Constructor. More... | |
bool | get (const String &table_id, Entry &entry) |
Returns Hyperspace cache entry for a table. More... | |
Private Types | |
typedef std::map< String, Entry > | TableEntryMap |
Table ID to Entry map type. More... | |
Private Member Functions | |
void | map_table_schemas (const String &parent, const std::vector< Hyperspace::DirEntryAttr > &listing) |
Recursively populates map with table schemas. More... | |
void | map_maintenance_disabled (const String &parent, const std::vector< Hyperspace::DirEntryAttr > &listing) |
Recursively updates maintenance_disabled field in map entries. More... | |
Private Attributes | |
TableEntryMap | m_map |
Table ID to Entry map More... | |
Provides efficient lookup of Hyperspace table data.
This class efficiently reads schema and maintenance_disabled attribute for all tables in Hyperspace into memory and provides an API for fast lookup.
Definition at line 47 of file HyperspaceTableCache.h.
|
private |
Table ID to Entry map type.
Definition at line 91 of file HyperspaceTableCache.h.
HyperspaceTableCache::HyperspaceTableCache | ( | Hyperspace::SessionPtr & | hyperspace, |
const String & | toplevel_dir | ||
) |
Constructor.
This constructor reads table information (schemas and maintenance_disabled attribute) from Hyperspace and caches the information in an in-memory map (m_map) with the key being the table ID.
hyperspace | &Hyperspace session |
toplevel_dir | Toplevel hyperspace directory |
Definition at line 37 of file HyperspaceTableCache.cc.
Returns Hyperspace cache entry for a table.
table_id | Table identifier string |
entry | Reference to Entry object to be filled in |
table_id
, false otherwise. Definition at line 53 of file HyperspaceTableCache.cc.
|
private |
Recursively updates maintenance_disabled field in map entries.
parent | Parent ID pathname |
listing | Vector of directory entries within parent |
Definition at line 77 of file HyperspaceTableCache.cc.
|
private |
Recursively populates map with table schemas.
parent | Parent ID pathname |
listing | Vector of directory entries within parent |
Definition at line 62 of file HyperspaceTableCache.cc.
|
private |
Table ID to Entry map
Definition at line 94 of file HyperspaceTableCache.h.