Describer.DefaultPrinter, Describer.Printer| 限定符和类型 | 方法和说明 |
|---|---|
void |
describe(Describer.Printer out) |
Configuration |
getConfiguration(String groupId)
Get the configuration by groupId, returns null when not found.
|
static RouteTable |
getInstance() |
Status |
refreshConfiguration(CliClientService cliClientService,
String groupId,
int timeoutMs) |
Status |
refreshLeader(CliClientService cliClientService,
String groupId,
int timeoutMs)
Blocking the thread until query_leader finishes.
|
boolean |
removeGroup(String groupId)
Remove the group from route table.
|
void |
reset()
Reset the states.
|
PeerId |
selectLeader(String groupId)
Get the cached leader of the group, return it when found, null otherwise.
|
String |
toString() |
boolean |
updateConfiguration(String groupId,
Configuration conf)
Update configuration of group in route table.
|
boolean |
updateConfiguration(String groupId,
String confStr)
Update configuration of group in route table.
|
boolean |
updateLeader(String groupId,
PeerId leader)
Update leader info.
|
boolean |
updateLeader(String groupId,
String leaderStr)
Update leader info.
|
public static RouteTable getInstance()
public boolean updateConfiguration(String groupId, Configuration conf)
groupId - raft group idconf - configuration to updatepublic boolean updateConfiguration(String groupId, String confStr)
groupId - raft group idconfStr - configuration stringpublic PeerId selectLeader(String groupId)
refreshLeader(CliClientService, String, int) already
before invoke this method.groupId - raft group idpublic boolean updateLeader(String groupId, PeerId leader)
groupId - raft group idleader - peer of leaderpublic boolean updateLeader(String groupId, String leaderStr)
groupId - raft group idleaderStr - peer string of leaderpublic Configuration getConfiguration(String groupId)
groupId - raft group idpublic Status refreshLeader(CliClientService cliClientService, String groupId, int timeoutMs) throws InterruptedException, TimeoutException
groupId - raft group idtimeoutMs - timeout millisInterruptedExceptionTimeoutExceptionpublic Status refreshConfiguration(CliClientService cliClientService, String groupId, int timeoutMs) throws InterruptedException, TimeoutException
public void reset()
public boolean removeGroup(String groupId)
groupId - raft group idpublic void describe(Describer.Printer out)
Copyright © 2021. All rights reserved.