| 50 | } |
| 51 | |
| 52 | void 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 | |
| 77 | void CnchPartGCThread::stop() |
| 78 | { |
no test coverage detected