MCPcopy Create free account
hub / github.com/baidu/tera / DoTabletNodeGcPhase2

Method DoTabletNodeGcPhase2

src/master/master_impl.cc:2902–2921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2900}
2901
2902void MasterImpl::DoTabletNodeGcPhase2() {
2903 std::vector<TablePtr> table_list;
2904 tablet_manager_->ShowTable(&table_list, NULL);
2905 for (uint32_t i = 0; i < table_list.size(); ++i) {
2906 table_list[i]->CleanObsoleteFile();
2907 }
2908
2909 LOG(INFO) << "[gc] try clean trash dir.";
2910 int64_t start = get_micros();
2911 io::CleanTrashDir();
2912 int64_t cost = (get_micros() - start) / 1000;
2913 LOG(INFO) << "[gc] clean trash dir done, cost: " << cost << "ms.";
2914
2915 MutexLock lock(&mutex_);
2916 if (gc_enabled_) {
2917 ScheduleTabletNodeGc();
2918 } else {
2919 gc_timer_id_ = kInvalidTimerId;
2920 }
2921}
2922
2923void MasterImpl::RefreshTableCounter() {
2924 int64_t start = get_micros();

Callers

nothing calls this directly

Calls 5

CleanTrashDirFunction · 0.85
ShowTableMethod · 0.80
CleanObsoleteFileMethod · 0.80
get_microsFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected