Public Member Functions | |
__construct (array|string $address, string $userName="", string $password="", boolean $useSSL=false) | |
install (array|string $options=null) | |
getLastErrorMsg () | |
cleanLastErrorMsg () | |
connect (array|string $address="127.0.0.1:11810", string $userName="", string $password="", boolean $useSSL=false) | |
close () | |
isValid () | |
syncDB (array|string $options=null) | |
invalidateCache (array|string $condition=array( 'Global'=> true)) | |
interrupt () | |
interruptOperation () | |
snapshot (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null, integer $numToSkip=0, integer $numToReturn=-1) | |
resetSnapshot (array|string $options=null) | |
list (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null, integer $numToSkip=0, integer $numToReturn=-1) | |
listCS (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
selectCS (string $name, array|string $options=null) | |
selectCS (string $name, integer $pageSize=null) | |
createCS (string $name, array|string $options=null) | |
getCS (string $name) | |
dropCS (string $name) | |
renameCS (string $oldName, string $newName, array|string $options=null) | |
listCL (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
getCL (string $fullName) | |
truncate (string $fullName) | |
listDomain (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
createDomain (string $name, array|string $options=null) | |
getDomain (string $name) | |
dropDomain (string $name) | |
listGroup (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
getGroup (string $name) | |
createGroup (string $name) | |
removeGroup (string $name) | |
createCataGroup (string $hostName, string $serviceName, string $databasePath, array|string $configure=null) | |
execSQL (string $sql) | |
execUpdateSQL (string $sql) | |
createUser (string $userName, string $passwd) | |
removeUser (string $userName, string $passwd) | |
flushConfigure (array|string $options) | |
updateConfig (array|string $configs, array|string $options) | |
deleteConfig (array|string $configs, array|string $options) | |
listProcedure (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
createJsProcedure (string $code) | |
removeProcedure (string $name) | |
evalJs (string $code) | |
transactionBegin () | |
transactionCommit () | |
transactionRollback () | |
backup (array|string $options) | |
listBackup (array|string $options, array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
removeBackup (array|string $options) | |
listTask (array|string $condition=null, array|string $selector=null, array|string $orderBy=null, array|string $hint=null) | |
waitTask (array|integer|SequoiaInt64 $taskID) | |
cancelTask (integer|SequoiaInt64 $taskID, boolean $isAsync=true) | |
setSessionAttr (array|string $options) | |
getSessionAttr (boolean $useCache=TRUE) | |
forceSession (integer|SequoiaINT64 $sessionID, array|string $options=null) | |
analyze (array|string $options=null) | |
getList (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null) | |
getSnapshot (integer $type, array|string $condition=null, array|string $selector=null, array|string $orderBy=null) | |
selectCS (string $name, integer $pageSize=4096) | |
listCSs () | |
dropCollectionSpace (string $name) | |
listCollections () | |
listDomains () | |
selectGroup (string $name) | |
backupOffline (array|string $options) | |
Class for create an object of the db
SequoiaDB::__construct | ( | array|string | $address, |
string | $userName = "" , |
||
string | $password = "" , |
||
boolean | $useSSL = false |
||
) |
SequoiaDB class constructor.
$address | an array or the string argument. The Host Name or IP Address and The Service Name or Port of Database Server. |
$userName | the string argument. The User's Name of the account. |
$password | the string argument. The Password of the account. |
$useSSL | a boolean argument. Connect to database with ssl. |
Example: 1. Using the connect function to connect to the database.
Example: 2. Connect to the database.
Example: 3. Connect to the database, using the default service name. The default service name is 11810.
Example: 4. Connect to the running database one.
Example: 5. Connect to the authentication database.
Example: 6. Connect to the running authentication database one.
Example: 7. Connect to the database with ssl.
Example: 8. Using the connect function to connect to the database with ssl.
Example: 9. Connect to the database with ssl.
SequoiaDB::analyze | ( | array|string | $options = null | ) |
Analyze collection or index to collect statistics information
$options | an array or the string argument. The control options: CollectionSpace : (String) Specify the collection space to be analyzed.
Collection : (String) Specify the collection to be analyzed.
Index : (String) Specify the index to be analyzed.
Mode : (Int32) Specify the analyze mode (default is 1):
Mode 1 will analyze with data samples.
Mode 2 will analyze with full data.
Mode 3 will generate default statistics.
Mode 4 will reload statistics into memory cache.
Mode 5 will clear statistics from memory cache.
Location Elements : (Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String ...
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::backup | ( | array|string | $options | ) |
Backup the whole database or specifed replica group.
$options | an array or the string argument. Contains a series of backup configuration infomations. Backup the whole cluster if null. The "options" contains 5 options as below. All the elements in options are optional. e.g. array( 'GroupName' => array( 'RGName1', 'RGName2' ), 'Path' => '/opt/sequoiadb/backup', 'Name' => 'backupName', 'Description' => 'It is my backup', 'EnsureInc' => true, 'OverWrite' => true )
GroupID : The id(s) of replica group(s) which to be backuped
GroupName : The replica groups which to be backuped
the path support to use wildcard(%g/%G:group name, %h/%H:host name, %s/%S:service name).
e.g.
array( 'Path' => '/opt/sequoiadb/backup/%g' )
isSubDir : Whether the path specified by paramer "Path" is a subdirectory of the path specified in the configuration file, default to be false
Name : The name for the backup
Prefix : The prefix of name for the backup, default to be null.
e.g.
array( 'Prefix' => '%g_bk_' )
EnableDateDir : Whether turn on the feature which will create subdirectory named to current date like "YYYY-MM-DD" automatically, default to be false
Description : The description for the backup
EnsureInc : Whether excute increment synchronization, default to be false
OverWrite : Whether overwrite the old backup file, default to be false
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::backupOffline | ( | array|string | $options | ) |
Backup the whole database or specifed replica group.
SequoiaDB::cancelTask | ( | integer|SequoiaInt64 | $taskID, |
boolean | $isAsync = true |
||
) |
Cancel the specified task.
$taskID | an integer argument. The task id. |
$isAsync | a boolean argument. The operation "cancel task" is async or not, "true" for async, "false" for sync. Default sync. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::cleanLastErrorMsg | ( | ) |
Clean the last error object(returned by engine) of current connection.
Example:
SequoiaDB::close | ( | ) |
SequoiaDB::connect | ( | array|string | $address = "127.0.0.1:11810" , |
string | $userName = "" , |
||
string | $password = "" , |
||
boolean | $useSSL = false |
||
) |
Connect to database.
$address | an array or the string argument. The Host Name or IP Address and The Service Name or Port of Database Server. |
$userName | the string argument. The User's Name of the account. |
$password | the string argument. The Password of the account. |
$useSSL | a boolean argument. Connect to database with ssl. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: 1. Connect to the default address of the database. The default address is 127.0.0.1:11810.
Example: 2. Connect to the database.
Example: 3. Connect to the database, using the default service name. The default service name is 11810.
Example: 4. Connect to the running database one.
Example: 5. Connect to the authentication database.
Example: 6. Connect to the running authentication database one.
Example: 7. Connect to the database with ssl.
SequoiaDB::createCataGroup | ( | string | $hostName, |
string | $serviceName, | ||
string | $databasePath, | ||
array|string | $configure = null |
||
) |
Create a catalog replica group.
$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:
SequoiaDB::createCS | ( | string | $name, |
array|string | $options = null |
||
) |
Create the specified collection space.
$name | the string argument. The collection space name. |
$options | an array or the string argument. The options specified by use. e.g. array( 'PageSize' => 4096, 'Domain' => 'myDomain' )
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createDomain | ( | string | $name, |
array|string | $options = null |
||
) |
Create a domain.
$name | the string argument. The name of the domain. |
$options | an array or the string argument. The options for the domain. The options are as below: Groups : The list of replica groups names which the domain is going to contain.
eg: array( 'Groups' => array( "group1", "group2", "group3" ) )
If this argument is not included, the domain will contain all replica groups in the cluster.
AutoSplit : If this option is set to be true, while creating collection(ShardingType is "hash") in this domain,
the data of this collection will be split(hash split) into all the groups in this domain automatically.
However, it not automatically split data into those groups which were add into this domain later.
eg: array( 'Groups' => array( "group1", "group2", "group3" ), 'AutoSplit' => true )
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createGroup | ( | string | $name | ) |
Create the specified replica group.
$name | the string argument. The name of the replica group. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createJsProcedure | ( | string | $code | ) |
Create a store procedure.
$code | the string argument. The code of store procedures. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::createUser | ( | string | $userName, |
string | $passwd | ||
) |
Create an account.
$userName | the string argument. The user name of the account. |
$passwd | the string argument. The password of the account. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::deleteConfig | ( | array|string | $configs, |
array|string | $options | ||
) |
Force the node to delete config from file and take effect.
$configs | the specific configuration parameters to delete |
$options | The control options:(Only take effect in coordinate nodes) GroupID:INT32,
GroupName:String,
NodeID:INT32,
HostName:String,
svcname:String,
...
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::dropCollectionSpace | ( | string | $name | ) |
Drop the specified collection space.
SequoiaDB::dropCS | ( | string | $name | ) |
Drop the specified collection space.
$name | the string argument. The collection space name. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::dropDomain | ( | string | $name | ) |
Drop a domain.
$name | the string argument. The name of the domain. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::evalJs | ( | string | $code | ) |
Eval javascript code.
$code | the string argument. The code to eval. |
void | |
string | |
integer | |
SequoiaINT64 | |
double | |
array | record |
string | record |
boolean | |
SequoiaCursor | Object |
SequoiaCS | Object |
SequoiaCL | Object |
SequoiaGroup | Object |
SequoiaNode | Object |
Example:
SequoiaDB::execSQL | ( | string | $sql | ) |
Executing SQL command.
$sql | the string argument. The SQL command. |
SequoiaCursor | Object |
Example:
SequoiaDB::execUpdateSQL | ( | string | $sql | ) |
Executing SQL command for updating.
$sql | the string argument. The SQL command. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::flushConfigure | ( | array|string | $options | ) |
Flush the options to configure file.
$options | an array or the string argument. The configure infomation. e.g. array( 'Global' => true )
Global : In cluster environment, passing array( 'Global' => true ) will flush data and catalog configuration file, while passing array( 'Global' => false ) will flush coord configuration file.
In stand-alone environment, both them have the same behaviour.
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::forceSession | ( | integer|SequoiaINT64 | $sessionID, |
array|string | $options = null |
||
) |
Interrupte the session.
$sessionID | an integer or the SequoiaINT64 Object argument. The id of the session which we want to inerrupt. |
$options | an array or the string argument. The location information, such as NodeID, HostName and svcname. the options are as below: HostName: Node's HostName.
svcname: Node's svcname.
NodeID: Node ID.
GroupID: Replica group ID.
GroupName: Replica group name.
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: integer type
Example: SequoiaINT64 type
Example: Force specified node session
SequoiaDB::getCL | ( | string | $fullName | ) |
Get the specified collection.
$fullName | the string argument. The collection full name. |
SequoiaCL | Object |
Example:
SequoiaDB::getCS | ( | string | $name | ) |
Get the specified collection space.
$name | the string argument. The collection space name. |
SequoiaCS | Object |
Example:
SequoiaDB::getDomain | ( | string | $name | ) |
Get a domain.
$name | the string argument. The name of the domain. |
SequoiaDomain | Object |
Example:
SequoiaDB::getGroup | ( | string | $name | ) |
Get the specified replica group.
SequoiaGroup | Object |
Example:
SequoiaDB::getLastErrorMsg | ( | ) |
Get the error object of the previous operation. The error object is not automatically cleared until the next operation.
array | error infomation |
If there has an error, it contains the follow fields:
Example:
SequoiaDB::getList | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null |
||
) |
Get the specified list.
SequoiaDB::getSessionAttr | ( | boolean | $useCache = TRUE | ) |
Get the attributes of the session.
$useCache | a boolean argument. Whether to use cache. |
array | result |
string | result |
Example:
SequoiaDB::getSnapshot | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null |
||
) |
Get the snapshot.
SequoiaDB::install | ( | array|string | $options = null | ) |
SequoiaDB class constructor.
$options | an array or the string argument. Set driver options and return the current options. the options are as below: The default is true, return an array;
set the false, return the string.
|
array | array( 'install' => true ) |
string | { "install": false } |
Example: 1. Set to return an array type
Example: 2. Set to return the string type
Example: 3. Get the driver current options
SequoiaDB::interrupt | ( | ) |
Send a "Interrpt" message to engine, as a result, all the cursors and lobs created by current connection will be closed.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::interruptOperation | ( | ) |
Send "INTERRUPT_SELF" message to engine to stop the current operation.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: Interrupt query operation
SequoiaDB::invalidateCache | ( | array|string | $condition = array( 'Global' => true ) | ) |
Clear node cache.
$condition | an array or the string argument . Filter condition: If the GroupID, GroupName, NodeID, HostName, and svcname fields are set, this field is ignored.
Global : true | false
The default is all groups, the relationship between GroupID and GroupName is or.
GroupID : 1001 | [ 1001, 1002, ... ],
GroupName : "group1" | [ "group1", "group2", ... ]
The default is all nodes in the group, the relationship between GroupID and GroupName is and.
NodeID : 1001 | [ 1001, 1002, ... ]
HostName : "host1" | [ "host1", "host2", ... ]
svcname : "11810" | [ "11810", "11820", ... ]
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::isValid | ( | ) |
Judge whether the connection is valid.
boolean | isConnect |
Example:
SequoiaDB::list | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null , |
||
integer | $numToSkip = 0 , |
||
integer | $numToReturn = -1 |
||
) |
Get the specified list.
$type | an integer argument. The list type as below: |
$condition | an array or the string argument. The matching rule, match all the documents if null. |
$selector | an array or the string argument. The selective rule, return the whole document if null. |
$orderBy | an array or the string argument. The ordered rule, never sort if null. |
$hint | an array or the string argument. The options provided for specific list type. Reserved. |
$numToSkip | an integer argument. Skip the first numToSkip records, never skip if this parameter is 0. |
$numToReturn | an integer argument. Only return numToReturn records, return all if this parameter is -1. |
SequoiaCursor | Object |
Example:
SequoiaDB::listBackup | ( | array|string | $options, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List the backups.
$options | an array or the string argument. Contains configuration infomations for remove backups, list all the backups in the default backup path if null. The "options" contains 3 options as below. All the elements in options are optional. e.g. array( 'GroupName' => array( 'RGName1', 'RGName2' ), 'Path' => '/opt/sequoiadb/backup', 'Name' => 'backupName' )
|
$condition | an array or the string argument. The matching rule, return all the record if null. |
$selector | an array or the string argument. The selective rule, return the whole record if null. |
$orderBy | an array or the string argument. The ordered rule, never sort if null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listCL | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List all collection of current database(not include temporary collection of temporary collection space)
$condition | an array or the string argument. This parameter is reserved and must be null. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listCollections | ( | ) |
List all collection of current database(not include temporary collection of temporary collection space)
SequoiaDB::listCS | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List all collection space of current database(include temporary collection space)
$condition | an array or the string argument. This parameter is reserved and must be null. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listCSs | ( | ) |
Get the specified list.
SequoiaDB::listDomain | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List the domain.
$condition | an array or the string argument. The matching rule, return all the record if null. |
$selector | an array or the string argument. The selective rule, return the whole record if null. |
$orderBy | an array or the string argument. The The ordered rule, never sort if null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listDomains | ( | ) |
List the domain.
SequoiaDB::listGroup | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List all the replica groups of current database.
$condition | an array or the string argument. This parameter is reserved and must be null. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listProcedure | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List store procedures.
$condition | an array or the string argument. The condition of list. |
$selector | an array or the string argument. This parameter is reserved and must be null. |
$orderBy | an array or the string argument. This parameter is reserved and must be null. |
$hint | an array or the string argument. This parameter is reserved and must be null. |
SequoiaCursor | Object |
Example:
SequoiaDB::listTask | ( | array|string | $condition = null , |
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null |
||
) |
List the tasks.
$condition | an array or the string argument. The matching rule, return all the record if null. |
$selector | an array or the string argument. The selective rule, return the whole record if null. |
$orderBy | an array or the string argument. The The ordered rule, never sort if null. |
$hint | an array or the string argument. The hint, automatically match the optimal hint if null. |
SequoiaCursor | Object |
Example:
SequoiaDB::removeBackup | ( | array|string | $options | ) |
Remove the backups.
$options | an array or the string argument. Contains configuration infomations for remove backups, list all the backups in the default backup path if null. The "options" contains 3 options as below. All the elements in options are optional. eg: array( 'GroupName' => array( 'RGName1', 'RGName2' ), 'Path' => '/opt/sequoiadb/backup', 'Name' => 'backupName' ) GroupName : Assign the backups of specifed replica groups to be list
Path : Assign the backups in specifed path to be list, if not assign, use the backup path asigned in the configuration file
Name : Assign the backups with specifed name to be list
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::removeGroup | ( | string | $name | ) |
Remove the specified replica group.
$name | the string argument. The name of the replica group. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::removeProcedure | ( | string | $name | ) |
Remove a store procedure.
$name | the string argument. The name of store procedure. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::removeUser | ( | string | $userName, |
string | $passwd | ||
) |
Delete an account.
$userName | the string argument. The user name of the account. |
$passwd | the string argument. The password of the account. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::renameCS | ( | string | $oldName, |
string | $newName, | ||
array|string | $options = null |
||
) |
Rename collectionSpace
$oldName | The old collection space name |
$newName | The new collection space name |
$options | Reserved |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::resetSnapshot | ( | array|string | $options = null | ) |
Reset the snapshot.
$options | an array or the string argument. The control options: "sessions"
"sessions current"
"database"
"health"
"all"
SessionID : (Int32) Specify the session ID to be reset.
Other Options : Some of other options are as below:(please visit the official website to search "Location Elements" for more detail.)
GroupID:INT32,
GroupName:String,
NodeID:INT32,
HostName:String,
svcname:String
...
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::selectCS | ( | string | $name, |
integer | $pageSize = 4096 |
||
) |
Get the specified collection space, if is not exist,will auto create.
$name | the string argument. The collection space name. |
$pageSize | an integer argument. When the collection space is created, $pageSize into force. The $pageSize as below: 4096
8192
16384
32768
65536
|
SequoiaCS | Object |
Example:
SequoiaDB::selectCS | ( | string | $name, |
array|string | $options = null |
||
) |
Get the specified collection space, if is not exist,will auto create.
$name | the string argument. The collection space name. |
$options | an array or the string argument. When the collection space is created, $options into force. The options specified by use. e.g. array( 'PageSize' => 4096, 'Domain' => 'mydomain' )
|
SequoiaCS | Object |
Example:
SequoiaDB::selectCS | ( | string | $name, |
integer | $pageSize = null |
||
) |
Get the specified collection space, if is not exist,will auto create.
$name | the string argument. The collection space name. |
$pageSize | an integer argument. Assign the pagesize of the collection space. |
SequoiaCS | Object |
Example:
SequoiaDB::selectGroup | ( | string | $name | ) |
Get the specified replica group.
SequoiaDB::setSessionAttr | ( | array|string | $options | ) |
Set the attributes of the session.
$options | an array or the string argument. The configuration options for session. Please reference here for more detail. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::snapshot | ( | integer | $type, |
array|string | $condition = null , |
||
array|string | $selector = null , |
||
array|string | $orderBy = null , |
||
array|string | $hint = null , |
||
integer | $numToSkip = 0 , |
||
integer | $numToReturn = -1 |
||
) |
Get the snapshot.
$type | an integer argument. The snapshot type as below: SDB_SNAP_CONTEXTS : Get the snapshot of all the contexts
SDB_SNAP_CONTEXTS_CURRENT : Get the snapshot of current context
SDB_SNAP_SESSIONS : Get the snapshot of all the sessions
SDB_SNAP_SESSIONS_CURRENT : Get the snapshot of current session
SDB_SNAP_COLLECTIONS : Get the snapshot of all the collections
SDB_SNAP_COLLECTIONSPACES : Get the snapshot of all the collection spaces
SDB_SNAP_DATABASE : Get the snapshot of the database
SDB_SNAP_SYSTEM : Get the snapshot of the system
SDB_SNAP_CATALOG : Get the snapshot of the catalog
SDB_SNAP_TRANSACTIONS : Get the snapshot of transactions
SDB_SNAP_TRANSACTIONS_CURRENT : Get the snapshot of all the transactions in current session
SDB_SNAP_ACCESSPLANS : Get the snapshot of cached access plans
SDB_SNAP_HEALTH : Get the snapshot of node health detection
SDB_SNAP_CONFIGS : Get the snapshot of node configurations
SDB_SNAP_SVCTASKS : Get the snapshot of service tasks
SDB_SNAP_SEQUENCES : Get the snapshot of sequences
SDB_SNAP_QUERIES : Get the snapshot of queries
SDB_SNAP_LATCHWAITS : Get the snapshot of latch waits
SDB_SNAP_LOCKWAITS : Get the snapshot of lock waits
SDB_SNAP_INDEXSTATS : Get the snapshot of index statistics
|
$condition | an array or the string argument. The matching rule, match all the documents if null. |
$selector | an array or the string argument. The selective rule, return the whole document if null. |
$orderBy | an array or the string argument. The ordered rule, never sort if null. |
$hint | an array or the string argument. The options provided for specific snapshot type. format: array( '$Options' => <options> ) |
$numToSkip | an integer argument. Skip the first numToSkip records, never skip if this parameter is 0. |
$numToReturn | an integer argument. Only return numToReturn records, return all if this parameter is -1. |
SequoiaCursor | Object |
Example:
SequoiaDB::syncDB | ( | array|string | $options = null | ) |
Sync database which are specified.
$options | an array or the string argument. The control options: Deep : (INT32) Flush with deep mode or not. 1 in default. 0 for non-deep mode,1 for deep mode,-1 means use the configuration with server.
Block : (Bool) Flush with block mode or not. false in default.
CollectionSpace : (String) Specify the collectionspace to sync. If not set, will sync all the collectionspaces and logs, otherwise, will only sync the collectionspace specified.
Location Elements : (Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String ...
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::transactionBegin | ( | ) |
Transaction begin.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::transactionCommit | ( | ) |
Transaction commit.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::transactionRollback | ( | ) |
Transaction rollback.
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::truncate | ( | string | $fullName | ) |
Truncate the collection.
$fullName | the string argument. The collection full name. |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::updateConfig | ( | array|string | $configs, |
array|string | $options | ||
) |
Force the node to update config from file and take effect.
$configs | the specific configuration parameters to update |
$options | The control options:(Only take effect in coordinate nodes) GroupID:INT32,
GroupName:String,
NodeID:INT32,
HostName:String,
svcname:String,
...
|
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example:
SequoiaDB::waitTask | ( | array|integer|SequoiaInt64 | $taskID | ) |
Remove the backups.
$taskID | an array or an integer argument. The array of task id or the integer of task id ; |
array | array( 'errno' => 0 ) |
string | { "errno": 0 } |
Example: array type
Example: integer type
Example: SequoiaInt64 type
const SequoiaDB::SDB_LIST_CL_IN_DOMAIN 129 |
Get the list of the collections in specified domain.
const SequoiaDB::SDB_LIST_COLLECTIONS 4 |
Get the list of the collections.
const SequoiaDB::SDB_LIST_COLLECTIONSPACES 5 |
Get the list of the collecion spaces.
const SequoiaDB::SDB_LIST_CONTEXTS 0 |
Get the list of the contexts.
const SequoiaDB::SDB_LIST_CONTEXTS_CURRENT 1 |
Get the list of current context.
const SequoiaDB::SDB_LIST_CS_IN_DOMAIN 130 |
Get the list of the collection spaces in specified domain.
const SequoiaDB::SDB_LIST_DOMAINS 9 |
Get the list of the domains ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_GROUPS 7 |
Get the list of the replica groups ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_SEQUENCES 15 |
Get the list of sequences.
const SequoiaDB::SDB_LIST_SESSIONS 2 |
Get the list of the sessions.
const SequoiaDB::SDB_LIST_SESSIONS_CURRENT 3 |
Get the list of current session.
const SequoiaDB::SDB_LIST_STORAGEUNITS 6 |
Get the list of the storage units.
const SequoiaDB::SDB_LIST_STOREPROCEDURES 8 |
Get the list of the stored procedures ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_SVCTASKS 14 |
Get the list of service tasks.
const SequoiaDB::SDB_LIST_TASKS 10 |
Get the list of the tasks ( only applicable in sharding env ).
const SequoiaDB::SDB_LIST_TRANSACTIONS 11 |
Get all the transactions information.
const SequoiaDB::SDB_LIST_TRANSACTIONS_CURRENT 12 |
Get the transactions information of current session.
const SequoiaDB::SDB_LIST_USERS 16 |
Get the list of users.
const SequoiaDB::SDB_SNAP_ACCESSPLANS 11 |
Get the snapshot of cached access plans.
const SequoiaDB::SDB_SNAP_CATA 8 |
const SequoiaDB::SDB_SNAP_CATALOG 8 |
Get the snapshot of the catalog.
const SequoiaDB::SDB_SNAP_COLLECTION 4 |
const SequoiaDB::SDB_SNAP_COLLECTIONS 4 |
Get the snapshot of all the collections.
const SequoiaDB::SDB_SNAP_COLLECTIONSPACE 5 |
const SequoiaDB::SDB_SNAP_COLLECTIONSPACES 5 |
Get the snapshot of all the collection spaces.
const SequoiaDB::SDB_SNAP_CONFIGS 13 |
Get the snapshot of node configurations.
const SequoiaDB::SDB_SNAP_CONTEXTS 0 |
Get the snapshot of all the contexts.
const SequoiaDB::SDB_SNAP_CONTEXTS_CURRENT 1 |
Get the snapshot of current context
const SequoiaDB::SDB_SNAP_DATABASE 6 |
Get the snapshot of the database.
const SequoiaDB::SDB_SNAP_HEALTH 12 |
Get the snapshot of node health detection.
const SequoiaDB::SDB_SNAP_INDEXSTATS 21 |
Get the snapshot of index statistics
const SequoiaDB::SDB_SNAP_LATCHWAITS 19 |
Get the snapshot of latch waits
const SequoiaDB::SDB_SNAP_LOCKWAITS 20 |
Get the snapshot of lock waits
const SequoiaDB::SDB_SNAP_QUERIES 18 |
Get the snapshot of queries
const SequoiaDB::SDB_SNAP_SEQUENCES 15 |
Get the snapshot of sequences.
const SequoiaDB::SDB_SNAP_SESSIONS 2 |
Get the snapshot of all the sessions.
const SequoiaDB::SDB_SNAP_SESSIONS_CURRENT 3 |
Get the snapshot of current session.
const SequoiaDB::SDB_SNAP_SVCTASKS 14 |
Get the snapshot of service tasks.
const SequoiaDB::SDB_SNAP_SYSTEM 7 |
Get the snapshot of the system.
const SequoiaDB::SDB_SNAP_TRANSACTION 9 |
const SequoiaDB::SDB_SNAP_TRANSACTION_CURRENT 10 |
const SequoiaDB::SDB_SNAP_TRANSACTIONS 9 |
Get the snapshot of all the transactions.
const SequoiaDB::SDB_SNAP_TRANSACTIONS_CURRENT 10 |
Get the snapshot of current transaction.