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


C++ TupleSchema::columnType方法代码示例

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


在下文中一共展示了TupleSchema::columnType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initTable

TEST_F(TupleSchemaTest, CreateEvictedTupleSchema) {
    initTable(true);
    
    // Create the TupleSchema for our evicted tuple tables
    // The first columns should be all of the columns of our primary key index
    TupleSchema *evictedSchema = TupleSchema::createEvictedTupleSchema();
    // fprintf(stdout, "\nEVICTED TABLE SCHEMA\n%s\n", evictedSchema->debug().c_str());
    ASSERT_EQ(2, evictedSchema->columnCount());
    ASSERT_EQ(VALUE_TYPE_SMALLINT, evictedSchema->columnType(0));
    ASSERT_EQ(VALUE_TYPE_INTEGER, evictedSchema->columnType(1));
    
    TupleSchema::freeTupleSchema(evictedSchema);
}
开发者ID:AllenShi,项目名称:h-store,代码行数:13,代码来源:tupleschema_test.cpp

示例2: initTable

TEST_F(TupleSchemaTest, CreateEvictedTupleSchema) {
    initTable(true);
    
    // Create the TupleSchema for our evicted tuple tables
    // The first columns should be all of the columns of our primary key index
    TupleSchema *evictedSchema = TupleSchema::createEvictedTupleSchema(m_primaryKeyIndexSchema);
    // fprintf(stdout, "\nEVICTED TABLE SCHEMA\n%s\n", evictedSchema->debug().c_str());
    ASSERT_EQ(m_numPrimaryKeyCols+1, evictedSchema->columnCount());
    for (int i = 0; i < m_numPrimaryKeyCols; i++) {
        ASSERT_EQ(m_primaryKeyIndexSchema->columnType(i), evictedSchema->columnType(i));
        ASSERT_EQ(m_primaryKeyIndexSchema->columnLength(i), evictedSchema->columnLength(i));
        ASSERT_EQ(m_primaryKeyIndexSchema->columnAllowNull(i), evictedSchema->columnAllowNull(i));
    }
    
    // Then there should only be one more column that contains the 16-bit block ids
    ASSERT_EQ(VALUE_TYPE_SMALLINT, evictedSchema->columnType(m_numPrimaryKeyCols));
    ASSERT_FALSE(evictedSchema->columnAllowNull(m_numPrimaryKeyCols));
    
    TupleSchema::freeTupleSchema(evictedSchema);
}
开发者ID:apsaltis,项目名称:h-store,代码行数:20,代码来源:tupleschema_test.cpp

示例3: picker

TableIndex *TableIndexFactory::getInstance(const TableIndexScheme &scheme) {
    int colCount = (int)scheme.columnIndices.size();
    TupleSchema *tupleSchema = scheme.tupleSchema;
    assert(tupleSchema);
    std::vector<ValueType> keyColumnTypes;
    std::vector<int32_t> keyColumnLengths;
    std::vector<bool> keyColumnAllowNull(colCount, true);
    for (int i = 0; i < colCount; ++i) {
        keyColumnTypes.push_back(tupleSchema->columnType(scheme.columnIndices[i]));
        keyColumnLengths.push_back(tupleSchema->columnLength(scheme.columnIndices[i]));
    }
    TupleSchema *keySchema = TupleSchema::createTupleSchema(keyColumnTypes, keyColumnLengths, keyColumnAllowNull, true);
    assert(keySchema);
    VOLT_TRACE("Creating index for %s.\n%s", scheme.name.c_str(), keySchema->debug().c_str());
    TableIndexPicker picker(keySchema, scheme);
    TableIndex *retval = picker.getInstance();
    return retval;
}
开发者ID:varadharajan,项目名称:voltdb,代码行数:18,代码来源:tableindexfactory.cpp


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