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

Method getReadyFileDescriptor

src/Client/HedgedConnectionsFactory.cpp:264–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264int HedgedConnectionsFactory::getReadyFileDescriptor(bool blocking, AsyncCallback & async_callback)
265{
266 epoll_event event{};
267 event.data.fd = -1;
268 if (!blocking)
269 {
270 epoll.getManyReady(1, &event, false);
271 return event.data.fd;
272 }
273
274 size_t events_count = 0;
275 while (events_count == 0)
276 {
277 events_count = epoll.getManyReady(1, &event, !static_cast<bool>(async_callback));
278 if (!events_count && async_callback)
279 async_callback(epoll.getFileDescriptor(), 0, AsyncEventTimeoutType::NONE, epoll.getDescription(), AsyncTaskExecutor::Event::READ | AsyncTaskExecutor::Event::ERROR);
280 }
281 return event.data.fd;
282}
283
284HedgedConnectionsFactory::State HedgedConnectionsFactory::resumeConnectionEstablisher(int index, Connection *& connection_out)
285{

Callers

nothing calls this directly

Calls 3

getManyReadyMethod · 0.80
getFileDescriptorMethod · 0.45
getDescriptionMethod · 0.45

Tested by

no test coverage detected