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

Method run

src/QueryPipeline/RemoteQueryExecutorReadContext.cpp:47–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void RemoteQueryExecutorReadContext::Task::run(AsyncCallback async_callback, SuspendCallback suspend_callback)
48{
49 read_context.executor.sendQueryUnlocked(ClientInfo::QueryKind::SECONDARY_QUERY, async_callback);
50 read_context.is_query_sent = true;
51
52 if (read_context.suspend_when_query_sent)
53 suspend_callback();
54
55 if (read_context.executor.needToSkipUnavailableShard())
56 return;
57
58 while (true)
59 {
60 read_context.has_read_packet_part = PacketPart::None;
61
62 if (read_context.read_packet_type_separately)
63 {
64 read_context.packet.type = read_context.executor.getConnections().receivePacketTypeUnlocked(async_callback);
65 read_context.has_read_packet_part = PacketPart::Type;
66 suspend_callback();
67 }
68 read_context.packet = read_context.executor.getConnections().receivePacketUnlocked(async_callback);
69 read_context.has_read_packet_part = PacketPart::Body;
70 suspend_callback();
71 }
72}
73
74void RemoteQueryExecutorReadContext::processAsyncEvent(
75 int fd, Poco::Timespan socket_timeout, AsyncEventTimeoutType type, const std::string & description, uint32_t events)

Callers 1

RemoteQueryExecutorMethod · 0.45

Calls 4

sendQueryUnlockedMethod · 0.80
receivePacketUnlockedMethod · 0.45

Tested by

no test coverage detected