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

Function LoadTablesMapOp

src/terautil.cc:1322–1352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1320}
1321
1322int LoadTablesMapOp() {
1323 std::string ins_cluster_addr = FLAGS_ins_cluster_addr;
1324 std::string ins_cluster_root_path = FLAGS_ins_cluster_dump_root_path;
1325
1326 if (FLAGS_tables_map_file == "") {
1327 LOG(WARNING) << "Should set --tables_map_file before use prepare_tables!";
1328 return -1;
1329 }
1330 std::map<std::string, std::string> tables_map;
1331 std::map<std::string, std::string> tables_lg_map;
1332 if (-1 == LoadTablesMapFile(FLAGS_tables_map_file, &tables_map, &tables_lg_map)) {
1333 LOG(WARNING) << "Load tables_map_file failed!";
1334 return -1;
1335 }
1336
1337 // Put t1=>t2 in nexus
1338 galaxy::ins::sdk::InsSDK ins_sdk(ins_cluster_addr);
1339 std::string path = ins_cluster_root_path + "/" + FLAGS_dump_tables_map_path;
1340 if (-1 == PutMapInNexus(path, &ins_sdk, tables_map)) {
1341 LOG(WARNING) << "PutMapInNexus failed";
1342 return -1;
1343 }
1344
1345 // Put src_t1=>lg in nexus
1346 path = ins_cluster_root_path + "/" + FLAGS_dump_tables_lg_map_path;
1347 if (-1 == PutMapInNexus(path, &ins_sdk, tables_lg_map)) {
1348 LOG(WARNING) << "DumpTables lg Map failed";
1349 return -1;
1350 }
1351 return 0;
1352}
1353
1354int CreateDfsPath(const std::map<std::string, std::string>& tables_map,
1355 const std::string& dfs_parent_path) {

Callers 1

mainFunction · 0.85

Calls 2

LoadTablesMapFileFunction · 0.85
PutMapInNexusFunction · 0.85

Tested by

no test coverage detected