@NotThreadSafe public final class UfsJournalMultiMasterPrimarySelector extends AbstractPrimarySelector implements org.apache.curator.framework.recipes.leader.LeaderSelectorListener
PrimarySelector.Factory
Constructor and Description |
---|
UfsJournalMultiMasterPrimarySelector(String zookeeperAddress,
String electionPath,
String leaderPath)
Constructs a new
UfsJournalMultiMasterPrimarySelector . |
Modifier and Type | Method and Description |
---|---|
String |
getName() |
void |
start(InetSocketAddress address)
Starts the leader selection.
|
void |
stateChanged(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.state.ConnectionState newState) |
void |
stop()
Stops the primary selector.
|
void |
takeLeadership(org.apache.curator.framework.CuratorFramework client) |
getState, getStateUnsafe, onStateChange, setState, waitForState
public UfsJournalMultiMasterPrimarySelector(String zookeeperAddress, String electionPath, String leaderPath)
UfsJournalMultiMasterPrimarySelector
.zookeeperAddress
- the address to ZookeeperelectionPath
- the election pathleaderPath
- the path of the leaderpublic void stop()
PrimarySelector
stop
in interface PrimarySelector
public String getName()
public void start(InetSocketAddress address)
start
in interface PrimarySelector
address
- the address of the local masterpublic void stateChanged(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.state.ConnectionState newState)
stateChanged
in interface org.apache.curator.framework.state.ConnectionStateListener
Copyright © 2023. All Rights Reserved.