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

Method executeManually

src/CloudServices/CnchPartGCThread.cpp:52–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void CnchPartGCThread::executeManually(const ASTPtr & partition, ContextPtr local_context)
53{
54 auto istorage = getStorageFromCatalog();
55 auto & storage = checkAndGetCnchTable(istorage);
56 if (istorage->is_dropped)
57 {
58 LOG_DEBUG(log, "Table was dropped, do nothing...");
59 return;
60 }
61
62 Strings partitions;
63 if (partition)
64 partitions.push_back(storage.getPartitionIDFromQuery(partition, local_context));
65 else
66 partitions = catalog->getPartitionIDs(istorage, nullptr);
67
68 Stopwatch watch;
69 doPhaseOneGC(istorage, storage, partitions);
70 LOG_INFO(log, "Successfully execute phase-one GC in {} ms", watch.elapsedMilliseconds());
71
72 watch.restart();
73 auto nremoved = doPhaseTwoGC(istorage, storage);
74 LOG_INFO(log, "Successfully execute phase-two GC in {} ms, removed {} files", watch.elapsedMilliseconds(), nremoved);
75}
76
77void CnchPartGCThread::stop()
78{

Callers 2

executeGcMethod · 0.45
executeCheckpointMethod · 0.45

Calls 5

push_backMethod · 0.45
getPartitionIDsMethod · 0.45
elapsedMillisecondsMethod · 0.45
restartMethod · 0.45

Tested by

no test coverage detected