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

Method sendQueryAsync

src/QueryPipeline/RemoteQueryExecutor.cpp:493–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493int RemoteQueryExecutor::sendQueryAsync()
494{
495#if defined(OS_LINUX)
496 LockAndBlocker lock(was_cancelled_mutex);
497 if (was_cancelled)
498 return -1;
499
500 if (!read_context)
501 read_context = std::make_unique<ReadContext>(
502 *this,
503 /*suspend_when_query_sent*/ true,
504 read_packet_type_separately);
505
506 /// If query already sent, do nothing. Note that we cannot use sent_query flag here,
507 /// because we can still be in process of sending scalars or external tables.
508 if (read_context->isQuerySent())
509 return -1;
510
511 read_context->resume();
512
513 if (read_context->isQuerySent())
514 return -1;
515
516 ProfileEvents::increment(ProfileEvents::SuspendSendingQueryToShard); /// Mostly for testing purposes.
517 return read_context->getFileDescriptor();
518#else
519 sendQuery();
520 return -1;
521#endif
522}
523
524Block RemoteQueryExecutor::readBlock()
525{

Callers 2

tryGenerateMethod · 0.80

Calls 4

isQuerySentMethod · 0.80
incrementFunction · 0.50
resumeMethod · 0.45
getFileDescriptorMethod · 0.45

Tested by

no test coverage detected