MCPcopy Create free account
hub / github.com/ByConity/ByConity / executeImpl

Method executeImpl

src/WorkerTasks/CloudMergeTreeMutateTask.cpp:46–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void CloudMergeTreeMutateTask::executeImpl()
47{
48 auto lock_holder = storage.lockForShare(RWLockImpl::NO_QUERY, storage.getSettings()->lock_acquire_timeout_for_background_operations);
49
50 MergeTreeDataMutator mutate_executor(storage, getContext()->getSettingsRef().background_pool_size);
51 auto data_parts = mutate_executor.mutatePartsToTemporaryParts(params, *manipulation_entry, getContext(), lock_holder);
52
53 if (isCancelled())
54 throw Exception("Merge task " + params.task_id + " is cancelled", ErrorCodes::ABORTED);
55
56 UInt64 peak_memory_usage = 0;
57
58 ManipulationListElement * manipulation_list_element = getManipulationListElement();
59 if (manipulation_list_element)
60 {
61 peak_memory_usage = manipulation_list_element->getMemoryTracker().getPeak();
62 }
63
64 CnchDataWriter cnch_writer(storage, getContext(), ManipulationType::Mutate, params.task_id,
65 /*consumer_group_*/ {}, /*tpl_*/ {}, /*binlog*/ {}, peak_memory_usage);
66 auto res = cnch_writer.dumpAndCommitCnchParts(data_parts);
67 getContext()->getCurrentTransaction()->commitV2();
68 if (params.parts_preload_level)
69 cnch_writer.preload(res.parts);
70}
71
72}

Callers

nothing calls this directly

Calls 11

isCancelledFunction · 0.85
lockForShareMethod · 0.80
getPeakMethod · 0.80
getMemoryTrackerMethod · 0.80
getCurrentTransactionMethod · 0.80
ExceptionClass · 0.50
getSettingsMethod · 0.45
commitV2Method · 0.45
preloadMethod · 0.45

Tested by

no test coverage detected