mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Rename yield_leader with yield_leadship and its variants
This commit is contained in:
parent
361472b29e
commit
74b53218b8
@ -172,8 +172,8 @@ void FourLetterCommandFactory::registerCommands(KeeperDispatcher & keeper_dispat
|
||||
FourLetterCommandPtr feature_flags_command = std::make_shared<FeatureFlagsCommand>(keeper_dispatcher);
|
||||
factory.registerCommand(feature_flags_command);
|
||||
|
||||
FourLetterCommandPtr yield_leader_command = std::make_shared<YieldLeaderCommand>(keeper_dispatcher);
|
||||
factory.registerCommand(yield_leader_command);
|
||||
FourLetterCommandPtr yield_leadership_command = std::make_shared<YieldLeadershipCommand>(keeper_dispatcher);
|
||||
factory.registerCommand(yield_leadership_command);
|
||||
|
||||
factory.initializeAllowList(keeper_dispatcher);
|
||||
factory.setInitialize(true);
|
||||
@ -582,9 +582,9 @@ String FeatureFlagsCommand::run()
|
||||
return ret.str();
|
||||
}
|
||||
|
||||
String YieldLeaderCommand::run()
|
||||
String YieldLeadershipCommand::run()
|
||||
{
|
||||
return keeper_dispatcher.yieldLeader() ? "Sent yield leadership request to leader." : "Failed to send yield leadership request to leader.";
|
||||
return keeper_dispatcher.yieldLeadership() ? "Sent yield leadership request to leader." : "Failed to send yield leadership request to leader.";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -415,17 +415,17 @@ struct FeatureFlagsCommand : public IFourLetterCommand
|
||||
~FeatureFlagsCommand() override = default;
|
||||
};
|
||||
|
||||
/// Yield to be leader.
|
||||
struct YieldLeaderCommand : public IFourLetterCommand
|
||||
/// Yield leadership and become follower.
|
||||
struct YieldLeadershipCommand : public IFourLetterCommand
|
||||
{
|
||||
explicit YieldLeaderCommand(KeeperDispatcher & keeper_dispatcher_)
|
||||
explicit YieldLeadershipCommand(KeeperDispatcher & keeper_dispatcher_)
|
||||
: IFourLetterCommand(keeper_dispatcher_)
|
||||
{
|
||||
}
|
||||
|
||||
String name() override { return "ydld"; }
|
||||
String run() override;
|
||||
~YieldLeaderCommand() override = default;
|
||||
~YieldLeadershipCommand() override = default;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -237,10 +237,10 @@ public:
|
||||
return server->requestLeader();
|
||||
}
|
||||
|
||||
/// Yield to be leader.
|
||||
bool yieldLeader()
|
||||
/// Yield leadership and become follower.
|
||||
bool yieldLeadership()
|
||||
{
|
||||
return server->yieldLeader();
|
||||
return server->yieldLeadership();
|
||||
}
|
||||
|
||||
void recalculateStorageStats()
|
||||
|
@ -1087,7 +1087,7 @@ bool KeeperServer::requestLeader()
|
||||
return isLeader() || raft_instance->request_leadership();
|
||||
}
|
||||
|
||||
bool KeeperServer::yieldLeader()
|
||||
bool KeeperServer::yieldLeadership()
|
||||
{
|
||||
return isLeader() && raft_instance->yield_leadership();
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public:
|
||||
|
||||
bool requestLeader();
|
||||
|
||||
bool yieldLeader();
|
||||
bool yieldLeadership();
|
||||
|
||||
void recalculateStorageStats();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user