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();
}
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();
}
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();
}
Aggregations