The sdb data source.
More...
#include <sdbDataSource.hpp>
Inherits SDBObject.
INT32 sdbclient::sdbDataSource::addCoord |
( |
const string & |
url | ) |
|
Add a coord node.
- Parameters
-
[in] | url | A coord node("ubuntu-xxx:11810") |
INT32 sdbclient::sdbDataSource::disable |
( |
| ) |
|
Disable sdbDataSource. After disable, the DataSource will disconnect all the connections and release the handle of the connections. So stop using the connection handle which has not been released to the DataSource.
- Return values
-
SDB_OK | Operation Success |
Others | Operation Fail |
INT32 sdbclient::sdbDataSource::enable |
( |
| ) |
|
Enable sdbDataSource.
- Return values
-
SDB_OK | Operation Success |
Others | Operation Fail |
INT32 sdbclient::sdbDataSource::getAbnormalCoordNum |
( |
| ) |
const |
Get the number of unreachable coord nodes or -1 for DataSource has not been initialized yet.
- Return values
-
The | number of unreachable coord nodes |
INT32 sdbclient::sdbDataSource::getConnection |
( |
sdb *& |
conn, |
|
|
INT64 |
timeoutsec = 5000 |
|
) |
| |
Get a connection form sdbDataSource.
- Parameters
-
[out] | conn | A connection |
[in] | timeoutms | The time to wait when connection number reach to max connection number,default:5000ms. when timeoutms is set to 0, means waiting until a connection is available. when timeoutms is less than 0, set it to be 0. |
- Return values
-
SDB_OK | Operation Success |
Others | Operation Fail |
INT32 sdbclient::sdbDataSource::getIdleConnNum |
( |
| ) |
const |
Get idle connection number or -1 for DataSource has not been initialized yet.
- Return values
-
The | number of idle connection |
INT32 sdbclient::sdbDataSource::getLocalCoordNum |
( |
| ) |
const |
Get the number of local coord nodes or -1 for DataSource has not been initialized yet.
- Return values
-
The | number of local coord nodes |
INT32 sdbclient::sdbDataSource::getNormalCoordNum |
( |
| ) |
const |
Get the number of reachable coord nodes or -1 for DataSource has not been initialized yet.
- Return values
-
The | number of reachable coord nodes |
INT32 sdbclient::sdbDataSource::getUsedConnNum |
( |
| ) |
const |
Get used connection number or -1 for DataSource has not been initialized yet.
- Return values
-
The | number of used connection |
INT32 sdbclient::sdbDataSource::init |
( |
const std::string & |
url, |
|
|
const sdbDataSourceConf & |
conf |
|
) |
| |
Initialize sdbDataSource.
- Parameters
-
- Return values
-
SDB_OK | Operation Success |
Others | Operation Fail |
INT32 sdbclient::sdbDataSource::init |
( |
const std::vector< std::string > & |
vUrls, |
|
|
const sdbDataSourceConf & |
conf |
|
) |
| |
Initialize sdbDataSource.
- Parameters
-
- Return values
-
SDB_OK | Operation Success |
Others | Operation Fail |
INT32 sdbclient::sdbDataSource::releaseConnection |
( |
sdb * |
conn | ) |
|
Give back a connection to sdbDataSource.
- Parameters
-
- Return values
-
SDB_OK | Operation Success |
Others | Operation Fail |
INT32 sdbclient::sdbDataSource::removeCoord |
( |
const string & |
url | ) |
|
Remove a coord node.
- Parameters
-
[in] | url | A coord node("ubuntu-xxx:11810") |
The documentation for this class was generated from the following file: