public class ReplicationConnectionGroup
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
addSlaveHost(java.lang.String hostPortPair)
Adds a host to the slaves hosts list.
|
long |
getActiveConnectionCount() |
long |
getConnectionCount() |
int |
getConnectionCountWithHostAsMaster(java.lang.String hostPortPair) |
int |
getConnectionCountWithHostAsSlave(java.lang.String hostPortPair) |
java.lang.String |
getGroupName() |
java.util.Collection<java.lang.String> |
getMasterHosts() |
long |
getNumberOfSlavePromotions() |
long |
getNumberOfSlavesAdded() |
long |
getNumberOfSlavesRemoved() |
java.util.Collection<java.lang.String> |
getSlaveHosts() |
long |
getTotalConnectionCount() |
void |
handleCloseConnection(ReplicationConnection conn) |
void |
promoteSlaveToMaster(java.lang.String hostPortPair)
Promotes a slave host to master.
|
long |
registerReplicationConnection(ReplicationConnection conn,
java.util.List<java.lang.String> localMasterList,
java.util.List<java.lang.String> localSlaveList) |
void |
removeMasterHost(java.lang.String hostPortPair)
Removes a host from the masters hosts list.
|
void |
removeMasterHost(java.lang.String hostPortPair,
boolean closeGently)
Removes a host from the masters hosts list.
|
void |
removeSlaveHost(java.lang.String hostPortPair,
boolean closeGently)
Removes a host from the slaves hosts list.
|
java.lang.String |
toString() |
public long getConnectionCount()
public long registerReplicationConnection(ReplicationConnection conn, java.util.List<java.lang.String> localMasterList, java.util.List<java.lang.String> localSlaveList)
public java.lang.String getGroupName()
public java.util.Collection<java.lang.String> getMasterHosts()
public java.util.Collection<java.lang.String> getSlaveHosts()
public void addSlaveHost(java.lang.String hostPortPair)
throws java.sql.SQLException
ReplicationConnection.addSlaveHost(String) could result in undesirable locking issues, assuming that this method is
synchronized by nature.
This is a no-op if the group already has this host in a slave role.hostPortPair - "host:port"java.sql.SQLException - if an error occurspublic void handleCloseConnection(ReplicationConnection conn)
public void removeSlaveHost(java.lang.String hostPortPair,
boolean closeGently)
throws java.sql.SQLException
ReplicationConnection.removeSlave(String, boolean) could result in undesirable locking issues, assuming that this method is
synchronized by nature.
This is a no-op if the group doesn't have this host in a slave role.hostPortPair - "host:port"closeGently - remove host when it's not in usejava.sql.SQLException - if an error occurspublic void promoteSlaveToMaster(java.lang.String hostPortPair)
throws java.sql.SQLException
ReplicationConnection.promoteSlaveToMaster(String) could result in undesirable locking issues, assuming that this method is
synchronized by nature.
This is a no-op if the group already has this host in a master role and not in slave role.hostPortPair - "host:port"java.sql.SQLException - if an error occurspublic void removeMasterHost(java.lang.String hostPortPair)
throws java.sql.SQLException
hostPortPair - host:portjava.sql.SQLException - if an error occurspublic void removeMasterHost(java.lang.String hostPortPair,
boolean closeGently)
throws java.sql.SQLException
ReplicationConnection.removeMasterHost(String, boolean) could result in undesirable locking issues, assuming that this
method is synchronized by nature.
This is a no-op if the group doesn't have this host in a master role.hostPortPair - "host:port"closeGently - remove host when it's not in usejava.sql.SQLException - if an error occurspublic int getConnectionCountWithHostAsSlave(java.lang.String hostPortPair)
public int getConnectionCountWithHostAsMaster(java.lang.String hostPortPair)
public long getNumberOfSlavesAdded()
public long getNumberOfSlavesRemoved()
public long getNumberOfSlavePromotions()
public long getTotalConnectionCount()
public long getActiveConnectionCount()
public java.lang.String toString()
toString in class java.lang.Object