0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Hypertable::HyperspaceTableCache Class Reference

Provides efficient lookup of Hyperspace table data. More...

#include <HyperspaceTableCache.h>

Collaboration diagram for Hypertable::HyperspaceTableCache:
Collaboration graph
[legend]

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, EntryTableEntryMap
 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...
 

Detailed Description

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.

Member Typedef Documentation

Table ID to Entry map type.

Definition at line 91 of file HyperspaceTableCache.h.

Constructor & Destructor Documentation

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.

Parameters
hyperspace&Hyperspace session
toplevel_dirToplevel hyperspace directory

Definition at line 37 of file HyperspaceTableCache.cc.

Member Function Documentation

bool HyperspaceTableCache::get ( const String table_id,
Entry entry 
)

Returns Hyperspace cache entry for a table.

Parameters
table_idTable identifier string
entryReference to Entry object to be filled in
Returns
true if cache entry found for table_id, false otherwise.

Definition at line 53 of file HyperspaceTableCache.cc.

void HyperspaceTableCache::map_maintenance_disabled ( const String parent,
const std::vector< Hyperspace::DirEntryAttr > &  listing 
)
private

Recursively updates maintenance_disabled field in map entries.

Parameters
parentParent ID pathname
listingVector of directory entries within parent

Definition at line 77 of file HyperspaceTableCache.cc.

void HyperspaceTableCache::map_table_schemas ( const String parent,
const std::vector< Hyperspace::DirEntryAttr > &  listing 
)
private

Recursively populates map with table schemas.

Parameters
parentParent ID pathname
listingVector of directory entries within parent

Definition at line 62 of file HyperspaceTableCache.cc.

Member Data Documentation

TableEntryMap Hypertable::HyperspaceTableCache::m_map
private

Table ID to Entry map

Definition at line 94 of file HyperspaceTableCache.h.


The documentation for this class was generated from the following files: