| 242 | } |
| 243 | |
| 244 | ConnectionPoolWithFailover::TryResult |
| 245 | ConnectionPoolWithFailover::tryGetEntry( |
| 246 | const ConnectionPoolPtr & pool, |
| 247 | const ConnectionTimeouts & timeouts, |
| 248 | std::string & fail_message, |
| 249 | const Settings & settings, |
| 250 | const QualifiedTableName * table_to_check, |
| 251 | [[maybe_unused]] AsyncCallback async_callback, |
| 252 | bool force_connected) |
| 253 | { |
| 254 | #if defined(OS_LINUX) |
| 255 | if (async_callback) |
| 256 | { |
| 257 | ConnectionEstablisherAsync connection_establisher_async(pool, &timeouts, settings, log, table_to_check); |
| 258 | while (true) |
| 259 | { |
| 260 | connection_establisher_async.resumeConnectionWithForceOption(force_connected); |
| 261 | |
| 262 | if (connection_establisher_async.isFinished()) |
| 263 | break; |
| 264 | |
| 265 | async_callback( |
| 266 | connection_establisher_async.getFileDescriptor(), |
| 267 | 0, |
| 268 | AsyncEventTimeoutType::NONE, |
| 269 | "Connection establisher file descriptor", |
| 270 | AsyncTaskExecutor::Event::READ | AsyncTaskExecutor::Event::ERROR); |
| 271 | } |
| 272 | |
| 273 | fail_message = connection_establisher_async.getFailMessage(); |
| 274 | return connection_establisher_async.getResult(); |
| 275 | } |
| 276 | #endif |
| 277 | |
| 278 | ConnectionEstablisher connection_establisher(pool, &timeouts, settings, log, table_to_check); |
| 279 | TryResult result; |
| 280 | connection_establisher.run(result, fail_message, force_connected); |
| 281 | return result; |
| 282 | } |
| 283 | |
| 284 | std::vector<ConnectionPoolWithFailover::Base::ShuffledPool> |
| 285 | ConnectionPoolWithFailover::getShuffledPools(const Settings & settings, GetPriorityForLoadBalancing::Func priority_func, bool use_slowdown_count) |
nothing calls this directly
no test coverage detected