get tablet key range
| 1151 | |
| 1152 | // get tablet key range |
| 1153 | int 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 | |
| 1182 | int InitDfsClient() { |
| 1183 | if (g_dfs != NULL) { |
no test coverage detected