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

Method run

src/processor/processor_task.cpp:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 sharedStateInitialized{false}, sink{sink}, executionContext{executionContext} {}
18
19void ProcessorTask::run() {
20 // We need the lock when cloning because multiple threads can be accessing to clone,
21 // which is not thread safe
22 lock_t lck{taskMtx};
23 if (!sharedStateInitialized) {
24 sink->initGlobalState(executionContext);
25 sharedStateInitialized = true;
26 }
27 auto taskRoot = sink->copy();
28 lck.unlock();
29 auto resultSet =
30 sink->getResultSet(storage::MemoryManager::Get(*executionContext->clientContext));
31 taskRoot->ptrCast<Sink>()->execute(resultSet.get(), executionContext);
32}
33
34void ProcessorTask::finalize() {
35 ProgressBar::Get(*executionContext->clientContext)->finishPipeline(executionContext->queryID);

Callers

nothing calls this directly

Calls 6

initGlobalStateMethod · 0.80
unlockMethod · 0.80
getResultSetMethod · 0.80
copyMethod · 0.45
executeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected