public class Pool extends Object implements AutoCloseable, PoolMBean
| 构造器和说明 |
|---|
Pool(UrlParser urlParser,
int poolIndex,
ScheduledThreadPoolExecutor poolExecutor)
Create pool from configuration.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close pool and underlying connections.
|
boolean |
equals(Object obj) |
long |
getActiveConnections() |
OceanBaseConnection |
getConnection()
Retrieve new connection.
|
OceanBaseConnection |
getConnection(String username,
String password)
Get new connection from pool if user and password correspond to pool.
|
long |
getConnectionRequests() |
GlobalStateInfo |
getGlobalInfo() |
long |
getIdleConnections() |
OceanBasePooledConnection |
getPooledConnection() |
String |
getPoolTag() |
long |
getTotalConnections() |
UrlParser |
getUrlParser() |
int |
hashCode() |
void |
resetStaticGlobal()
JMX method to remove state (will be reinitialized on next connection creation).
|
List<Long> |
testGetConnectionIdleThreadIds()
For testing purpose only.
|
public Pool(UrlParser urlParser, int poolIndex, ScheduledThreadPoolExecutor poolExecutor)
urlParser - configuration parserpoolIndex - pool index to permit distinction of thread namepoolExecutor - pools common executorpublic OceanBasePooledConnection getPooledConnection() throws SQLException
SQLExceptionpublic OceanBaseConnection getConnection() throws SQLException
SQLException - if no connection is created when reaching timeout (connectTimeout option)public OceanBaseConnection getConnection(String username, String password) throws SQLException
username - usernamepassword - passwordSQLException - if any error occur during connectionpublic UrlParser getUrlParser()
public void close()
throws InterruptedException
close 在接口中 AutoCloseableInterruptedException - if interruptedpublic String getPoolTag()
public GlobalStateInfo getGlobalInfo()
public long getActiveConnections()
getActiveConnections 在接口中 PoolMBeanpublic long getTotalConnections()
getTotalConnections 在接口中 PoolMBeanpublic long getIdleConnections()
getIdleConnections 在接口中 PoolMBeanpublic long getConnectionRequests()
getConnectionRequests 在接口中 PoolMBeanpublic List<Long> testGetConnectionIdleThreadIds()
public void resetStaticGlobal()
resetStaticGlobal 在接口中 PoolMBeanCopyright © 2024 oceanbase.com. All rights reserved.