Java Code Examples for com.mysql.cj.jdbc.ha.LoadBalancedConnectionProxy#getTotalPhysicalConnectionCount()

The following examples show how to use com.mysql.cj.jdbc.ha.LoadBalancedConnectionProxy#getTotalPhysicalConnectionCount() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConnectionGroup.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public long getTotalPhysicalConnectionCount() {
    long allConnections = this.closedProxyTotalPhysicalConnections;
    Map<Long, LoadBalancedConnectionProxy> proxyMap = new HashMap<>();
    synchronized (this.connectionProxies) {
        proxyMap.putAll(this.connectionProxies);
    }
    for (LoadBalancedConnectionProxy proxy : proxyMap.values()) {
        allConnections += proxy.getTotalPhysicalConnectionCount();
    }
    return allConnections;
}
 
Example 2
Source File: ConnectionGroup.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void closeConnectionProxy(LoadBalancedConnectionProxy proxy) {
    this.activeConnections--;
    this.connectionProxies.remove(Long.valueOf(proxy.getConnectionGroupProxyID()));
    this.closedProxyTotalPhysicalConnections += proxy.getTotalPhysicalConnectionCount();
    this.closedProxyTotalTransactions += proxy.getTransactionCount();

}
 
Example 3
Source File: ConnectionGroup.java    From FoxTelem with GNU General Public License v3.0 5 votes vote down vote up
public long getTotalPhysicalConnectionCount() {
    long allConnections = this.closedProxyTotalPhysicalConnections;
    Map<Long, LoadBalancedConnectionProxy> proxyMap = new HashMap<>();
    synchronized (this.connectionProxies) {
        proxyMap.putAll(this.connectionProxies);
    }
    for (LoadBalancedConnectionProxy proxy : proxyMap.values()) {
        allConnections += proxy.getTotalPhysicalConnectionCount();
    }
    return allConnections;
}
 
Example 4
Source File: ConnectionGroup.java    From FoxTelem with GNU General Public License v3.0 5 votes vote down vote up
public void closeConnectionProxy(LoadBalancedConnectionProxy proxy) {
    this.activeConnections--;
    this.connectionProxies.remove(Long.valueOf(proxy.getConnectionGroupProxyID()));
    this.closedProxyTotalPhysicalConnections += proxy.getTotalPhysicalConnectionCount();
    this.closedProxyTotalTransactions += proxy.getTransactionCount();

}