| 1107 | } |
| 1108 | |
| 1109 | void ImpalaHttpHandler::CatalogObjectsHandler(const Webserver::WebRequest& req, |
| 1110 | Document* document) { |
| 1111 | DCHECK(!FLAGS_use_local_catalog); |
| 1112 | const auto& args = req.parsed_args; |
| 1113 | Webserver::ArgumentMap::const_iterator object_type_arg = args.find("object_type"); |
| 1114 | Webserver::ArgumentMap::const_iterator object_name_arg = args.find("object_name"); |
| 1115 | if (object_type_arg != args.end() && object_name_arg != args.end()) { |
| 1116 | TCatalogObjectType::type object_type = |
| 1117 | TCatalogObjectTypeFromName(object_type_arg->second); |
| 1118 | |
| 1119 | // Get the object type and name from the topic entry key |
| 1120 | TCatalogObject request; |
| 1121 | TCatalogObject result; |
| 1122 | Status status = TCatalogObjectFromObjectName(object_type, object_name_arg->second, &request); |
| 1123 | if (status.ok()) { |
| 1124 | // Get the object and dump its contents. |
| 1125 | status = server_->exec_env_->frontend()->GetCatalogObject(request, &result); |
| 1126 | } |
| 1127 | if (status.ok()) { |
| 1128 | Value debug_string(ThriftDebugString(result), document->GetAllocator()); |
| 1129 | document->AddMember("thrift_string", debug_string, document->GetAllocator()); |
| 1130 | } else { |
| 1131 | Value error(status.GetDetail(), document->GetAllocator()); |
| 1132 | document->AddMember("error", error, document->GetAllocator()); |
| 1133 | } |
| 1134 | } else { |
| 1135 | Value error("Please specify values for the object_type and object_name parameters.", |
| 1136 | document->GetAllocator()); |
| 1137 | document->AddMember("error", error, document->GetAllocator()); |
| 1138 | } |
| 1139 | } |
| 1140 | |
| 1141 | namespace { |
| 1142 |
nothing calls this directly
no test coverage detected