0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
HyperspaceTableCache.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
28 #ifndef Hypertable_HyperspaceTableCache_h
29 #define Hypertable_HyperspaceTableCache_h
30 
31 #include "Hypertable/Lib/Schema.h"
32 
33 #include "Hyperspace/Session.h"
34 
35 #include <map>
36 #include <memory>
37 
38 namespace Hypertable {
39 
42 
48  public:
49 
51  class Entry {
52  public:
57  };
58 
67  const String &toplevel_dir);
68 
74  bool get(const String &table_id, Entry &entry);
75 
76  private:
77 
81  void map_table_schemas(const String &parent,
82  const std::vector<Hyperspace::DirEntryAttr> &listing);
83 
87  void map_maintenance_disabled(const String &parent,
88  const std::vector<Hyperspace::DirEntryAttr> &listing);
89 
91  typedef std::map<String, Entry> TableEntryMap;
92 
94  TableEntryMap m_map;
95  };
96 
98  typedef std::shared_ptr<HyperspaceTableCache> HyperspaceTableCachePtr;
99 
101 }
102 
103 #endif // Hypertable_HyperspaceTableCache_h
Provides efficient lookup of Hyperspace table data.
Cache entry for Hyperspace table data.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
HyperspaceTableCache(Hyperspace::SessionPtr &hyperspace, const String &toplevel_dir)
Constructor.
Declarations for Schema.
std::shared_ptr< Session > SessionPtr
Definition: Session.h:734
Hypertable definitions
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.
std::map< String, Entry > TableEntryMap
Table ID to Entry map type.
std::shared_ptr< HyperspaceTableCache > HyperspaceTableCachePtr
Smart pointer to HyperspaceTableCache.
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
Definition: Schema.h:465
TableEntryMap m_map
Table ID to Entry map
bool maintenance_disabled
Flag indicating if "maintenance_disabled" attribute is set.