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

Method DisableTable

src/sdk/client_impl.cc:389–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389bool ClientImpl::DisableTable(const std::string& name, ErrorCode* err) {
390 master::MasterClient master_client(cluster_->MasterAddr());
391
392 DisableTableRequest request;
393 DisableTableResponse response;
394 request.set_sequence_id(g_sequence_id++);
395 request.set_table_name(name);
396 request.set_user_token(
397 GetUserToken(client_options_.user_identity, client_options_.user_passcode));
398
399 access_builder_->BuildRequest(&request);
400
401 string reason;
402 if (master_client.DisableTable(&request, &response)) {
403 if (CheckReturnValue(response.status(), reason, err)) {
404 return true;
405 }
406 LOG(ERROR) << reason << "| status: " << StatusCodeToString(response.status());
407 } else {
408 reason = "rpc fail to disable table: " + name;
409 LOG(ERROR) << reason;
410 err->SetFailed(ErrorCode::kSystem, reason);
411 }
412 return false;
413}
414
415bool ClientImpl::EnableTable(const std::string& name, ErrorCode* err) {
416 master::MasterClient master_client(cluster_->MasterAddr());

Callers 5

delete_tableMethod · 0.45
DisableOpFunction · 0.45
CleanTablesMethod · 0.45
DropTestTablesMethod · 0.45
NativeDisableTableFunction · 0.45

Calls 5

StatusCodeToStringFunction · 0.85
MasterAddrMethod · 0.80
BuildRequestMethod · 0.80
SetFailedMethod · 0.80
statusMethod · 0.45

Tested by 1

DropTestTablesMethod · 0.36