| 251 | } |
| 252 | |
| 253 | NodeTable::NodeTable(const StorageManager* storageManager, |
| 254 | const NodeTableCatalogEntry* nodeTableEntry, MemoryManager* mm) |
| 255 | : Table{nodeTableEntry, storageManager, mm}, |
| 256 | pkColumnID{nodeTableEntry->getColumnID(nodeTableEntry->getPrimaryKeyName())}, |
| 257 | versionRecordHandler(this) { |
| 258 | auto* dataFH = storageManager->getDataFH(); |
| 259 | auto& pageAllocator = *dataFH->getPageManager(); |
| 260 | const auto maxColumnID = nodeTableEntry->getMaxColumnID(); |
| 261 | columns.resize(maxColumnID + 1); |
| 262 | for (auto& property : nodeTableEntry->getProperties()) { |
| 263 | const auto columnID = nodeTableEntry->getColumnID(property.getName()); |
| 264 | const auto columnName = |
| 265 | StorageUtils::getColumnName(property.getName(), StorageUtils::ColumnType::DEFAULT, ""); |
| 266 | columns[columnID] = ColumnFactory::createColumn(columnName, property.getType().copy(), |
| 267 | dataFH, mm, shadowFile, enableCompression); |
| 268 | } |
| 269 | auto& pkDefinition = nodeTableEntry->getPrimaryKeyDefinition(); |
| 270 | DASSERT(pkColumnID != INVALID_COLUMN_ID); |
| 271 | auto hashIndexType = PrimaryKeyIndex::getIndexType(); |
| 272 | IndexInfo indexInfo{PrimaryKeyIndex::DEFAULT_NAME, hashIndexType.typeName, tableID, |
| 273 | {pkColumnID}, {pkDefinition.getType().getPhysicalType()}, |
| 274 | hashIndexType.constraintType == IndexConstraintType::PRIMARY, |
| 275 | hashIndexType.definitionType == IndexDefinitionType::BUILTIN}; |
| 276 | if (storageManager->defaultHashIndexEnabled()) { |
| 277 | indexes.push_back(IndexHolder{PrimaryKeyIndex::createNewIndex(indexInfo, |
| 278 | storageManager->isInMemory(), *mm, pageAllocator, shadowFile)}); |
| 279 | } |
| 280 | nodeGroups = std::make_unique<NodeGroupCollection>(*mm, |
| 281 | LocalNodeTable::getNodeTableColumnTypes(*nodeTableEntry), enableCompression, |
| 282 | storageManager->getDataFH() ? ResidencyState::ON_DISK : ResidencyState::IN_MEMORY, |
| 283 | &versionRecordHandler); |
| 284 | } |
| 285 | |
| 286 | row_idx_t NodeTable::getNumTotalRows(const Transaction* transaction) { |
| 287 | auto numLocalRows = 0u; |
nothing calls this directly
no test coverage detected