5 #include <sandesh/request_pipeline.h>
9 #include <boost/algorithm/string.hpp>
15 #include "ifmap/ifmap_server_show_types.h"
40 string idtype = element_type;
41 std::replace(idtype.begin(), idtype.end(),
'-',
'_');
42 string name =
"__ifmap__." + idtype +
".0";
48 iter != db->
end(); ++iter) {
49 if (iter->first.find(
"__ifmap__.") != 0) {
58 std::vector<IFMapNodeTableListShowEntry> *table_list) {
60 iter != db->
end(); ++iter) {
62 if (table->
name().compare(
"__ifmap_metadata__.0") == 0) {
69 size_t first = table->
name().find_first_of(
".");
70 size_t second = table->
name().find_first_of(
".", first + 1);
71 std::string
name = table->
name().substr(first + 1, second - first - 1);
72 std::replace(name.begin(), name.end(),
'_',
'-');
74 IFMapNodeTableListShowEntry entry;
75 entry.table_name =
name;
76 entry.size = table->
Size();
78 table_list->push_back(entry);
79 if (table->
name().find(
"__ifmap__") != 0) {
DBEntry * Find(const DBEntry *entry)
IFMapTable(DB *db, const std::string &name, DBGraph *graph)
DBEntry * FindNext(const DBRequestKey *key)
const_iterator const_lower_bound(const std::string &name)
virtual size_t Size() const
IFMapNode * FindNode(const std::string &name)
TableMap::iterator iterator
TableMap::const_iterator const_iterator
static void FillNodeTableList(DB *db, std::vector< IFMapNodeTableListShowEntry > *table_list)
IFMapNode * FindNextNode(const std::string &name)
const std::string & name() const
iterator lower_bound(const std::string &name)
static void ClearTables(DB *db)
virtual DBTablePartBase * GetTablePartition(const DBRequestKey *key)
static IFMapTable * FindTable(DB *db, const std::string &element_type)
DBTableBase * FindTable(const std::string &name)