MCPcopy Create free account
hub / github.com/acl-dev/acl / cluster_down

Method cluster_down

lib_acl_cpp/src/redis/redis_client_pipeline.cpp:655–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653}
654
655void redis_client_pipeline::cluster_down(const redis_pipeline_message &msg)
656{
657 const std::string& addr = msg.get_addr();
658
659 // Clear all slots' addrs same as the dead node
660 for (size_t i = 0; i < max_slot_; i++) {
661 if (slot_addrs_[i] && addr == slot_addrs_[i]) {
662 slot_addrs_[i] = NULL;
663 }
664 }
665
666 // Reset the default addr which different from the dead node
667 if (addr_ == addr) {
668 for (std::vector<char*>::const_iterator it = addrs_.begin();
669 it != addrs_.end(); ++it) {
670 if (addr != *it) {
671 addr_ = *it;
672 break;
673 }
674 }
675
676 // Stop and remove the dead node
677 logger("Stop one channel thread, addr=%s", addr.c_str());
678 stop_channel(addr.c_str());
679 }
680}
681
682void redis_client_pipeline::channel_closed(redis_pipeline_channel* channel)
683{

Callers

nothing calls this directly

Calls 4

beginMethod · 0.80
get_addrMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected