MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / NodeTable

Method NodeTable

src/storage/table/node_table.cpp:253–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253NodeTable::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
286row_idx_t NodeTable::getNumTotalRows(const Transaction* transaction) {
287 auto numLocalRows = 0u;

Callers

nothing calls this directly

Calls 13

getIndexTypeFunction · 0.85
getPageManagerMethod · 0.80
isInMemoryMethod · 0.80
getColumnIDMethod · 0.45
getDataFHMethod · 0.45
getMaxColumnIDMethod · 0.45
resizeMethod · 0.45
getPropertiesMethod · 0.45
getNameMethod · 0.45
copyMethod · 0.45
getTypeMethod · 0.45
getPhysicalTypeMethod · 0.45

Tested by

no test coverage detected