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

Method appendLocalState

src/processor/operator/semi_masker.cpp:13–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace processor {
12
13SemiMaskerLocalState* SemiMaskerSharedState::appendLocalState() {
14 auto localInfo = std::make_unique<SemiMaskerLocalState>();
15 bool isSingle = masksPerTable.size() == 1;
16 for (const auto& [tableID, vector] : masksPerTable) {
17 auto& mask = vector.front();
18 auto newOne = SemiMaskUtil::createMask(mask->getMaxOffset());
19 if (isSingle) {
20 localInfo->singleTableRef = newOne.get();
21 }
22 localInfo->localMasksPerTable.insert({tableID, std::move(newOne)});
23 }
24 std::unique_lock lock{mtx};
25 localInfos.push_back(std::move(localInfo));
26 return localInfos[localInfos.size() - 1].get();
27}
28
29void SemiMaskerSharedState::mergeToGlobal() {
30 for (const auto& [tableID, globalVector] : masksPerTable) {

Callers 1

Calls 5

sizeMethod · 0.45
getMaxOffsetMethod · 0.45
getMethod · 0.45
insertMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected