Search in sources :

Example 1 with NativeMycatServer

use of io.mycat.NativeMycatServer in project Mycat2 by MyCATApache.

the class NativeDatasourcePoolImpl method getAvailableNumber.

@Override
public Integer getAvailableNumber() {
    NativeMycatServer nativeMycatServer = MetaClusterCurrent.wrapper(NativeMycatServer.class);
    MySQLDatasourcePool sqlDatasourcePool = nativeMycatServer.getDatasource(targetName);
    return sqlDatasourcePool.getSessionLimitCount() - sqlDatasourcePool.currentSessionCount();
}
Also used : MySQLDatasourcePool(io.mycat.proxy.MySQLDatasourcePool) NativeMycatServer(io.mycat.NativeMycatServer)

Example 2 with NativeMycatServer

use of io.mycat.NativeMycatServer in project Mycat2 by MyCATApache.

the class NativeDatasourcePoolImpl method close.

@Override
public void close() {
    NativeMycatServer nativeMycatServer = MetaClusterCurrent.wrapper(NativeMycatServer.class);
    MySQLDatasourcePool sqlDatasourcePool = nativeMycatServer.getDatasource(targetName);
    sqlDatasourcePool.close();
}
Also used : MySQLDatasourcePool(io.mycat.proxy.MySQLDatasourcePool) NativeMycatServer(io.mycat.NativeMycatServer)

Example 3 with NativeMycatServer

use of io.mycat.NativeMycatServer in project Mycat2 by MyCATApache.

the class NativeDatasourcePoolImpl method getUsedNumber.

@Override
public Integer getUsedNumber() {
    NativeMycatServer nativeMycatServer = MetaClusterCurrent.wrapper(NativeMycatServer.class);
    MySQLDatasourcePool sqlDatasourcePool = nativeMycatServer.getDatasource(targetName);
    return sqlDatasourcePool.currentSessionCount();
}
Also used : MySQLDatasourcePool(io.mycat.proxy.MySQLDatasourcePool) NativeMycatServer(io.mycat.NativeMycatServer)

Aggregations

NativeMycatServer (io.mycat.NativeMycatServer)3 MySQLDatasourcePool (io.mycat.proxy.MySQLDatasourcePool)3