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() |
Configuration |
getConf() |
long |
getConnectionRequests() |
long |
getIdleConnections() |
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() |
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()
getActiveConnections in interface PoolMBeanpublic long getTotalConnections()
getTotalConnections in interface PoolMBeanpublic long getIdleConnections()
getIdleConnections in interface PoolMBeanpublic long getConnectionRequests()
getConnectionRequests in interface PoolMBeanCopyright © 2023 SingleStore. All rights reserved.