构造器和说明 |
---|
DatasourceOptions() |
限定符和类型 | 方法和说明 |
---|---|
Object |
clone()
Clone the current options.
|
int |
getCheckInterval()
Get the interval for checking the idle connections periodically.
|
ConnectStrategy |
getConnectStrategy()
Get the current strategy of creating connections.
|
int |
getDeltaIncCount()
Get the number of connections to create once running out the
connection pool.
|
int |
getKeepAliveTimeout()
Get the setup time for abandoning a connection
which has not been used for long time.
|
int |
getMaxCount()
Get the capacity of the pool.
|
int |
getMaxIdleCount()
Get the max number of idle connection.
|
List<String> |
getPreferedInstance()
Get the preferred instance.
|
String |
getPreferedInstanceMode()
Get the preferred instance node.
|
int |
getSessionTimeout()
The Session timeout value.
|
int |
getSyncCoordInterval()
Get the interval for updating coord's addresses from catalog periodically.
|
boolean |
getValidateConnection()
Get whether to validate a connection which is got from the pool or not.
|
void |
setCheckInterval(int checkInterval)
Set the checking interval in milliseconds.
|
void |
setConnectStrategy(ConnectStrategy strategy)
Set connection strategy.
|
void |
setDeltaIncCount(int deltaIncCount)
Set the number of new connections to create once running out the
connection pool.
|
void |
setKeepAliveTimeout(int keepAliveTimeout)
Set the time in milliseconds for abandoning a connection which keep alive time is up.
|
void |
setMaxCount(int maxCount)
Set the capacity of the connection pool.
|
void |
setMaxIdleCount(int maxIdleCount)
Set the max number of the idle connection left in connection
pool after periodically cleaning.
|
void |
setPreferedInstance(List<String> preferedInstance)
Set Preferred instance for read request in the session..
|
void |
setPreferedInstanceMode(String mode)
Set the mode to choose query instance when multiple preferred instances are found in the session.
|
void |
setSessionTimeout(int timeout)
Set the timeout (in ms) for operations in the session. -1 means no timeout for operations.
|
void |
setSyncCoordInterval(int syncCoordInterval)
Set the interval for updating coord's addresses from catalog in milliseconds.
|
void |
setValidateConnection(boolean validateConnection)
When a idle connection is got out of pool, we need
to validate whether it can be used or not.
|
public Object clone() throws CloneNotSupportedException
clone
在类中 Object
CloneNotSupportedException
public int getCheckInterval()
public ConnectStrategy getConnectStrategy()
public int getDeltaIncCount()
public int getKeepAliveTimeout()
public int getMaxCount()
public int getMaxIdleCount()
public List<String> getPreferedInstance()
public String getPreferedInstanceMode()
public int getSessionTimeout()
public int getSyncCoordInterval()
public boolean getValidateConnection()
public void setCheckInterval(int checkInterval)
checkInterval
- Default to be 1 * 60 * 1000ms.public void setConnectStrategy(ConnectStrategy strategy)
strategy
- Should one of the follow:
ConnectStrategy.SERIAL,
ConnectStrategy.RANDOM,
ConnectStrategy.LOCAL,
ConnectStrategy.BALANCEpublic void setDeltaIncCount(int deltaIncCount)
deltaIncCount
- Default to be 10.public void setKeepAliveTimeout(int keepAliveTimeout)
keepAliveTimeout
- Default to be 0ms, means not care about how long does a connection
have not be used(send and receive).public void setMaxCount(int maxCount)
maxCount
- Default to be 500.public void setMaxIdleCount(int maxIdleCount)
maxIdleCount
- Default to be 10.public void setPreferedInstance(List<String> preferedInstance)
preferedInstance
- Could be single value in "M", "m", "S", "s", "A", "a", "1"-"255", or multiple values of them.
public void setPreferedInstanceMode(String mode)
mode
- can be one of the follow, default to be "random".
public void setSessionTimeout(int timeout)
timeout
- The timeout (in ms) for operations in the session.public void setSyncCoordInterval(int syncCoordInterval)
syncCoordInterval
- Default to be 1 * 60 * 1000ms.public void setValidateConnection(boolean validateConnection)
validateConnection
- Default to be false.Copyright © 2018. All rights reserved.