本文整理汇总了C++中TableIndex::getIndexStats方法的典型用法代码示例。如果您正苦于以下问题:C++ TableIndex::getIndexStats方法的具体用法?C++ TableIndex::getIndexStats怎么用?C++ TableIndex::getIndexStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableIndex
的用法示例。
在下文中一共展示了TableIndex::getIndexStats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: configureStats
void TableFactory::configureStats(voltdb::CatalogId databaseId,
ExecutorContext *ctx,
std::string name,
Table *table) {
std::string hostname = "";
if(ctx != NULL)
hostname = ctx->m_hostname;
// initialize stats for the table
table->getTableStats()->configure(name + " stats",
ctx->m_hostId,
hostname,
ctx->m_siteId,
ctx->m_partitionId,
databaseId);
// initialize stats for all the indexes for the table
std::vector<TableIndex*> tindexes = table->allIndexes();
for (size_t i = 0; i < tindexes.size(); i++) {
TableIndex *index = tindexes[i];
index->getIndexStats()->configure(index->getName() + " stats",
table->name(),
ctx->m_hostId,
hostname,
ctx->m_siteId,
ctx->m_partitionId,
databaseId);
}
}
示例2: rebuildTableCollections
/*
* Delete and rebuild id based table collections. Does not affect
* any currently stored tuples.
*/
bool VoltDBEngine::rebuildTableCollections() {
// 1. See header comments explaining m_snapshottingTables.
// 2. Don't clear m_exportTables. They are still exporting, even if deleted.
// 3. Clear everything else.
m_tables.clear();
m_tablesByName.clear();
// need to re-map all the table ids / indexes
getStatsManager().unregisterStatsSource(STATISTICS_SELECTOR_TYPE_TABLE);
getStatsManager().unregisterStatsSource(STATISTICS_SELECTOR_TYPE_INDEX);
map<string, CatalogDelegate*>::iterator cdIt = m_catalogDelegates.begin();
// walk the table delegates and update local table collections
while (cdIt != m_catalogDelegates.end()) {
TableCatalogDelegate *tcd = dynamic_cast<TableCatalogDelegate*>(cdIt->second);
if (tcd) {
catalog::Table *catTable = m_database->tables().get(tcd->getTable()->name());
m_tables[catTable->relativeIndex()] = tcd->getTable();
m_tablesByName[tcd->getTable()->name()] = tcd->getTable();
getStatsManager().registerStatsSource(STATISTICS_SELECTOR_TYPE_TABLE,
catTable->relativeIndex(),
tcd->getTable()->getTableStats());
// add all of the indexes to the stats source
std::vector<TableIndex*> tindexes = tcd->getTable()->allIndexes();
for (int i = 0; i < tindexes.size(); i++) {
TableIndex *index = tindexes[i];
getStatsManager().registerStatsSource(STATISTICS_SELECTOR_TYPE_INDEX,
catTable->relativeIndex(),
index->getIndexStats());
}
/*map<string, catalog::Index*>::const_iterator index_iterator;
for (index_iterator = catTable->indexes().begin();
index_iterator != catTable->indexes().end(); index_iterator++) {
const catalog::Index *catalogIndex = index_iterator->second;
TableIndex *index = tcd->getTable()->index(catalogIndex->name());
printf("Looking for index named: %s\n", catalogIndex->name().c_str());
assert(index);
getStatsManager().registerStatsSource(STATISTICS_SELECTOR_TYPE_INDEX,
catTable->relativeIndex(),
index->getIndexStats());
}*/
}
cdIt++;
}
return true;
}