| 491 | } |
| 492 | |
| 493 | int 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 | |
| 524 | Block RemoteQueryExecutor::readBlock() |
| 525 | { |
no test coverage detected