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


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

本文整理汇总了C++中TableIndex::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ TableIndex::getName方法的具体用法?C++ TableIndex::getName怎么用?C++ TableIndex::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TableIndex的用法示例。


在下文中一共展示了TableIndex::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: p_init

bool IndexScanExecutor::p_init(AbstractPlanNode *abstractNode,
        TempTableLimits* limits)
{
    VOLT_TRACE("init IndexScan Executor");

    m_projectionNode = NULL;

    m_node = dynamic_cast<IndexScanPlanNode*>(abstractNode);
    assert(m_node);
    assert(m_node->getTargetTable());

    // Create output table based on output schema from the plan
    setTempOutputTable(limits, m_node->getTargetTable()->name());

    //
    // INLINE PROJECTION
    //
    if (m_node->getInlinePlanNode(PLAN_NODE_TYPE_PROJECTION) != NULL) {
        m_projectionNode = static_cast<ProjectionPlanNode*>
            (m_node->getInlinePlanNode(PLAN_NODE_TYPE_PROJECTION));

        m_projector = OptimizedProjector(m_projectionNode->getOutputColumnExpressions());
        m_projector.optimize(m_projectionNode->getOutputTable()->schema(),
                             m_node->getTargetTable()->schema());
    }

    // Inline aggregation can be serial, partial or hash
    m_aggExec = voltdb::getInlineAggregateExecutor(m_abstractNode);

    //
    // Make sure that we have search keys and that they're not null
    //
    m_numOfSearchkeys = (int)m_node->getSearchKeyExpressions().size();
    m_searchKeyArrayPtr =
            boost::shared_array<AbstractExpression*>
    (new AbstractExpression*[m_numOfSearchkeys]);
    m_searchKeyArray = m_searchKeyArrayPtr.get();

    for (int ctr = 0; ctr < m_numOfSearchkeys; ctr++)
    {
        if (m_node->getSearchKeyExpressions()[ctr] == NULL)
        {
            VOLT_ERROR("The search key expression at position '%d' is NULL for"
                    " PlanNode '%s'", ctr, m_node->debug().c_str());
            return false;
        }
        m_searchKeyArrayPtr[ctr] =
                m_node->getSearchKeyExpressions()[ctr];
    }

    //output table should be temptable
    m_outputTable = static_cast<TempTable*>(m_node->getOutputTable());

    Table* targetTable = m_node->getTargetTable();
    //target table should be persistent table
    assert(dynamic_cast<PersistentTable*>(targetTable));

    TableIndex *tableIndex = targetTable->index(m_node->getTargetIndexName());
    m_searchKeyBackingStore = new char[tableIndex->getKeySchema()->tupleLength()];

    // Grab the Index from our inner table
    // We'll throw an error if the index is missing
    VOLT_TRACE("Index key schema: '%s'", tableIndex->getKeySchema()->debug().c_str());
    //
    // Miscellanous Information
    //
    m_lookupType = m_node->getLookupType();
    m_sortDirection = m_node->getSortDirection();

    VOLT_DEBUG("IndexScan: %s.%s\n", targetTable->name().c_str(), tableIndex->getName().c_str());

    return true;
}
开发者ID:dinuschen,项目名称:voltdb,代码行数:73,代码来源:indexscanexecutor.cpp

示例3: p_init

bool IndexCountExecutor::p_init(AbstractPlanNode *abstractNode,
                                TempTableLimits* limits)
{
    VOLT_DEBUG("init IndexCount Executor");

    m_node = dynamic_cast<IndexCountPlanNode*>(abstractNode);
    assert(m_node);
    assert(m_node->getTargetTable());
    assert(m_node->getPredicate() == NULL);

    // Create output table based on output schema from the plan
    setTempOutputTable(limits);

    //
    // Make sure that we have search keys and that they're not null
    //
    m_numOfSearchkeys = (int)m_node->getSearchKeyExpressions().size();
    if (m_numOfSearchkeys != 0) {
        m_searchKeyArrayPtr =
            boost::shared_array<AbstractExpression*>
            (new AbstractExpression*[m_numOfSearchkeys]);
        m_searchKeyArray = m_searchKeyArrayPtr.get();

        for (int ctr = 0; ctr < m_numOfSearchkeys; ctr++) {
            if (m_node->getSearchKeyExpressions()[ctr] == NULL) {
                VOLT_ERROR("The search key expression at position '%d' is NULL for"
                    " PlanNode '%s'", ctr, m_node->debug().c_str());
                return false;
            }
            m_searchKeyArrayPtr[ctr] = m_node->getSearchKeyExpressions()[ctr];
        }
    }

    m_numOfEndkeys = (int)m_node->getEndKeyExpressions().size();
    if (m_numOfEndkeys != 0) {
        m_endKeyArrayPtr =
            boost::shared_array<AbstractExpression*> (new AbstractExpression*[m_numOfEndkeys]);
        m_endKeyArray = m_endKeyArrayPtr.get();
        for (int ctr = 0; ctr < m_numOfEndkeys; ctr++)
        {
            if (m_node->getEndKeyExpressions()[ctr] == NULL) {
                VOLT_ERROR("The end key expression at position '%d' is NULL for"
                    " PlanNode '%s'", ctr, m_node->debug().c_str());
                return false;
            }
            m_endKeyArrayPtr[ctr] = m_node->getEndKeyExpressions()[ctr];
        }
    }
    //output table should be temptable
    m_outputTable = static_cast<TempTable*>(m_node->getOutputTable());
    m_numOfColumns = static_cast<int>(m_outputTable->columnCount());
    assert(m_numOfColumns == 1);

    // Miscellanous Information
    m_lookupType = INDEX_LOOKUP_TYPE_INVALID;
    if (m_numOfSearchkeys != 0) {
        m_lookupType = m_node->getLookupType();
    }

    if (m_numOfEndkeys != 0) {
        m_endType = m_node->getEndType();
    }

    //
    // Grab the Index from our inner table
    // We'll throw an error if the index is missing
    //
    Table* targetTable = m_node->getTargetTable();
    //target table should be persistenttable
    assert(dynamic_cast<PersistentTable*>(targetTable));

    TableIndex *tableIndex = targetTable->index(m_node->getTargetIndexName());
    assert (tableIndex != NULL);

    // This index should have a true countable flag
    assert(tableIndex->isCountableIndex());

    if (m_numOfSearchkeys != 0) {
        m_searchKeyBackingStore = new char[tableIndex->getKeySchema()->tupleLength()];
    }

    if (m_numOfEndkeys != 0) {
        m_endKeyBackingStore = new char[tableIndex->getKeySchema()->tupleLength()];
    }

    VOLT_DEBUG("IndexCount: %s.%s\n", targetTable->name().c_str(),
            tableIndex->getName().c_str());

    return true;
}
开发者ID:AsherBond,项目名称:voltdb,代码行数:90,代码来源:indexcountexecutor.cpp


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