Package com.mysql.cj.jdbc
Class ConnectionGroup
java.lang.Object
com.mysql.cj.jdbc.ConnectionGroup
public class ConnectionGroup
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description void
addHost(java.lang.String hostPortPair)
Add the given host (host:port pair) to this Connection Group.void
addHost(java.lang.String hostPortPair, boolean forExisting)
Add the given host (host:port pair) to this Connection Group and, consequently, to all the load-balanced connections it holds.void
closeConnectionProxy(LoadBalancedConnectionProxy proxy)
int
getActiveHostCount()
long
getActiveLogicalConnectionCount()
long
getActivePhysicalConnectionCount()
java.util.Collection<java.lang.String>
getClosedHosts()
java.lang.String
getGroupName()
java.util.Collection<java.lang.String>
getInitialHosts()
long
getTotalLogicalConnectionCount()
long
getTotalPhysicalConnectionCount()
long
getTotalTransactionCount()
long
registerConnectionProxy(LoadBalancedConnectionProxy proxy, java.util.List<java.lang.String> localHostList)
void
removeHost(java.lang.String hostPortPair)
Remove the given host (host:port pair) from this Connection Group.void
removeHost(java.lang.String hostPortPair, boolean removeExisting)
Remove the given host (host:port pair) from this Connection Group.void
removeHost(java.lang.String hostPortPair, boolean removeExisting, boolean waitForGracefulFailover)
Remove the given host (host:port pair) from this Connection Group and, consequently, from all the load-balanced connections it holds.
-
Method Details
-
registerConnectionProxy
public long registerConnectionProxy(LoadBalancedConnectionProxy proxy, java.util.List<java.lang.String> localHostList) -
getGroupName
public java.lang.String getGroupName() -
getInitialHosts
public java.util.Collection<java.lang.String> getInitialHosts() -
getActiveHostCount
public int getActiveHostCount() -
getClosedHosts
public java.util.Collection<java.lang.String> getClosedHosts() -
getTotalLogicalConnectionCount
public long getTotalLogicalConnectionCount() -
getActiveLogicalConnectionCount
public long getActiveLogicalConnectionCount() -
getActivePhysicalConnectionCount
public long getActivePhysicalConnectionCount() -
getTotalPhysicalConnectionCount
public long getTotalPhysicalConnectionCount() -
getTotalTransactionCount
public long getTotalTransactionCount() -
closeConnectionProxy
-
removeHost
public void removeHost(java.lang.String hostPortPair) throws java.sql.SQLExceptionRemove the given host (host:port pair) from this Connection Group.- Parameters:
hostPortPair
- The host:port pair to remove.- Throws:
java.sql.SQLException
- if a database access error occurs
-
removeHost
public void removeHost(java.lang.String hostPortPair, boolean removeExisting) throws java.sql.SQLExceptionRemove the given host (host:port pair) from this Connection Group.- Parameters:
hostPortPair
- The host:port pair to remove.removeExisting
- Whether affects existing load-balanced connections or only new ones.- Throws:
java.sql.SQLException
- if a database access error occurs
-
removeHost
public void removeHost(java.lang.String hostPortPair, boolean removeExisting, boolean waitForGracefulFailover) throws java.sql.SQLExceptionRemove the given host (host:port pair) from this Connection Group and, consequently, from all the load-balanced connections it holds.- Parameters:
hostPortPair
- The host:port pair to remove.removeExisting
- Whether affects existing load-balanced connections or only new ones.waitForGracefulFailover
- If true instructs the load-balanced connections to fail-over the underlying active connection before removing this host, otherwise remove immediately.- Throws:
java.sql.SQLException
- if a database access error occurs
-
addHost
public void addHost(java.lang.String hostPortPair)Add the given host (host:port pair) to this Connection Group.- Parameters:
hostPortPair
- The host:port pair to add.
-
addHost
public void addHost(java.lang.String hostPortPair, boolean forExisting)Add the given host (host:port pair) to this Connection Group and, consequently, to all the load-balanced connections it holds.- Parameters:
hostPortPair
- The host:port pair to add.forExisting
- Whether affects existing load-balanced connections or only new ones.
-