| 17 | sharedStateInitialized{false}, sink{sink}, executionContext{executionContext} {} |
| 18 | |
| 19 | void 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 | |
| 34 | void ProcessorTask::finalize() { |
| 35 | ProgressBar::Get(*executionContext->clientContext)->finishPipeline(executionContext->queryID); |
nothing calls this directly
no test coverage detected