public class SequoiadbDatasource extends Object
| 构造器和说明 |
|---|
SequoiadbDatasource(List<String> urls,
String username,
String password,
ConfigOptions nwOpt,
SequoiadbOption dsOpt) |
SequoiadbDatasource(String url,
String username,
String password,
SequoiadbOption dsOpt) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addCoord(String url) |
void |
close() |
void |
close(Sequoiadb sdb) |
protected void |
finalize() |
int |
getAbnormalAddrNum() |
Sequoiadb |
getConnection() |
int |
getIdleConnNum() |
int |
getNormalAddrNum() |
int |
getUsedConnNum() |
public SequoiadbDatasource(List<String> urls, String username, String password, ConfigOptions nwOpt, SequoiadbOption dsOpt) throws BaseException
urls - the addresses of coords, can't be null or empty,
e.g."ubuntu1:11810","ubuntu2:11810",...username - the username for logging sequoiadbpassword - the password for logging sequoiadbnwOpt - the options for connectiondsOpt - the options for datasourceBaseExceptionConfigOptions,
SequoiadbOptionpublic SequoiadbDatasource(String url, String username, String password, SequoiadbOption dsOpt) throws BaseException
url - the address of coord, can't be null, e.g."ubuntu1:11810"username - the username of sequoiadbpassword - the password of sequoiadbdsOpt - the option of datasourceBaseExceptionpublic int getIdleConnNum()
public int getUsedConnNum()
public int getNormalAddrNum()
public int getAbnormalAddrNum()
public void addCoord(String url)
public Sequoiadb getConnection() throws BaseException, InterruptedException
com.sequoiadb.Exception.BaseException - when datasource run out, throws BaseException with the type of "SDB_DRIVER_DS_RUNOUT"InterruptedExceptionBaseExceptionpublic void close(Sequoiadb sdb) throws BaseException
sdb - the connection get from current datasource, can't be nullcom.sequoiadb.Exception.BaseException - if param sdb is null, throws BaseException with the type "SDB_INVALIDARG"BaseExceptionpublic void close()
Copyright © 2015. All Rights Reserved.