| 316 | } |
| 317 | |
| 318 | redis_client* redis_client_cluster::reopen(redis_command& cmd, |
| 319 | redis_client* conn) |
| 320 | { |
| 321 | connect_pool* pool = conn->get_pool(); |
| 322 | int slot = cmd.get_slot(); |
| 323 | |
| 324 | // ɾ����ϣ���еĵ�ַӳ���ϵ�Ա��´β���ʱ���»�ȡ |
| 325 | clear_slot(slot); |
| 326 | |
| 327 | // �����Ӷ���黹�����ӳض��� |
| 328 | pool->put(conn, false); |
| 329 | |
| 330 | redis_request* obj = cmd.get_request_obj(); |
| 331 | string* buf = cmd.get_request_buf(); |
| 332 | // ������ӶϿ�����������Ϊ��ʱ������������ |
| 333 | if ((obj == NULL || !obj->get_size()) && buf->empty()) { |
| 334 | logger_error("not retry when no request!"); |
| 335 | return NULL; |
| 336 | } |
| 337 | |
| 338 | #ifdef AUTO_SET_ALIVE |
| 339 | // �����ӳض�����Ϊ������״̬ |
| 340 | pool->set_alive(false); |
| 341 | #endif |
| 342 | // �����ӳؼ�Ⱥ��˳��ȡ��һ�����Ӷ��� |
| 343 | conn = peek_conn(slot); |
| 344 | if (conn == NULL) { |
| 345 | logger_error("peek_conn NULL"); |
| 346 | } else { |
| 347 | cmd.clear(true); |
| 348 | cmd.set_client_addr(*conn); |
| 349 | } |
| 350 | return conn; |
| 351 | } |
| 352 | |
| 353 | redis_client* redis_client_cluster::move(redis_command& cmd, |
| 354 | redis_client* conn, const char* ptr, int ntried) |
no test coverage detected