healthcheck [inmem] [start_key] [end_key]
| 1564 | |
| 1565 | // healthcheck [inmem] [start_key] [end_key] |
| 1566 | CliStatus MetaHealthCheckOp(Client* client, int32_t argc, std::string* argv, ErrorCode* err) { |
| 1567 | if (0 != InitDfsClient()) { |
| 1568 | LOG(ERROR) << "Init Dfs Client fail"; |
| 1569 | return CliStatus::kError; |
| 1570 | } |
| 1571 | g_env = new leveldb::DfsEnv(g_dfs); |
| 1572 | |
| 1573 | scoped_ptr<tera::sdk::ClusterFinder> finder(tera::sdk::NewClusterFinder()); |
| 1574 | const std::string meta_server = finder->RootTableAddr(); |
| 1575 | std::string start_key; |
| 1576 | std::string end_key; |
| 1577 | |
| 1578 | if (argc == 4 || argc == 2) { |
| 1579 | if (argc == 4) { |
| 1580 | start_key = argv[2]; |
| 1581 | end_key = argv[3]; |
| 1582 | } else { |
| 1583 | start_key = ""; |
| 1584 | end_key = ""; |
| 1585 | } |
| 1586 | common::ThreadPool thread_pool(1); |
| 1587 | return MetaInternalOp(meta_server, &thread_pool, "healtchcheck", start_key, end_key, ""); |
| 1588 | } else if ((argc == 5 || argc == 3) && argv[2] == "inmem") { |
| 1589 | if (argc == 5) { |
| 1590 | start_key = argv[3]; |
| 1591 | end_key = argv[4]; |
| 1592 | } else { |
| 1593 | start_key = ""; |
| 1594 | end_key = ""; |
| 1595 | } |
| 1596 | |
| 1597 | TableMetaList table_list; |
| 1598 | TabletMetaList tablet_list; |
| 1599 | std::shared_ptr<tera::ClientImpl> client_impl( |
| 1600 | (static_cast<ClientWrapper*>(client))->GetClientImpl()); |
| 1601 | if (!client_impl->ShowTablesInfo(&table_list, &tablet_list, false, err)) { |
| 1602 | LOG(ERROR) << "fail to get meta data from tera."; |
| 1603 | return CliStatus::kError; |
| 1604 | } |
| 1605 | return ProcessMeta("healthcheck", table_list, tablet_list, start_key, end_key, ""); |
| 1606 | } else { |
| 1607 | PrintCmdHelpInfo(argv[1]); |
| 1608 | } |
| 1609 | return CliStatus::kOk; |
| 1610 | } |
| 1611 | |
| 1612 | // conv <readable_key> |
| 1613 | CliStatus MetaConvOp(Client* client, int32_t argc, std::string* argv, ErrorCode* err) { |
nothing calls this directly
no test coverage detected