当前位置: 首页>>代码示例>>C++>>正文


C++ TableIndex::getIndexStats方法代码示例

本文整理汇总了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);
    }
}
开发者ID:AllenShi,项目名称:h-store,代码行数:29,代码来源:tablefactory.cpp

示例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;
}
开发者ID:BibudhLahiriCC,项目名称:voltdb,代码行数:58,代码来源:VoltDBEngine.cpp


注:本文中的TableIndex::getIndexStats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。