remove WFServiceGovernance::server_list_change

This commit is contained in:
XieHan
2022-06-04 01:10:51 +08:00
parent d665eb6a6a
commit b866bcbf9a
3 changed files with 0 additions and 19 deletions

View File

@@ -330,7 +330,6 @@ void UPSGroupPolicy::add_server_locked(EndpointAddress *addr)
else
group->backups.push_back(addr);
pthread_mutex_unlock(&group->mutex);
this->server_list_change(addr, ADD_SERVER);
}
int UPSGroupPolicy::remove_server_locked(const std::string& address)
@@ -375,7 +374,6 @@ int UPSGroupPolicy::remove_server_locked(const std::string& address)
}
}
this->server_list_change(addr, REMOVE_SERVER);
if (--addr->ref == 0)
{
this->pre_delete_server(addr);

View File

@@ -210,7 +210,6 @@ void WFServiceGovernance::recover_server_from_breaker(EndpointAddress *addr)
list_del(&addr->entry.list);
addr->entry.list.next = NULL;
this->recover_one_server(addr);
this->server_list_change(addr, RECOVER_SERVER);
}
pthread_mutex_unlock(&this->breaker_lock);
}
@@ -223,7 +222,6 @@ void WFServiceGovernance::fuse_server_to_breaker(EndpointAddress *addr)
addr->broken_timeout = GET_CURRENT_SECOND + this->mttr_second;
list_add_tail(&addr->entry.list, &this->breaker_list);
this->fuse_one_server(addr);
this->server_list_change(addr, FUSE_SERVER);
}
pthread_mutex_unlock(&this->breaker_lock);
}
@@ -287,7 +285,6 @@ void WFServiceGovernance::check_breaker_locked(int64_t cur_time)
{
addr->fail_count = addr->params->max_fails - 1;
this->recover_one_server(addr);
this->server_list_change(addr, RECOVER_SERVER);
list_del(pos);
pos->next = NULL;
}
@@ -375,7 +372,6 @@ void WFServiceGovernance::add_server_locked(EndpointAddress *addr)
this->server_map[addr->address].push_back(addr);
this->servers.push_back(addr);
this->recover_one_server(addr);
this->server_list_change(addr, ADD_SERVER);
}
int WFServiceGovernance::remove_server_locked(const std::string& address)
@@ -397,7 +393,6 @@ int WFServiceGovernance::remove_server_locked(const std::string& address)
{
for (EndpointAddress *addr : map_it->second)
{
this->server_list_change(addr, REMOVE_SERVER);
if (--addr->ref == 0)
{
this->pre_delete_server(addr);

View File

@@ -61,14 +61,6 @@ static constexpr struct AddressParams ADDRESS_PARAMS_DEFAULT =
.group_id = -1,
};
enum ServerChangeState
{
ADD_SERVER = 0,
REMOVE_SERVER = 1,
RECOVER_SERVER = 2,
FUSE_SERVER = 3,
};
class PolicyAddrParams
{
public:
@@ -124,10 +116,6 @@ public:
void enable_server(const std::string& address);
void disable_server(const std::string& address);
virtual void get_current_address(std::vector<std::string>& addr_list);
virtual void server_list_change(const EndpointAddress *address,
enum ServerChangeState state)
{
}
void set_mttr_second(unsigned int second) { this->mttr_second = second; }
static bool in_select_history(WFNSTracing *tracing, EndpointAddress *addr);