| 7226 | } |
| 7227 | |
| 7228 | std::shared_ptr<Task> NameServerImpl::CreateDropTableTask(const std::string& endpoint, uint64_t op_index, |
| 7229 | ::fedb::api::OPType op_type, uint32_t tid, uint32_t pid) { |
| 7230 | std::shared_ptr<Task> task = std::make_shared<Task>(endpoint, std::make_shared<::fedb::api::TaskInfo>()); |
| 7231 | auto it = tablets_.find(endpoint); |
| 7232 | if (it == tablets_.end() || it->second->state_ != ::fedb::api::TabletState::kTabletHealthy) { |
| 7233 | return std::shared_ptr<Task>(); |
| 7234 | } |
| 7235 | task->task_info_->set_op_id(op_index); |
| 7236 | task->task_info_->set_op_type(op_type); |
| 7237 | task->task_info_->set_task_type(::fedb::api::TaskType::kDropTable); |
| 7238 | task->task_info_->set_status(::fedb::api::TaskStatus::kInited); |
| 7239 | task->task_info_->set_endpoint(endpoint); |
| 7240 | boost::function<bool()> fun = |
| 7241 | boost::bind(&TabletClient::DropTable, it->second->client_, tid, pid, task->task_info_); |
| 7242 | task->fun_ = boost::bind(&NameServerImpl::WrapTaskFun, this, fun, task->task_info_); |
| 7243 | return task; |
| 7244 | } |
| 7245 | |
| 7246 | std::shared_ptr<Task> NameServerImpl::CreateCheckBinlogSyncProgressTask(uint64_t op_index, ::fedb::api::OPType op_type, |
| 7247 | const std::string& name, const std::string& db, |
nothing calls this directly
no outgoing calls
no test coverage detected