| 4017 | } |
| 4018 | |
| 4019 | bool NameServerImpl::SaveTableInfo(std::shared_ptr<TableInfo> table_info) { |
| 4020 | std::string table_value; |
| 4021 | table_info->SerializeToString(&table_value); |
| 4022 | if (table_info->db().empty()) { |
| 4023 | if (!zk_client_->CreateNode(zk_table_data_path_ + "/" + table_info->name(), table_value)) { |
| 4024 | PDLOG(WARNING, "create object table node[%s/%s] failed!", zk_table_data_path_.c_str(), |
| 4025 | table_info->name().c_str()); |
| 4026 | return false; |
| 4027 | } |
| 4028 | PDLOG(INFO, "create table node[%s/%s] success!", zk_table_data_path_.c_str(), table_info->name().c_str()); |
| 4029 | } else { |
| 4030 | if (!zk_client_->CreateNode(zk_db_table_data_path_ + "/" + std::to_string(table_info->tid()), table_value)) { |
| 4031 | PDLOG(WARNING, "create object db table node[%s/%s] failed!", zk_db_table_data_path_.c_str(), |
| 4032 | table_info->name().c_str()); |
| 4033 | return false; |
| 4034 | } |
| 4035 | PDLOG(INFO, "create db table node[%s/%s] success!", zk_db_table_data_path_.c_str(), table_info->name().c_str()); |
| 4036 | } |
| 4037 | |
| 4038 | return true; |
| 4039 | } |
| 4040 | void NameServerImpl::CreateTableInternel(GeneralResponse& response, |
| 4041 | std::shared_ptr<::fedb::nameserver::TableInfo> table_info, |
| 4042 | uint64_t cur_term, |
nothing calls this directly
no test coverage detected