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

Function GetNameFromPath

src/master/availability.cc:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace master {
30
31static std::string GetNameFromPath(const std::string& path) {
32 if (path == FLAGS_tera_master_meta_table_path) {
33 return FLAGS_tera_master_meta_table_name;
34 }
35 std::vector<std::string> t;
36 SplitString(path, "/", &t); // table_name/tablet00...001
37 if (!t.empty()) {
38 return t[0];
39 } else {
40 return "";
41 }
42}
43
44TabletAvailability::TabletAvailability(std::shared_ptr<TabletManager> t) : tablet_manager_(t) {
45 start_ts_ = get_micros();

Callers 2

AddNotReadyTabletMethod · 0.85
LogAvailabilityMethod · 0.85

Calls 2

SplitStringFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected