public class Pool extends Object implements AutoCloseable, PoolMBean
| Constructor and Description |
|---|
Pool(Configuration conf,
int poolIndex,
ScheduledThreadPoolExecutor poolExecutor)
Create pool from configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close pool and underlying connections.
|
long |
getActiveConnections()
get pool active connection number
|
Configuration |
getConf() |
long |
getConnectionRequests()
get connection waiting request number
|
long |
getIdleConnections()
get idle connection number
|
InternalPoolConnection |
getPoolConnection()
Retrieve new connection.
|
InternalPoolConnection |
getPoolConnection(String username,
String password)
Get new connection from pool if user and password correspond to pool.
|
String |
getPoolTag() |
long |
getTotalConnections()
get pool total connection
|
List<Long> |
testGetConnectionIdleThreadIds()
For testing purpose only.
|
public Pool(Configuration conf, int poolIndex, ScheduledThreadPoolExecutor poolExecutor)
conf - configuration parserpoolIndex - pool index to permit distinction of thread namepoolExecutor - pools common executorpublic InternalPoolConnection getPoolConnection() throws SQLException
SQLException - if no connection is created when reaching timeout (connectTimeout option)public InternalPoolConnection getPoolConnection(String username, String password) throws SQLException
username - usernamepassword - passwordSQLException - if any error occur during connectionpublic Configuration getConf()
public void close()
close in interface AutoCloseablepublic String getPoolTag()
public long getActiveConnections()
PoolMBeangetActiveConnections in interface PoolMBeanpublic long getTotalConnections()
PoolMBeangetTotalConnections in interface PoolMBeanpublic long getIdleConnections()
PoolMBeangetIdleConnections in interface PoolMBeanpublic long getConnectionRequests()
PoolMBeangetConnectionRequests in interface PoolMBeanCopyright © 2025 SingleStore. All rights reserved.