MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / performZooKeeperGetRequest

Method performZooKeeperGetRequest

src/Server/KeeperHTTPStorageHandler.cpp:199–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void KeeperHTTPStorageHandler::performZooKeeperGetRequest(const std::string & storage_path, HTTPServerResponse & response) const
200{
201 String result;
202 if (!keeper_client->get()->tryGet(storage_path, result))
203 {
204 setErrorResponseForZKCode(Coordination::Error::ZNONODE, response);
205 return;
206 }
207
208 response.setStatus(Poco::Net::HTTPResponse::HTTP_OK);
209 response.setContentType("application/octet-stream");
210 response.setContentLength(result.size());
211
212 auto buffer = response.send();
213 buffer->write(result.c_str(), result.size());
214 buffer->next();
215}
216
217void KeeperHTTPStorageHandler::performZooKeeperSetRequest(
218 const std::string & storage_path, HTTPServerRequest & request, HTTPServerResponse & response) const

Callers

nothing calls this directly

Calls 10

setContentLengthMethod · 0.80
tryGetMethod · 0.45
getMethod · 0.45
setStatusMethod · 0.45
setContentTypeMethod · 0.45
sizeMethod · 0.45
sendMethod · 0.45
writeMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected