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

Function ScanAndDiff

src/admincli.cc:1153–1180  ·  view source on GitHub ↗

get tablet key range

Source from the content-addressed store, hash-verified

1151
1152// get tablet key range
1153int ScanAndDiff(const std::string& table_name, const std::string& prefix_path) {
1154 std::map<std::string, std::pair<std::string, std::string>> map_scan;
1155 std::vector<std::string> fail_tablet;
1156 uint64_t tablet_num;
1157
1158 int ret = ScanTabletMeta(table_name, prefix_path, &map_scan, &fail_tablet, &tablet_num);
1159 if (0 != ret || map_scan.size() == 0) {
1160 g_thread_count--;
1161 return 0;
1162 }
1163
1164 FixTabletOverlap(map_scan);
1165 FixTabletGap(map_scan, fail_tablet, table_name, tablet_num);
1166
1167 // compare the scan meta with the read meta
1168 // <path,<startkey,endkey>> map_diffiff
1169 std::map<std::string, std::vector<std::string>> map_diff;
1170 CompareToDiff(map_scan, &map_diff);
1171
1172 // output diff
1173 ret = MapOutPutDiff(&map_diff);
1174 if (0 != ret) {
1175 LOG(ERROR) << "output diff of table(" << table_name << ") fail";
1176 }
1177
1178 g_thread_count--;
1179 return 0;
1180}
1181
1182int InitDfsClient() {
1183 if (g_dfs != NULL) {

Callers 1

TableDiffFunction · 0.85

Calls 6

ScanTabletMetaFunction · 0.85
FixTabletOverlapFunction · 0.85
FixTabletGapFunction · 0.85
CompareToDiffFunction · 0.85
MapOutPutDiffFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected