SequoiaDB
|
Database operation interfaces of replica group. More...
#include <client.hpp>
Public Member Functions | |
sdbReplicaGroup () | |
Default constructor. | |
~sdbReplicaGroup () | |
Destructor. | |
INT32 | getNodeNum (sdbNodeStatus status, INT32 *num) |
Get the count of node with given status in current replica group. | |
INT32 | getDetail (bson::BSONObj &result) |
Get the detail of the replica group. | |
INT32 | getMaster (sdbNode &node) |
Get the master node of the current replica group. | |
INT32 | getSlave (sdbNode &node, const vector< INT32 > &positions=_sdbStaticVec) |
Get one of slave node of the current replica group, if no slave exists then get master. | |
INT32 | getNode (const CHAR *pNodeName, sdbNode &node) |
Get specified node from current replica group. | |
INT32 | getNode (const CHAR *pHostName, const CHAR *pServiceName, sdbNode &node) |
Get specified node from current replica group. | |
INT32 | removeNode (const CHAR *pHostName, const CHAR *pServiceName, const bson::BSONObj &configure=_sdbStaticObject) |
remove node in a given replica group. | |
INT32 | stop () |
Stop current replica group. | |
INT32 | start () |
Start up current replica group. | |
const CHAR * | getName () |
Get the name of current replica group. | |
BOOLEAN | isCatalog () |
Test whether current replica group is catalog replica group. | |
INT32 | attachNode (const CHAR *pHostName, const CHAR *pSvcName, const bson::BSONObj &options) |
Attach a node to the group. | |
INT32 | detachNode (const CHAR *pHostName, const CHAR *pSvcName, const bson::BSONObj &options) |
Detach a node from the group. | |
INT32 | reelect (const bson::BSONObj &options=_sdbStaticObject) |
Force the replica group to reelect primary node. | |
INT32 | reelectLocation (const CHAR *pLocation, const bson::BSONObj &options=_sdbStaticObject) |
Force the replica group to reelect location primary node. | |
INT32 | setActiveLocation (const CHAR *pActiveLocation) |
Alter replica group to set active location. | |
INT32 | setAttributes (const bson::BSONObj &options) |
Alter replica group. | |
INT32 | startCriticalMode (const bson::BSONObj &options) |
start critical mode in the current replica group. | |
INT32 | stopCriticalMode () |
Stop critical mode in current replica group. | |
INT32 | startMaintenanceMode (const bson::BSONObj &options) |
start maintenance mode in the current replica group. | |
INT32 | stopMaintenanceMode (const bson::BSONObj &options) |
Stop maintenance mode in current replica group. | |
Public Attributes | |
_sdbReplicaGroup * | pReplicaGroup |
A pointer of virtual base class _sdbReplicaGroup. | |
Database operation interfaces of replica group.
|
inline |
Attach a node to the group.
[in] | pHostName | The host name of node. |
[in] | pSvcName | The service name of node. |
[in] | options | The options of attach. The options are as below: KeepData : Whether to keep the original data of the new node. This option has no default value. User should specify its value explicitly. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Detach a node from the group.
[in] | pHostName | The host name of node. |
[in] | pSvcName | The service name of node. |
[in] | options | The options of detach. The options are as below: KeepData: Whether to keep the original data of the detached node. This option has no default value. User should specify its value explicitly. Enforced: Whether to detach the node forcibly, default to be false. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the detail of the replica group.
[out] | result | Return the all the info of current replica group. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the master node of the current replica group.
[out] | node | The master node.If not exit,return null. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the name of current replica group.
The | name of current replica group or null if fail |
|
inline |
Get specified node from current replica group.
[in] | pNodeName | The name of the node, with the format of "hostname:port". |
[out] | node | The specified node. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get specified node from current replica group.
[in] | pHostName | The host name of the node. |
[in] | pServiceName | The service name of the node. |
[out] | node | The specified node. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the count of node with given status in current replica group.
[in] | status | The specified status as below SDB_NODE_ALL SDB_NODE_ACTIVE SDB_NODE_INACTIVE SDB_NODE_UNKNOWN |
[out] | num | The count of node. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get one of slave node of the current replica group, if no slave exists then get master.
[in] | positions | The positions of nodes |
[out] | node | The slave node |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Test whether current replica group is catalog replica group.
TRUE | The replica group is catalog |
FALSE | The replica group is not catalog |
|
inline |
Force the replica group to reelect primary node.
[in] | options | The options of reelection. Please reference here for more detail. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Force the replica group to reelect location primary node.
[in] | pLocation | The location of reelection operation. |
[in] | options | The options of reelection operation. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
remove node in a given replica group.
[in] | pHostName | The hostname for the node |
[in] | pServiceName | The servicename for the node |
[in] | configure | The configurations for the node |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter replica group to set active location.
[in] | pActiveLocation | The active location of replica group to be changed. ActiveLocation : The active location of replica group, if the parameter is "", it means to remove the replica group's active location |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter replica group.
[in] | options | The options of replica group to be changed e.g. { "ActiveLocation": "A" }. |
ActiveLocation : The active location of replica group
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Start up current replica group.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
start critical mode in the current replica group.
[in] | options | The options of critical mode: NodeName: The critical node to be set in replica group Location: The critical location to be set in replica group Enforced: Whether to force to start critical mode in replica group MinKeepTime: The minimum keep time of critical mode MaxKeepTime: The maximum keep time of critical mode |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
start maintenance mode in the current replica group.
[in] | options | The options of maintenance mode: NodeName: The maintenance node to be added in replica group Location: The maintenance location to be added in replica group MinKeepTime: The minimum keep time of maintenance mode MaxKeepTime: The maximum keep time of maintenance mode |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Stop current replica group.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Stop critical mode in current replica group.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Stop maintenance mode in current replica group.
[in] | options | The options of maintenance mode: NodeName: The maintenance node to be stoped in replica group Location: The maintenance location to be stoped in replica group |
SDB_OK | Operation Success |
Others | Operation Fail |
sdbclient::sdbReplicaGroup::pReplicaGroup |
A pointer of virtual base class _sdbReplicaGroup.
Class sdbReplicaGroup is a shell for _sdbReplicaGroup. We use pCursor to call the methods in class _sdbReplicaGroup.