类 ConnectionGroup
- java.lang.Object
-
- com.mysql.cj.jdbc.ConnectionGroup
-
public class ConnectionGroup extends Object
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddHost(String hostPortPair)Add the given host (host:port pair) to this Connection Group.voidaddHost(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.voidcloseConnectionProxy(LoadBalancedConnectionProxy proxy)intgetActiveHostCount()longgetActiveLogicalConnectionCount()longgetActivePhysicalConnectionCount()Collection<String>getClosedHosts()StringgetGroupName()Collection<String>getInitialHosts()longgetTotalLogicalConnectionCount()longgetTotalPhysicalConnectionCount()longgetTotalTransactionCount()longregisterConnectionProxy(LoadBalancedConnectionProxy proxy, List<String> localHostList)voidremoveHost(String hostPortPair)Remove the given host (host:port pair) from this Connection Group.voidremoveHost(String hostPortPair, boolean removeExisting)Remove the given host (host:port pair) from this Connection Group.voidremoveHost(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.
-
-
-
方法详细资料
-
registerConnectionProxy
public long registerConnectionProxy(LoadBalancedConnectionProxy proxy, List<String> localHostList)
-
getGroupName
public String getGroupName()
-
getInitialHosts
public Collection<String> getInitialHosts()
-
getActiveHostCount
public int getActiveHostCount()
-
getClosedHosts
public Collection<String> getClosedHosts()
-
getTotalLogicalConnectionCount
public long getTotalLogicalConnectionCount()
-
getActiveLogicalConnectionCount
public long getActiveLogicalConnectionCount()
-
getActivePhysicalConnectionCount
public long getActivePhysicalConnectionCount()
-
getTotalPhysicalConnectionCount
public long getTotalPhysicalConnectionCount()
-
getTotalTransactionCount
public long getTotalTransactionCount()
-
closeConnectionProxy
public void closeConnectionProxy(LoadBalancedConnectionProxy proxy)
-
removeHost
public void removeHost(String hostPortPair) throws SQLException
Remove the given host (host:port pair) from this Connection Group.- 参数:
hostPortPair- The host:port pair to remove.- 抛出:
SQLException- if a database access error occurs
-
removeHost
public void removeHost(String hostPortPair, boolean removeExisting) throws SQLException
Remove the given host (host:port pair) from this Connection Group.- 参数:
hostPortPair- The host:port pair to remove.removeExisting- Whether affects existing load-balanced connections or only new ones.- 抛出:
SQLException- if a database access error occurs
-
removeHost
public void removeHost(String hostPortPair, boolean removeExisting, boolean waitForGracefulFailover) throws SQLException
Remove the given host (host:port pair) from this Connection Group and, consequently, from all the load-balanced connections it holds.- 参数:
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.- 抛出:
SQLException- if a database access error occurs
-
addHost
public void addHost(String hostPortPair)
Add the given host (host:port pair) to this Connection Group.- 参数:
hostPortPair- The host:port pair to add.
-
addHost
public void addHost(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.- 参数:
hostPortPair- The host:port pair to add.forExisting- Whether affects existing load-balanced connections or only new ones.
-
-