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

Function FixTabletOverlap

src/admincli.cc:957–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957void FixTabletOverlap(std::map<std::string, std::pair<std::string, std::string>>& map_scan) {
958 auto it = map_scan.begin();
959 while (it != map_scan.end()) {
960 // it_pre->first always < it->first
961 auto it_pre = it;
962 ++it;
963 if (it != map_scan.end()) {
964 /************* remove the overlap ************
965 * <it->first, <it->second.first, it->second.second>>
966 * <startkey, <endkey, path>>
967 *
968 * it_pre |------------)
969 * it |----)
970 */
971 if (it->first < it_pre->second.first) {
972 LOG(INFO) << "overlap --"
973 << " tablet path1:" << it_pre->second.second << "startkey1" << it_pre->first
974 << "endkey1" << it_pre->second.first << "tablet path2" << it->second.second
975 << "startkey2" << it->first << "endkey2" << it->second.first;
976 if (it->second.second > it_pre->second.second) {
977 map_scan.erase(it_pre->first);
978 } else {
979 map_scan.erase(it->first);
980 }
981 }
982 }
983 }
984}
985
986std::string GetTabletName(const std::vector<std::string>& fail_tablet, uint32_t& index,
987 uint64_t& tablet_num) {

Callers 1

ScanAndDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected