SequoiaDB
|
Database operation interfaces of admin. More...
#include <client.hpp>
Public Member Functions | |
sdb (BOOLEAN useSSL=FALSE) | |
Default constructor. | |
~sdb () | |
Destructor. | |
INT32 | connect (const CHAR *pHostName, UINT16 port) |
Connect to remote Database Server. | |
INT32 | connect (const CHAR *pHostName, UINT16 port, const CHAR *pUsrName, const CHAR *pPasswd) |
Connect to remote Database Server. | |
INT32 | connect (const CHAR *pHostName, const CHAR *pServiceName) |
Connect to remote Database Server. | |
INT32 | connect (const CHAR *pHostName, const CHAR *pServiceName, const CHAR *pUsrName, const CHAR *pPasswd) |
Connect to remote Database Server. | |
INT32 | connect (const CHAR **pConnAddrs, INT32 arrSize, const CHAR *pUsrName, const CHAR *pPasswd) |
Connect to database used a random valid address in the array. | |
INT32 | connect (const CHAR **pConnAddrs, INT32 arrSize, const CHAR *pUsrName, const CHAR *pToken, const CHAR *pCipherFile) |
Connect to database used a random valid address in the array. | |
UINT64 | getDbStartTime () |
Get sequoiadb start time. | |
void | getVersion (UINT8 &version, UINT8 &subVersion, UINT8 &fixVersion) |
Get sequoiadb version. | |
INT32 | createUsr (const CHAR *pUsrName, const CHAR *pPasswd, const bson::BSONObj &options=_sdbStaticObject) |
Add an user in current database. | |
INT32 | removeUsr (const CHAR *pUsrName, const CHAR *pPasswd) |
Remove the spacified user from current database. | |
INT32 | alterUsr (const CHAR *pUsrName, const CHAR *pAction, const bson::BSONObj &options) |
Alter the spacified user's information. | |
INT32 | changeUsrPasswd (const CHAR *pUsrName, const CHAR *pOldPasswd, const CHAR *pNewPasswd) |
Change the spacified user's password. | |
void | disconnect () |
Disconnect the remote Database Server. | |
INT32 | getSnapshot (sdbCursor &cursor, INT32 snapType, const bson::BSONObj &condition=_sdbStaticObject, const bson::BSONObj &selector=_sdbStaticObject, const bson::BSONObj &orderBy=_sdbStaticObject, const bson::BSONObj &hint=_sdbStaticObject, INT64 numToSkip=0, INT64 numToReturn=-1) |
Get the snapshots of specified type. | |
INT32 | resetSnapshot (const bson::BSONObj &options=_sdbStaticObject) |
Reset the snapshot. | |
INT32 | getList (sdbCursor &cursor, INT32 listType, const bson::BSONObj &condition=_sdbStaticObject, const bson::BSONObj &selector=_sdbStaticObject, const bson::BSONObj &orderBy=_sdbStaticObject, const bson::BSONObj &hint=_sdbStaticObject, INT64 numToSkip=0, INT64 numToReturn=-1) |
Get the informations of specified type. | |
INT32 | getCollection (const CHAR *pCollectionFullName, sdbCollection &collection, BOOLEAN checkExist=TRUE) |
INT32 | getCollectionSpace (const CHAR *pCollectionSpaceName, sdbCollectionSpace &cs, BOOLEAN checkExist=TRUE) |
Get the specified collection space. | |
INT32 | createCollectionSpace (const CHAR *pCollectionSpaceName, INT32 iPageSize, sdbCollectionSpace &cs) |
Create collection space with specified pagesize. | |
INT32 | createCollectionSpace (const CHAR *pCollectionSpaceName, const bson::BSONObj &options, sdbCollectionSpace &cs) |
Create collection space with specified pagesize. | |
INT32 | dropCollectionSpace (const CHAR *pCollectionSpaceName) |
Remove the specified collection space. | |
INT32 | listCollectionSpaces (sdbCursor &cursor) |
List all collection space of current database(include temporary collection space). | |
INT32 | listCollections (sdbCursor &cursor) |
list all collections in current database. | |
INT32 | listReplicaGroups (sdbCursor &cursor) |
List all replica groups of current database. | |
INT32 | getReplicaGroup (const CHAR *pName, sdbReplicaGroup &group) |
Get the specified replica group. | |
INT32 | getReplicaGroup (INT32 id, sdbReplicaGroup &group) |
Get the specified replica group. | |
INT32 | createReplicaGroup (const CHAR *pName, sdbReplicaGroup &group) |
Create the specified replica group. | |
INT32 | removeReplicaGroup (const CHAR *pName) |
Remove the specified replica group. | |
INT32 | createReplicaCataGroup (const CHAR *pHostName, const CHAR *pServiceName, const CHAR *pDatabasePath, const bson::BSONObj &configure) |
Create a catalog replica group. | |
INT32 | activateReplicaGroup (const CHAR *pName, sdbReplicaGroup &replicaGroup) |
Activate the specified replica group. | |
INT32 | execUpdate (const CHAR *sql, bson::BSONObj *pResult=NULL) |
Executing SQL command for updating. | |
INT32 | exec (const CHAR *sql, sdbCursor &cursor) |
Executing SQL command. | |
INT32 | transactionBegin () |
Transaction commit. | |
INT32 | transactionCommit () |
Transaction commit. | |
INT32 | transactionRollback () |
Transaction rollback. | |
INT32 | flushConfigure (const bson::BSONObj &options) |
flush the options to configure file. | |
INT32 | crtJSProcedure (const CHAR *code) |
create a store procedures. | |
INT32 | rmProcedure (const CHAR *spName) |
remove a store procedure. | |
INT32 | listProcedures (sdbCursor &cursor, const bson::BSONObj &condition) |
list store procedures. | |
INT32 | evalJS (const CHAR *code, SDB_SPD_RES_TYPE &type, sdbCursor &cursor, bson::BSONObj &errmsg) |
Eval a js function. | |
INT32 | backupOffline (const bson::BSONObj &options) |
Backup database. | |
INT32 | backup (const bson::BSONObj &options) |
Backup database. | |
INT32 | listBackup (sdbCursor &cursor, const bson::BSONObj &options, const bson::BSONObj &condition=_sdbStaticObject, const bson::BSONObj &selector=_sdbStaticObject, const bson::BSONObj &orderBy=_sdbStaticObject) |
List the backups. | |
INT32 | removeBackup (const bson::BSONObj &options) |
Remove the backups. | |
INT32 | listTasks (sdbCursor &cursor, const bson::BSONObj &condition=_sdbStaticObject, const bson::BSONObj &selector=_sdbStaticObject, const bson::BSONObj &orderBy=_sdbStaticObject, const bson::BSONObj &hint=_sdbStaticObject) |
List the tasks. | |
INT32 | waitTasks (const SINT64 *taskIDs, SINT32 num) |
Wait the tasks to finish. | |
INT32 | cancelTask (SINT64 taskID, BOOLEAN isAsync) |
Cancel the specified task. | |
INT32 | setSessionAttr (const bson::BSONObj &options=_sdbStaticObject) |
Set the attributes of the session. | |
INT32 | getSessionAttr (bson::BSONObj &result, BOOLEAN useCache=TRUE) |
Get the attributes of the current session. | |
INT32 | closeAllCursors () |
Send a "Interrpt" message to engine, as a result, all the cursors and lobs created by current connection will be closed. | |
INT32 | interrupt () |
Send "INTERRUPT" message to engine, as a result, all the cursors and lobs created by current connection will be closed. | |
INT32 | interruptOperation () |
Send "INTERRUPT_SELF" message to engine to stop the current operation. When the current operation had finish, nothing happend, Otherwise, the current operation will be stop, and return error. | |
INT32 | isValid (BOOLEAN *result) |
Judge whether the connection is valid. | |
BOOLEAN | isValid () |
Judge whether the connection is valid. | |
BOOLEAN | isClosed () |
Judge whether the connection has been closed. | |
INT32 | createDomain (const CHAR *pDomainName, const bson::BSONObj &options, sdbDomain &domain) |
Create a domain. | |
INT32 | dropDomain (const CHAR *pDomainName) |
Drop a domain. | |
INT32 | getDomain (const CHAR *pDomainName, sdbDomain &domain) |
Get a domain. | |
INT32 | listDomains (sdbCursor &cursor, const bson::BSONObj &condition=_sdbStaticObject, const bson::BSONObj &selector=_sdbStaticObject, const bson::BSONObj &orderBy=_sdbStaticObject, const bson::BSONObj &hint=_sdbStaticObject) |
List the domains. | |
UINT64 | getLastAliveTime () const |
Get the number of seconds from the standard time point (usually in the midnight of January 1, 1970) to the last alive time. | |
INT32 | syncDB (const bson::BSONObj &options=_sdbStaticObject) |
sync the current database | |
INT32 | analyze (const bson::BSONObj &options=_sdbStaticObject) |
Analyze collection or index to collect statistics information. | |
INT32 | forceSession (SINT64 sessionID, const bson::BSONObj &options=_sdbStaticObject) |
Stop the specified session's current operation and terminate it. | |
INT32 | forceStepUp (const bson::BSONObj &options=_sdbStaticObject) |
In a replica group that doesn't satisfy the requirement ofre-election, upgrade a slave node to a master node by force. | |
INT32 | invalidateCache (const bson::BSONObj &options=_sdbStaticObject) |
invalidate cache on specified nodes. | |
INT32 | reloadConfig (const bson::BSONObj &options=_sdbStaticObject) |
Force the node to reload config from file and take effect. | |
INT32 | updateConfig (const bson::BSONObj &configs=_sdbStaticObject, const bson::BSONObj &options=_sdbStaticObject) |
Update node config and take effect. | |
INT32 | deleteConfig (const bson::BSONObj &configs=_sdbStaticObject, const bson::BSONObj &options=_sdbStaticObject) |
Delete node config and take effect. | |
INT32 | setPDLevel (INT32 level, const bson::BSONObj &options=_sdbStaticObject) |
Set the node's diagnostic level and take effect. | |
INT32 | loadCS (const CHAR *csName, const bson::BSONObj &options=_sdbStaticObject) |
Load the specific cs from the file. | |
INT32 | unloadCS (const CHAR *csName, const bson::BSONObj &options=_sdbStaticObject) |
Unload the specific cs. | |
INT32 | traceStart (UINT32 traceBufferSize, const CHAR *component=NULL, const CHAR *breakpoint=NULL, const vector< UINT32 > &tidVec=_sdbStaticUINT32Vec) |
Turn on the trace function of the database engine. | |
INT32 | traceStart (UINT32 traceBufferSize, const bson::BSONObj &options) |
Turn on the trace function of the database engine. | |
INT32 | traceStop (const CHAR *dumpFileName) |
Close the tracing function of the database engine, and then export the information in to binary files. | |
INT32 | traceResume () |
Resume the breakpoint trace tool. | |
INT32 | traceStatus (sdbCursor &cursor) |
Show the current status of the program trace. | |
INT32 | renameCollectionSpace (const CHAR *oldName, const CHAR *newName, const bson::BSONObj &options=_sdbStaticObject) |
Rename collectionSpace. | |
INT32 | getLastErrorObj (bson::BSONObj &errObj) |
Get the error object(only return by engine) of the last operation. The error object will not be clean up automatically until the next error object cover it. | |
void | cleanLastErrorObj () |
Clean the last error object(returned by engine) of current connection. | |
INT32 | getLastResultObj (bson::BSONObj &result, BOOLEAN getOwned=FALSE) const |
Get the result object(only return by engine) of the last operation. The result object will not be clean up automatically until the next result object cover it. | |
Public Attributes | |
_sdb * | pSDB |
Database operation interfaces of admin.
|
inline |
Default constructor.
[in] | useSSL | Set whether use the SSL or not, default is FALSE. |
|
inline |
Activate the specified replica group.
[in] | pName | The name of the replica group |
[out] | replicaGroup | The return sdbReplicaGroup object |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Alter the spacified user's information.
[in] | pUsrName | The username needed to alter information. |
[in] | pAction | The alter action. |
[in] | options | The action corresponding options. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Analyze collection or index to collect statistics information.
[in] | options | 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. Other options : Some of other options are as below:(only take effect in coordinate nodes, please visit the official website to search "analyze" or "Location Elements" for more detail.) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Backup database.
[in] | options | 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. eg: {"GroupName":["rgName1", "rgName2"], "Path":"/opt/sequoiadb/backup", "Name":"backupName", "Description":description, "EnsureInc":true, "OverWrite":true} GroupID : The id(s) of replica group(s) which to be backuped GroupName : The replica groups which to be backuped Path : The backup path, if not assign, use the backup path assigned in the configuration file, the path support to use wildcard(%g/%G:group name, %h/%H:host name, %s/%S:service name). e.g. {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. {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 |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Backup database.
[in] | options | 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. eg: {"GroupName":["rgName1", "rgName2"], "Path":"/opt/sequoiadb/backup", "Name":"backupName", "Description":description, "EnsureInc":true, "OverWrite":true} GroupID : The id(s) of replica group(s) which to be backuped GroupName : The replica groups which to be backuped Path : The backup path, if not assign, use the backup path assigned in the configuration file, the path support to use wildcard(%g/%G:group name, %h/%H:host name, %s/%S:service name). e.g. {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. {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 |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Cancel the specified task.
[in] | taskID | The task id |
[in] | isAsync | The operation "cancel task" is async or not, "true" for async, "false" for sync. Default sync |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Change the spacified user's password.
[in] | pUsrName | The username needed to change password. |
[in] | pOldPasswd | The old password. |
[in] | pNewPasswd | The new password. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Send a "Interrpt" message to engine, as a result, all the cursors and lobs created by current connection will be closed.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Connect to remote Database Server.
[in] | pHostName | The Host Name or IP Address of Database Server. |
[in] | port | The Port of Database Server. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Connect to remote Database Server.
[in] | pHostName | The Host Name or IP Address of Database Server. |
[in] | port | The Port of Database Server. |
[in] | pUsrName | The connection user name. |
[in] | pPasswd | The connection password. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Connect to remote Database Server.
[in] | pHostName | The Host Name or IP Address of Database Server. |
[in] | pServiceName | The Service Name of Database Server. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Connect to remote Database Server.
[in] | pHostName | The Host Name or IP Address of Database Server. |
[in] | pServiceName | The Service Name of Database Server. |
[in] | pUsrName | The connection user name. |
[in] | pPasswd | The connection password. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Connect to database used a random valid address in the array.
[in] | pConnAddrs | The array of the coord's address |
[in] | arrSize | The size of the array |
[in] | pUsrName | The connection user name. |
[in] | pPasswd | The connection password. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Connect to database used a random valid address in the array.
[in] | pConnAddrs | The array of the coord's address |
[in] | arrSize | The size of the array |
[in] | pUsrName | The connection user name. |
[in] | pToken | The Password encryption token. |
[in] | pCipherFile | The Cipherfile location. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Create collection space with specified pagesize.
[in] | pCollectionSpaceName | The name of collection space. |
[in] | iPageSize | The Page Size as below SDB_PAGESIZE_4K SDB_PAGESIZE_8K SDB_PAGESIZE_16K SDB_PAGESIZE_32K SDB_PAGESIZE_64K SDB_PAGESIZE_DEFAULT |
[out] | cs | The return collection space object of creation. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Create collection space with specified pagesize.
[in] | pCollectionSpaceName | The name of collection space. |
[in] | options | The options specified by user, e.g. {"PageSize": 4096, "Domain": "mydomain"}. PageSize : Assign the pagesize of the collection space Domain : Assign which domain does current collection space belong to |
[out] | cs | The return collection space object of creation. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Create a domain.
[in] | pDomainName | The name of the domain |
[in] | options | 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: { "Groups": [ "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 won't automatically split data into those groups which were add into this domain later. eg: { "Groups": [ "group1", "group2", "group3" ], "AutoSplit: true" } |
[out] | domain | The created sdbDomain object |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Create a catalog replica group.
[in] | pHostName | The hostname for the catalog replica group |
[in] | pServiceName | The servicename for the catalog replica group |
[in] | pDatabasePath | The path for the catalog replica group |
[in] | configure | The configurations for the catalog replica group |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Create the specified replica group.
[in] | pName | The name of the replica group. |
[out] | group | The return sdbReplicaGroup object. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Add an user in current database.
[in] | pUsrName | The connection user name. |
[in] | pPasswd | The connection password. |
[in] | options | The options for user, such as: { AuditMask:"DDL|DML" } AuditMask : User audit log mask, value list: ACCESS,CLUSTER,SYSTEM,DML,DDL,DCL,DQL,INSERT,DELETE, UPDATE,OTHER. You can combine multiple values with '|'. 'ALL' means that all mask items are turned on, and 'NONE' means that no mask items are turned on. If an item in the user audit log is not configured, the configuration of the corresponding mask item on the node is inherited. You can also use '!' to disable inheritance of this mask( e.g. "!DDL|DML" ). |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
create a store procedures.
[in] | code | The code of store procedures |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Delete node config and take effect.
[in] | configs | the specific configuration parameters to delete. { diaglevel:1 } Delete diaglevel config and restore to default value. |
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Remove the specified collection space.
[in] | pCollectionSpaceName | The name of collection space. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Drop a domain.
[in] | pDomainName | The name of the domain |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Eval a js function.
INT32 evalJS( const CHAR *code, SDB_SPD_RES_TYPE &type, sdbCursor &cursor, bson::BSONObj &errmsg )
[in] | code | The js code to eval. |
[out] | type | The type of value. type is declared in spd.h. |
[out] | cursor | The cursor handle of current eval. |
[out] | errmsg | The errmsg from eval. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Executing SQL command.
[in] | sql | The SQL command. |
[out] | cursor | The return cursor object of matching documents. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Executing SQL command for updating.
[in] | sql | The SQL command. |
[out] | pResult | The detail result info |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
flush the options to configure file.
[in] | options | The configure infomation, pass {"Global":true} or {"Global":false} In cluster environment, passing {"Global":true} will flush data's and catalog's configuration file, while passing {"Global":false} will flush coord's configuration file. In stand-alone environment, both them have the same behaviour. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Stop the specified session's current operation and terminate it.
[in] | sessionID | The ID of the session. |
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
In a replica group that doesn't satisfy the requirement ofre-election, upgrade a slave node to a master node by force.
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the specified collection.
[in] | pCollectionFullName | The full name of collection. |
[in] | checkExist | Check if the collection exists, default is true. |
[out] | collection | The return collection object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the specified collection space.
[in] | pCollectionSpaceName | The name of collection space. |
[in] | checkExist | Check if the collection space exists, default is true. |
[out] | cs | The return collection space object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get sequoiadb start time.
Sequoiadb | start time |
|
inline |
Get a domain.
[in] | pDomainName | The name of the domain |
[out] | domain | The sdbDomain object to get |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the number of seconds from the standard time point (usually in the midnight of January 1, 1970) to the last alive time.
UINT64 | time difference, unit for seconds |
|
inline |
Get the error object(only return by engine) of the last operation. The error object will not be clean up automatically until the next error object cover it.
[out] | errObj | The return error bson object. Please reference here for more detail. |
SDB_OK | Operation Success. |
SDB_DMS_EOC | There is no error object. |
Others | Operation Fail. |
|
inline |
Get the result object(only return by engine) of the last operation. The result object will not be clean up automatically until the next result object cover it.
[out] | result | The return result bson object. |
[in] | getOwned | Whether the return result bson object should get owned memory or not. |
SDB_OK | Operation Success. |
Others | Operation Fail. |
|
inline |
Get the informations of specified type.
[in] | listType | The list type as below SDB_LIST_CONTEXTS : Get all contexts list SDB_LIST_CONTEXTS_CURRENT : Get contexts list for the current session SDB_LIST_SESSIONS : Get all sessions list SDB_LIST_SESSIONS_CURRENT : Get the current session SDB_LIST_COLLECTIONS : Get all collections list SDB_LIST_COLLECTIONSPACES : Get all collecion spaces' list SDB_LIST_STORAGEUNITS : Get storage units list SDB_LIST_GROUPS : Get replicaGroup list ( only applicable in sharding env ) SDB_LIST_STOREPROCEDURES : Get all the stored procedure list SDB_LIST_DOMAINS : Get all the domains list SDB_LIST_TASKS : Get all the running split tasks ( only applicable in sharding env ) SDB_LIST_TRANSACTIONS : Get all the transactions information. SDB_LIST_TRANSACTIONS_CURRENT : Get the transactions information of current session. SDB_LIST_SVCTASKS : Get all the schedule task informations SDB_LIST_SEQUENCES : Get all the sequence informations SDB_LIST_USERS : Get all the user informations |
[in] | condition | The matching rule, match all the documents if null. |
[in] | select | The selective rule, return the whole document if null. |
[in] | orderBy | The ordered rule, never sort if null. |
[in] | hint | The options provided for specific list type. Reserved. |
[in] | numToSkip | Skip the first numToSkip documents. |
[in] | numToReturn | Only return numToReturn documents. -1 means return all matched results. |
[out] | cursor | The return cursor object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the specified replica group.
[in] | pName | The name of replica group. |
[out] | group | The sdbReplicaGroup object. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the specified replica group.
[in] | id | The id of replica group. |
[out] | group | The sdbReplicaGroup object. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the attributes of the current session.
[out] | result | The return bson object. |
[in] | useCache | Whether to use cache in local, default to be TRUE. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get the snapshots of specified type.
[in] | snapType | 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 snapshot of transactions in current session SDB_SNAP_TRANSACTIONS_CURRENT : Get snapshot of all the transactions SDB_SNAP_ACCESSPLANS : Get the snapshot of cached access plans SDB_SNAP_HEALTH : Get snapshot of node health detection SDB_SNAP_CONFIGS : Get snapshot of node configurations SDB_SNAP_SVCTASKS : Get snapshot of service task SDB_SNAP_SEQUENCES : Get the snapshot of sequences |
[in] | numToSkip | Skip the first numToSkip documents, default is 0 |
[in] | numToReturn | Only return numToReturn documents, default is -1 for returning all results |
[in] | condition | The matching rule, match all the documents if not provided. |
[in] | select | The selective rule, return the whole document if not provided. |
[in] | orderBy | The ordered rule, result set is unordered if not provided. |
[in] | hint | The options provided for specific snapshot type. format:{ '$Options': { <options> } } |
[out] | cursor | The return cursor object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Get sequoiadb version.
[out] | version | Version. |
[out] | subVersion | Sub version. |
[out] | fixVersion | Fix version. |
void |
|
inline |
Send "INTERRUPT" message to engine, as a result, all the cursors and lobs created by current connection will be closed.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Send "INTERRUPT_SELF" message to engine to stop the current operation. When the current operation had finish, nothing happend, Otherwise, the current operation will be stop, and return error.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
invalidate cache on specified nodes.
[in] | cHandle | The connection handle |
[in] | options | The control options:(Only take effect in coordinate nodes). Some of its optional parameters are as bellow: Global(Bool) : execute this command in global or not. While 'options' is null, it's equals to {Glocal: true}. GroupID(INT32 or INT32 Array) : specified one or several groups by their group IDs. e.g. {GroupID:[1001, 1002]}. GroupName(String or String Array) : specified one or several groups by their group names. e.g. {GroupID:"group1"}. ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Judge whether the connection has been closed.
TRUE | or FALSE |
|
inline |
Judge whether the connection is valid.
[out] | result | the output result |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Judge whether the connection is valid.
TRUE | for the connection is valid while FALSE for not |
|
inline |
List the backups.
[in] | options | Contains configuration information for listing backups, list all the backups in the default backup path if null. The "options" contains several options as below. All the elements in options are optional. eg: {"GroupName":["rgame1", "rgName2"], "Path":"/opt/sequoiadb/backup", "Name":"backupName"} GroupID : Specified the group id of the backups, default to list all the backups of all the groups. GroupName : Specified the group name of the backups, default to list all the backups of all the groups. Path : Specified the path of the backups, default to use the backup path asigned in the configuration file. Name : Specified the name of backup, default to list all the backups. IsSubDir : Specified the "Path" is a subdirectory of the backup path assigned in the configuration file or not, default to be false. Prefix : Specified the prefix name of the backups, support for using wildcards("%g","%G","%h","%H","%s","%s"),such as: Prefix:"%g_bk_", default to not using wildcards. Detail : Display the detail of the backups or not, default to be false. |
[in] | condition | The matching rule, return all the documents if not provided |
[in] | selector | The selective rule, return the whole document if null |
[in] | orderBy | The ordered rule, never sort if null |
[out] | cursor | The cusor handle of result |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
list all collections in current database.
[out] | cursor | The return cursor object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
List all collection space of current database(include temporary collection space).
[out] | cursor | The return cursor object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
List the domains.
[in] | condition | The matching rule, return all the documents if null |
[in] | selector | The selective rule, return the whole document if null |
[in] | orderBy | The ordered rule, never sort if null |
[in] | hint | Specified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is not provided, database automatically match the optimal index to scan data |
[out] | cursor | The sdbCursor object of result |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
list store procedures.
[in] | condition | The condition of list |
[out] | cursor | The cursor of the result |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
List all replica groups of current database.
[out] | cursor | The return cursor object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
List the tasks.
[in] | condition | The matching rule, return all the documents if null |
[in] | selector | The selective rule, return the whole document if null |
[in] | orderBy | The ordered rule, never sort if null |
[in] | hint | Specified the index used to scan data. e.g. {"":"ageIndex"} means using index "ageIndex" to scan data(index scan); {"":null} means table scan. when hint is not provided, database automatically match the optimal index to scan data |
[out] | cursor | The connection handle |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Load the specific cs from the file.
[in] | csName | The name of cs that will be loaded |
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Force the node to reload config from file and take effect.
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Remove the backups.
[in] | options | Contains configuration information for remove backups, remove all the backups in the default backup path if null. The "options" contains several options as below. All the elements in options are optional. eg: {"GroupName":["rgName1", "rgName2"], "Path":"/opt/sequoiadb/backup", "Name":"backupName"} GroupID : Specified the group id of the backups, default to list all the backups of all the groups. GroupName : Specified the group name of the backups, default to list all the backups of all the groups. Path : Specified the path of the backups, default to use the backup path asigned in the configuration file. Name : Specified the name of backup, default to list all the backups. IsSubDir : Specified the "Path" is a subdirectory of the backup path assigned in the configuration file or not, default to be false. Prefix : Specified the prefix name of the backups, support for using wildcards("%g","%G","%h","%H","%s","%s"),such as: Prefix:"%g_bk_", default to not using wildcards. Detail : Display the detail of the backups or not, default to be false. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Remove the specified replica group.
[in] | pName | The name of the replica group |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Remove the spacified user from current database.
[in] | pUsrName | The connection user name. |
[in] | pPasswd | The connection password. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Rename collectionSpace.
[in] | oldName | The old name of collectionSpace. |
[in] | newName | The new name of collectionSpace. |
[in] | options | Reserved argument |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Reset the snapshot.
[in] | options | The control options: Type : (String) Specify the snapshot type to be reset.( defalut is "all" ) "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, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
remove a store procedure.
[in] | spName | The name of store procedure |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Set the node's diagnostic level and take effect.
[in] | level | The diagnostic level, value 0~5. value means: 0: SEVERE 1: ERROR 2: EVENT 3: WARNING 4: INFO 5: DEBUG |
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Set the attributes of the session.
[in] | options | The options for setting session attributes. Can not be NULL. While it's a empty options, the local session attributes cache will be cleanup. Please reference here for more detail. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
sync the current database
[in] | options | 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. Some of other options are as below:(only take effect in coordinate nodes, please visit the official website to search "sync" or "Location Elements" for more detail.) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Resume the breakpoint trace tool.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Turn on the trace function of the database engine.
[in] | traceBufferSize | Trace file's size(MB), Value range:[1,1024]. |
[in] | component | Specific module. |
[in] | breakpoint | Add a breakpoint in function to trace. |
[in] | tidVec | The target threads. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Turn on the trace function of the database engine.
[in] | traceBufferSize | Trace file's size(MB), Value range:[1,1024]. |
[in] | options | The options for traceStart. The options are as below: components: The components the user wants to monitor. eg: { "components": [ "dms", "rtn" ] } breakPoints: The breakPoints the user wants to monitor. eg: { "breakPoints": [ "catGetOneObj", "_dmsStorageBase::sync" ] } tids: The tids the user wants to monitor. eg: { "tids": [ 23456, 23457 ] } functionNames: The functionNames the user wants to monitor. eg: { "functionNames": [ "_pmdEDUCB::resetInfo","isInterrupted" ] } threadTypes: The threadTypes the user wants to monitor. eg: { "threadTypes": [ "TCPListener", "CoordNetwork" ] } |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Show the current status of the program trace.
[out] | cursor | The return cursor object of query. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Close the tracing function of the database engine, and then export the information in to binary files.
[in] | dumpFileName | Name of dump file. If the file path is relative path, will store file into the node's 'diagpath'. |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Transaction commit.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Transaction commit.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Transaction rollback.
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Unload the specific cs.
[in] | csName | The name of cs that will be unloaded |
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Update node config and take effect.
[in] | configs | the specific configuration parameters to update. { diaglevel:3 } Modify diaglevel as 3. |
[in] | options | The control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ... |
SDB_OK | Operation Success |
Others | Operation Fail |
|
inline |
Wait the tasks to finish.
[in] | taskIDs | The array of task id |
[in] | num | The number of task id |
SDB_OK | Operation Success |
Others | Operation Fail |
sdbclient::sdb::pSDB |
A pointer of virtual base class _sdb
Class sdb is a shell for _sdb. We use pSDB to call the methods in class _sdb.