MCPcopy Create free account
hub / github.com/ByConity/ByConity / processQuery

Method processQuery

src/Server/InterserverIOHTTPHandler.cpp:51–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void InterserverIOHTTPHandler::processQuery(HTTPServerRequest & request, HTTPServerResponse & response, Output & used_output)
52{
53 HTMLForm params(server.context()->getSettingsRef(), request);
54
55 LOG_TRACE(log, "Request URI: {}", request.getURI());
56
57 String endpoint_name = params.get("endpoint");
58 bool compress = params.get("compress") == "true";
59
60 auto & body = request.getStream();
61
62 auto endpoint = server.context()->getInterserverIOHandler().getEndpoint(endpoint_name);
63 /// Locked for read while query processing
64 std::shared_lock lock(endpoint->rwlock);
65 if (endpoint->blocker.isCancelled())
66 throw Exception("Transferring part to replica was cancelled", ErrorCodes::ABORTED);
67
68 if (compress)
69 {
70 CompressedWriteBuffer compressed_out(*used_output.out);
71 endpoint->processQuery(params, body, compressed_out, response);
72 }
73 else
74 {
75 endpoint->processQuery(params, body, *used_output.out, response);
76 }
77}
78
79
80void InterserverIOHTTPHandler::handleRequest(HTTPServerRequest & request, HTTPServerResponse & response)

Callers

nothing calls this directly

Calls 6

getStreamMethod · 0.80
getEndpointMethod · 0.80
ExceptionClass · 0.50
contextMethod · 0.45
getMethod · 0.45
isCancelledMethod · 0.45

Tested by

no test coverage detected