Public Member Functions | |
isCatalog () | |
getName () | |
start () | |
stop () | |
reelect (array|string $options=NULL) | |
getDetail () | |
getMaster () | |
getSlave () | |
getNode (string $name) | |
createNode (string $hostName, string $serviceName, string $databasePath, array|string $configure=NULL) | |
removeNode (string $hostName, string $serviceName, array|string $configure=NULL) | |
attachNode (string $hostName, string $serviceName, array|string $options) | |
detachNode (string $hostName, string $serviceName, array|string $options) | |
getNodeNum (integer $status) | |
SequoiaGroup Class. To get this Class object must be call SequoiaDB::getGroup.
SequoiaGroup::attachNode | ( | string | $hostName, |
string | $serviceName, | ||
array|string | $options | ||
) |
Attach a node to the group.
$hostName | the string argument. The hostname for the catalog replica group. |
$serviceName | the string argument. The servicename for the catalog replica group. |
$options | an array or the string argument. The options of attach. Can be the follow options: KeepData : Whether to keep the original data of the new node. This option has no default value.
User should specify its value explicitly.
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaGroup::createNode | ( | string | $hostName, |
string | $serviceName, | ||
string | $databasePath, | ||
array|string | $configure = NULL |
||
) |
Create node.
$hostName | the string argument. The hostname for the catalog replica group. |
$serviceName | the string argument. The servicename for the catalog replica group. |
$databasePath | the string argument. The path for the catalog replica group. |
$configure | the string argument. The configurations for the catalog replica group. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaGroup::detachNode | ( | string | $hostName, |
string | $serviceName, | ||
array|string | $options | ||
) |
Detach a node from the group.
$hostName | the string argument. The hostname for the catalog replica group. |
$serviceName | the string argument. The servicename for the catalog replica group. |
$options | an array or the string argument. The options of detach. Can be the follow options: 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.
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaGroup::getDetail | ( | ) |
Get the group detail.
array | detail |
string | detail |
Example:
SequoiaGroup::getMaster | ( | ) |
Get the master node.
SequoiaNode | Object |
Example:
SequoiaGroup::getName | ( | ) |
Get the specified replica group name.
string | <group_name> |
Example:
SequoiaGroup::getNode | ( | string | $name | ) |
Get the node.
$name | the string argument. The name of the node. |
SequoiaNode | Object |
Example:
SequoiaGroup::getNodeNum | ( | integer | $status | ) |
Get the status node number.
SequoiaGroup::getSlave | ( | ) |
Get the slave node.
SequoiaNode | Object |
Example:
SequoiaGroup::isCatalog | ( | ) |
Judge whether the specified replica group is catalog.
boolean | isCatalog |
Example:
SequoiaGroup::reelect | ( | array|string | $options = NULL | ) |
Re-elected in the replication group.
$options | an array or the string argument. Seconds: New elections needed within the number of seconds to complete, default 30 seconds.
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: 60 seconds for new elections.
SequoiaGroup::removeNode | ( | string | $hostName, |
string | $serviceName, | ||
array|string | $configure = NULL |
||
) |
Remove node in a given replica group.
$hostName | the string argument. The hostname for the catalog replica group. |
$serviceName | the string argument. The servicename for the catalog replica group. |
$configure | the string argument. The configurations for the catalog replica group. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaGroup::start | ( | ) |
Start and activate the specified replica group.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaGroup::stop | ( | ) |
Stop the specified replica group.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: