SequoiaDB
 All Classes Namespaces Files Functions Variables Enumerations Properties Pages
Public Member Functions | Static Public Member Functions | Properties | List of all members
SequoiaDB.Sequoiadb Class Reference

Database operation interfaces of admin. More...

Public Member Functions

 Sequoiadb ()
 Default Constructor.
 
 Sequoiadb (string connString)
 Constructor.
 
 Sequoiadb (List< string > connStrings)
 Constructor.
 
 Sequoiadb (string host, int port)
 Constructor.
 
void Connect ()
 Connect to remote Sequoiadb database server.
 
void Connect (string username, string password)
 Connect to remote Sequoiadb database server Sequoiadb connection user name Sequoiadb connection password.
 
void Connect (string username, string password, ConfigOptions options)
 Connect to remote Sequoiadb database server Sequoiadb connection user name Sequoiadb connection password The options for connection.
 
void Disconnect ()
 Disconnect the remote server.
 
bool IsValid ()
 Judge wether the connection is is valid or not.
 
void CreateUser (string username, string password)
 Add an user in current database Sequoiadb connection user name Sequoiadb connection password.
 
void RemoveUser (string username, string password)
 Remove the user from current database Sequoiadb connection user name Sequoiadb connection password.
 
void TransactionBegin ()
 Begin the database transaction.
 
void TransactionCommit ()
 Commit the database transaction.
 
void TransactionRollback ()
 Rollback the database transaction.
 
void ChangeConnectionOptions (ConfigOptions opts)
 Change the connection options.
 
CollectionSpace CreateCollectionSpace (string csName)
 Create the named collection space with default SDB_PAGESIZE_64K.
 
CollectionSpace CreateCollectionSpace (string csName, int pageSize)
 Create the named collection space.
 
CollectionSpace CreateCollectionSpace (string csName, BsonDocument options)
 Create the named collection space.
 
void DropCollectionSpace (string csName)
 Remove the named collection space.
 
CollectionSpace GetCollectionSpace (string csName)
 Get the named collection space.
 
CollectionSpace GetCollecitonSpace (string csName)
 Get the named collection space.
 
bool IsCollectionSpaceExist (string csName)
 Verify the existence of collection space.
 
DBCursor ListCollectionSpaces ()
 List all the collecion space.
 
DBCursor ListCollections ()
 List all the collecion space.
 
DBCursor Exec (string sql)
 Executing SQL command.
 
void ExecUpdate (string sql)
 Executing SQL command for updating.
 
DBCursor GetSnapshot (int snapType, BsonDocument matcher, BsonDocument selector, BsonDocument orderBy)
 Get the snapshots of specified type.
 
DBCursor GetSnapshot (int snapType, BsonDocument matcher, BsonDocument selector, BsonDocument orderBy, BsonDocument hint)
 Get the snapshots of specified type.
 
DBCursor GetSnapshot (int snapType, BsonDocument matcher, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows)
 Get the snapshots of specified type.
 
DBCursor GetList (int listType, BsonDocument matcher, BsonDocument selector, BsonDocument orderBy, BsonDocument hint, long skipRows, long returnRows)
 Get the informations of specified type.
 
DBCursor GetList (int listType, BsonDocument matcher, BsonDocument selector, BsonDocument orderBy)
 Get the informations of specified type.
 
DBCursor GetList (int listType)
 Get the informations of specified type.
 
void ResetSnapshot (BsonDocument options)
 Reset the snapshot.
 
void BackupOffline (BsonDocument options)
 Backup the whole database or specifed replica group.
 
void Backup (BsonDocument options)
 Backup database.
 
DBCursor ListBackup (BsonDocument options, BsonDocument matcher, BsonDocument selector, BsonDocument orderBy)
 List the backups.
 
void RemoveBackup (BsonDocument options)
 Remove the backups.
 
DBCursor ListTasks (BsonDocument matcher, BsonDocument selector, BsonDocument orderBy, BsonDocument hint)
 List the tasks.
 
void WaitTasks (List< long > taskIDs)
 Wait the tasks to finish.
 
void CancelTask (long taskID, bool isAsync)
 Cancel the specified task.
 
void SetSessionAttr (BsonDocument options)
 Set the attributes of the session.
 
BsonDocument GetSessionAttr ()
 Get the attributes of the current session from the local cache if possible.
 
BsonDocument GetSessionAttr (bool useCache)
 Get the attributes of the current session.
 
void CloseAllCursors ()
 Close all the cursors created in current connection, we can't use those cursors to get data from db engine again, but, there are some data cache in local.
 
void Interrupt ()
 Send an interrupt message to engine.
 
void 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 throw exception.
 
bool IsDomainExist (string dmName)
 Verify the existence of domain in current database.
 
bool IsReplicaGroupExist (string groupName)
 Verify the group in current database or not.
 
bool IsReplicaGroupExist (int groupId)
 Verify the group in current database or not.
 
Domain CreateDomain (string domainName, BsonDocument options)
 Create a domain.
 
void DropDomain (string domainName)
 Drop a domain.
 
Domain GetDomain (string domainName)
 Get the specified domain.
 
DBCursor ListDomains (BsonDocument matcher, BsonDocument selector, BsonDocument orderBy, BsonDocument hint)
 List domains.
 
DBCursor ListReplicaGroups ()
 Get all the groups.
 
ReplicaGroup GetReplicaGroup (string groupName)
 Get the ReplicaGroup by name.
 
ReplicaGroup GetReplicaGroup (int groupID)
 Get the ReplicaGroup by ID.
 
ReplicaGroup CreateReplicaGroup (string groupName)
 Create the ReplicaGroup with given name.
 
void RemoveReplicaGroup (string groupName)
 Remove the ReplicaGroup with given name.
 
void CreateReplicaCataGroup (string hostName, int port, string dbpath, BsonDocument configure)
 Create the Replica Catalog Group with given options.
 
ReplicaGroup ActivateReplicaGroup (string groupName)
 Activate the ReplicaGroup with given name.
 
DataCenter GetDC ()
 Get data center.
 
void Sync (BsonDocument options)
 Sync the current database.
 
void Sync ()
 Sync the current database.
 
void Analyze (BsonDocument options)
 Analyze collection or index to collect statistics information.
 
void Analyze ()
 
void UpdateConfig (BsonDocument configs, BsonDocument options)
 Force the node to update configs online.
 
void DeleteConfig (BsonDocument configs, BsonDocument options)
 Force the node to update configs online.
 
void InvalidateCache (BsonDocument options)
 Clear the cache of the nodes (data/coord node).
 
void RenameCollectionSpace (String oldName, String newName)
 Rename the collection space.
 

Static Public Member Functions

static void InitClient (ClientOptions options)
 Initialize the configuration options for client.
 

Properties

IConnection Connection [get]
 Return the connection object.
 
ServerAddress ServerAddr [get, set]
 Return or group the remote server address.
 

Detailed Description

Database operation interfaces of admin.

Constructor & Destructor Documentation

SequoiaDB.Sequoiadb.Sequoiadb ( )
inline

Default Constructor.

Server address "127.0.0.1 : 11810"

SequoiaDB.Sequoiadb.Sequoiadb ( string  connString)
inline

Constructor.

Parameters
connStringRemote server address "IP : Port" or "IP"(port is 11810)
SequoiaDB.Sequoiadb.Sequoiadb ( List< string >  connStrings)
inline

Constructor.

Parameters
connStringsRemote server addresses "IP : Port"
SequoiaDB.Sequoiadb.Sequoiadb ( string  host,
int  port 
)
inline

Constructor.

Parameters
addrIP address
portPort

Member Function Documentation

ReplicaGroup SequoiaDB.Sequoiadb.ActivateReplicaGroup ( string  groupName)
inline

Activate the ReplicaGroup with given name.

Parameters
groupNameThe group name
Returns
The ReplicaGroup has been activated if succeed or null if fail
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.Analyze ( BsonDocument  options)
inline

Analyze collection or index to collect statistics information.

Parameters
[in]optionsThe 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,
                  ...
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.Analyze ( )
inline
void SequoiaDB.Sequoiadb.Backup ( BsonDocument  options)
inline

Backup database.

Parameters
optionsContains 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}
  • GroupName : The replica groups which to be backuped
  • Path : The backup path, if not assign, use the backup path assigned in configuration file
  • Name : The name for the backup
  • 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
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.BackupOffline ( BsonDocument  options)
inline

Backup the whole database or specifed replica group.

Parameters
optionsContains 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}
  • GroupName : The replica groups which to be backuped
  • Path : The backup path, if not assign, use the backup path assigned in configuration file
  • Name : The name for the backup
  • 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
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
Deprecated:
Rename to "Backup".
void SequoiaDB.Sequoiadb.CancelTask ( long  taskIDs,
bool  isAsync 
)
inline

Cancel the specified task.

Parameters
taskIDThe task id
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.ChangeConnectionOptions ( ConfigOptions  opts)
inline

Change the connection options.

Returns
void
Parameters
optsThe connection options
Exceptions
System.Exception
void SequoiaDB.Sequoiadb.CloseAllCursors ( )
inline

Close all the cursors created in current connection, we can't use those cursors to get data from db engine again, but, there are some data cache in local.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.Connect ( )
inline

Connect to remote Sequoiadb database server.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.Connect ( string  username,
string  password 
)
inline

Connect to remote Sequoiadb database server Sequoiadb connection user name Sequoiadb connection password.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.Connect ( string  username,
string  password,
ConfigOptions  options 
)
inline

Connect to remote Sequoiadb database server Sequoiadb connection user name Sequoiadb connection password The options for connection.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
CollectionSpace SequoiaDB.Sequoiadb.CreateCollectionSpace ( string  csName)
inline

Create the named collection space with default SDB_PAGESIZE_64K.

Parameters
csNameThe collection space name
Returns
The collection space handle
Exceptions
SequoiaDB.BaseException
System.Exception
CollectionSpace SequoiaDB.Sequoiadb.CreateCollectionSpace ( string  csName,
int  pageSize 
)
inline

Create the named collection space.

Parameters
csNameThe collection space name
pageSizeThe Page Size as below
  SDB_PAGESIZE_4K
  SDB_PAGESIZE_8K
  SDB_PAGESIZE_16K
  SDB_PAGESIZE_32K
  SDB_PAGESIZE_64K
  SDB_PAGESIZE_DEFAULT
Returns
The collection space handle
Exceptions
SequoiaDB.BaseException
System.Exception
CollectionSpace SequoiaDB.Sequoiadb.CreateCollectionSpace ( string  csName,
BsonDocument  options 
)
inline

Create the named collection space.

Parameters
csNameThe collection space name
optionsThe 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
Returns
The collection space handle
Exceptions
SequoiaDB.BaseException
System.Exception
Domain SequoiaDB.Sequoiadb.CreateDomain ( string  domainName,
BsonDocument  options 
)
inline

Create a domain.

Parameters
domainNameThe name of the domain
optionsThe options for the domain. The options are as below:
Group:     the list of replica groups' names which the domain is going to contain.
           eg: { "Group": [ "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" }
Returns
The created Domain instance
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.CreateReplicaCataGroup ( string  hostName,
int  port,
string  dbpath,
BsonDocument  configure 
)
inline

Create the Replica Catalog Group with given options.

Parameters
hostNameThe host name
portThe port
dbpathThe database path
configureThe configure options
Exceptions
SequoiaDB.BaseException
System.Exception
ReplicaGroup SequoiaDB.Sequoiadb.CreateReplicaGroup ( string  groupName)
inline

Create the ReplicaGroup with given name.

Parameters
groupNameThe group name
Returns
The ReplicaGroup has been created succefully
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.CreateUser ( string  username,
string  password 
)
inline

Add an user in current database Sequoiadb connection user name Sequoiadb connection password.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.DeleteConfig ( BsonDocument  configs,
BsonDocument  options 
)
inline

Force the node to update configs online.

Parameters
configsthe specific configuration parameters to update
optionsThe control options:(Only take effect in coordinate nodes) GroupID:INT32, GroupName:String, NodeID:INT32, HostName:String, svcname:String, ...
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
SequoiaDB.Sequoiadb.Disconnect ( )
inline

Disconnect the remote server.

Returns
void
Exceptions
System.Exception
void SequoiaDB.Sequoiadb.DropCollectionSpace ( string  csName)
inline

Remove the named collection space.

Parameters
csNameThe collection space name
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.DropDomain ( string  domainName)
inline

Drop a domain.

Parameters
domainNameThe name of the domain
Returns
The created Domain instance
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.Exec ( string  sql)
inline

Executing SQL command.

Parameters
sqlSQL command
Returns
The DBCursor of matching documents or null
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.ExecUpdate ( string  sql)
inline

Executing SQL command for updating.

Parameters
sqlSQL command
Exceptions
SequoiaDB.BaseException
System.Exception
CollectionSpace SequoiaDB.Sequoiadb.GetCollecitonSpace ( string  csName)
inline

Get the named collection space.

Parameters
csNameThe collection space name
Returns
The CollectionSpace handle
Note
If collection space not exit, throw BaseException
Exceptions
SequoiaDB.BaseException
System.Exception
Deprecated:
Rename to "GetCollectionSpace".
CollectionSpace SequoiaDB.Sequoiadb.GetCollectionSpace ( string  csName)
inline

Get the named collection space.

Parameters
csNameThe collection space name
Returns
The CollectionSpace handle
Note
If collection space not exit, throw BaseException
Exceptions
SequoiaDB.BaseException
System.Exception
DataCenter SequoiaDB.Sequoiadb.GetDC ( )
inline

Get data center.

Returns
The ReplicaGroup has been activated if succeed or null if fail
Exceptions
SequoiaDB.BaseException
System.Exception
Domain SequoiaDB.Sequoiadb.GetDomain ( string  domainName)
inline

Get the specified domain.

Parameters
domainNameThe name of the domain
Returns
The created Domain instance
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.GetList ( int  listType,
BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint,
long  skipRows,
long  returnRows 
)
inline

Get the informations of specified type.

Parameters
listTypeThe specified type as below:
SDBConst.SDB_LIST_CONTEXTS
SDBConst.SDB_LIST_CONTEXTS_CURRENT
SDBConst.SDB_LIST_SESSIONS
SDBConst.SDB_LIST_SESSIONS_CURRENT
SDBConst.SDB_LIST_COLLECTIONS
SDBConst.SDB_LIST_COLLECTIONSPACES
SDBConst.SDB_LIST_STORAGEUNITS
SDBConst.SDB_LIST_GROUPS
SDBConst.SDB_LIST_STOREPROCEDURES
SDBConst.SDB_LIST_DOMAINS
SDBConst.SDB_LIST_TASKS
SDBConst.SDB_LIST_TRANSACTIONS
SDBConst.SDB_LIST_TRANSACTIONS_CURRENT
SDBConst.SDB_LIST_SVCTASKS
SDBConst.SDB_LIST_SEQUENCES
SDBConst.SDB_LIST_USERS
SDBConst.SDB_LIST_BACKUPS
matcherThe matching condition or null
selectorThe selective rule or null
orderByThe ordered rule or null
hintThe options provided for specific list type. Reserved.
skipRowsSkip the first skipRows documents.
returnRowsOnly return returnRows documents. -1 means return all matched results.
Returns
A DBCursor of all the fitted objects or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.GetList ( int  listType,
BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy 
)
inline

Get the informations of specified type.

Parameters
listTypeThe specified type as below:
SDBConst.SDB_LIST_CONTEXTS
SDBConst.SDB_LIST_CONTEXTS_CURRENT
SDBConst.SDB_LIST_SESSIONS
SDBConst.SDB_LIST_SESSIONS_CURRENT
SDBConst.SDB_LIST_COLLECTIONS
SDBConst.SDB_LIST_COLLECTIONSPACES
SDBConst.SDB_LIST_STORAGEUNITS
SDBConst.SDB_LIST_GROUPS
SDBConst.SDB_LIST_STOREPROCEDURES
SDBConst.SDB_LIST_DOMAINS
SDBConst.SDB_LIST_TASKS
SDBConst.SDB_LIST_TRANSACTIONS
SDBConst.SDB_LIST_TRANSACTIONS_CURRENT
SDBConst.SDB_LIST_SVCTASKS
SDBConst.SDB_LIST_SEQUENCES
SDBConst.SDB_LIST_USERS
SDBConst.SDB_LIST_BACKUPS
matcherThe matching condition or null
selectorThe selective rule or null
orderByThe ordered rule or null
Returns
A DBCursor of all the fitted objects or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.GetList ( int  listType)
inline

Get the informations of specified type.

Parameters
listTypeThe specified type as below:
SDBConst.SDB_LIST_CONTEXTS
SDBConst.SDB_LIST_CONTEXTS_CURRENT
SDBConst.SDB_LIST_SESSIONS
SDBConst.SDB_LIST_SESSIONS_CURRENT
SDBConst.SDB_LIST_COLLECTIONS
SDBConst.SDB_LIST_COLLECTIONSPACES
SDBConst.SDB_LIST_STORAGEUNITS
SDBConst.SDB_LIST_GROUPS
SDBConst.SDB_LIST_STOREPROCEDURES
SDBConst.SDB_LIST_DOMAINS
SDBConst.SDB_LIST_TASKS
SDBConst.SDB_LIST_TRANSACTIONS
SDBConst.SDB_LIST_TRANSACTIONS_CURRENT
SDBConst.SDB_LIST_SVCTASKS
SDBConst.SDB_LIST_SEQUENCES
SDBConst.SDB_LIST_USERS
SDBConst.SDB_LIST_BACKUPS
Returns
A DBCursor of all the fitted objects or null
Exceptions
SequoiaDB.BaseException
System.Exception
ReplicaGroup SequoiaDB.Sequoiadb.GetReplicaGroup ( string  groupName)
inline

Get the ReplicaGroup by name.

Parameters
groupNameThe group name
Returns
The fitted ReplicaGroup or null
Exceptions
SequoiaDB.BaseException
System.Exception
ReplicaGroup SequoiaDB.Sequoiadb.GetReplicaGroup ( int  groupID)
inline

Get the ReplicaGroup by ID.

Parameters
groupIDThe group ID
Returns
The fitted ReplicaGroup or null
Exceptions
SequoiaDB.BaseException
System.Exception
BsonDocument SequoiaDB.Sequoiadb.GetSessionAttr ( )
inline

Get the attributes of the current session from the local cache if possible.

Returns
BsonDocument or null while no session attributes returned
Exceptions
SequoiaDB.BaseException
System.Exception
BsonDocument SequoiaDB.Sequoiadb.GetSessionAttr ( bool  useCache)
inline

Get the attributes of the current session.

Parameters
useCacheWhether to use cache in local.
Returns
BsonDocument or null while no session attributes returned
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.GetSnapshot ( int  snapType,
BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy 
)
inline

Get the snapshots of specified type.

Parameters
snapTypeThe specified type as below:
SDBConst.SDB_SNAP_CONTEXTS
SDBConst.SDB_SNAP_CONTEXTS_CURRENT
SDBConst.SDB_SNAP_SESSIONS
SDBConst.SDB_SNAP_SESSIONS_CURRENT
SDBConst.SDB_SNAP_COLLECTIONS
SDBConst.SDB_SNAP_COLLECTIONSPACES
SDBConst.SDB_SNAP_DATABASE
SDBConst.SDB_SNAP_SYSTEM
SDBConst.SDB_SNAP_CATALOG
SDBConst.SDB_SNAP_TRANSACTIONS
SDBConst.SDB_SNAP_TRANSACTIONS_CURRENT
SDBConst.SDB_SNAP_ACCESSPLANS
SDBConst.SDB_SNAP_HEALTH
SDBConst.SDB_SNAP_CONFIGS
SDBConst.SDB_SNAP_SVCTASKS
SDBConst.SDB_SNAP_SEQUENCES
SDBConst.SDB_SNAP_QUERIES
SDBConst.SDB_SNAP_LATCHWAITS
SDBConst.SDB_SNAP_LOCKWAITS
matcherThe matching condition or null
selectorThe selective rule or null
orderByThe ordered rule or null
Returns
A DBCursor of all the fitted objects or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.GetSnapshot ( int  snapType,
BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint 
)
inline

Get the snapshots of specified type.

Parameters
snapTypeThe specified type as below:
SDBConst.SDB_SNAP_CONTEXTS
SDBConst.SDB_SNAP_CONTEXTS_CURRENT
SDBConst.SDB_SNAP_SESSIONS
SDBConst.SDB_SNAP_SESSIONS_CURRENT
SDBConst.SDB_SNAP_COLLECTIONS
SDBConst.SDB_SNAP_COLLECTIONSPACES
SDBConst.SDB_SNAP_DATABASE
SDBConst.SDB_SNAP_SYSTEM
SDBConst.SDB_SNAP_CATALOG
SDBConst.SDB_SNAP_TRANSACTIONS
SDBConst.SDB_SNAP_TRANSACTIONS_CURRENT
SDBConst.SDB_SNAP_ACCESSPLANS
SDBConst.SDB_SNAP_HEALTH
SDBConst.SDB_SNAP_CONFIGS
SDBConst.SDB_SNAP_SVCTASKS
SDBConst.SDB_SNAP_SEQUENCES
SDBConst.SDB_SNAP_QUERIES
SDBConst.SDB_SNAP_LATCHWAITS
SDBConst.SDB_SNAP_LOCKWAITS
matcherThe matching condition or null
selectorThe selective rule or null
orderByThe ordered rule or null
hintThe options provided for specific snapshot type or null, Format:{ '$Options': { <options> } }
Returns
A DBCursor of all the fitted objects or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.GetSnapshot ( int  snapType,
BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint,
long  skipRows,
long  returnRows 
)
inline

Get the snapshots of specified type.

Parameters
snapTypeThe specified type as below:
SDBConst.SDB_SNAP_CONTEXTS
SDBConst.SDB_SNAP_CONTEXTS_CURRENT
SDBConst.SDB_SNAP_SESSIONS
SDBConst.SDB_SNAP_SESSIONS_CURRENT
SDBConst.SDB_SNAP_COLLECTIONS
SDBConst.SDB_SNAP_COLLECTIONSPACES
SDBConst.SDB_SNAP_DATABASE
SDBConst.SDB_SNAP_SYSTEM
SDBConst.SDB_SNAP_CATALOG
SDBConst.SDB_SNAP_TRANSACTIONS
SDBConst.SDB_SNAP_TRANSACTIONS_CURRENT
SDBConst.SDB_SNAP_ACCESSPLANS
SDBConst.SDB_SNAP_HEALTH
SDBConst.SDB_SNAP_CONFIGS
SDBConst.SDB_SNAP_SVCTASKS
SDBConst.SDB_SNAP_SEQUENCES
SDBConst.SDB_SNAP_QUERIES
SDBConst.SDB_SNAP_LATCHWAITS
SDBConst.SDB_SNAP_LOCKWAITS
matcherThe matching condition or null
selectorThe selective rule or null
orderByThe ordered rule or null
hintThe options provided for specific snapshot type or null, Format:{ '$Options': { <options> } }
skipRowsSkip the first numToSkip documents, never skip if this parameter is 0
returnRowsReturn the specified amount of documents, when returnRows is 0, return nothing, when returnRows is -1, return all the documents
Returns
A DBCursor of all the fitted objects or null
Exceptions
SequoiaDB.BaseException
System.Exception
SequoiaDB.Sequoiadb.InitClient ( ClientOptions  options)
inlinestatic

Initialize the configuration options for client.

Parameters
optionsThe configuration options for client
void SequoiaDB.Sequoiadb.Interrupt ( )
inline

Send an interrupt message to engine.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.InterruptOperation ( )
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 throw exception.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.InvalidateCache ( BsonDocument  options)
inline

Clear the cache of the nodes (data/coord node).

Parameters
optionsThe control options:(Only take effect in coordinate nodes)
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"}.
...
Note
About the parameter 'options', please reference to the official website(www.sequoiadb.com) and then search "命令位置参数" for more details.
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
bool SequoiaDB.Sequoiadb.IsCollectionSpaceExist ( string  csName)
inline

Verify the existence of collection space.

Parameters
csNameThe collection space name
Returns
True if existed or False if not existed
Exceptions
SequoiaDB.BaseException
System.Exception
bool SequoiaDB.Sequoiadb.IsDomainExist ( string  dmName)
inline

Verify the existence of domain in current database.

Parameters
dmNameThe domain name
Returns
True if existed or False if not existed
Exceptions
SequoiaDB.BaseException
System.Exception
bool SequoiaDB.Sequoiadb.IsReplicaGroupExist ( string  groupName)
inline

Verify the group in current database or not.

Parameters
groupNameThe name of the group
Returns
True if existed or False if not existed
bool SequoiaDB.Sequoiadb.IsReplicaGroupExist ( int  groupId)
inline

Verify the group in current database or not.

Parameters
groupIdThe id of the group
Returns
True if existed or False if not existed
bool SequoiaDB.Sequoiadb.IsValid ( )
inline

Judge wether the connection is is valid or not.

Returns
If the connection is valid, return true
DBCursor SequoiaDB.Sequoiadb.ListBackup ( BsonDocument  options,
BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy 
)
inline

List the backups.

Parameters
optionsContains 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":["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 asigned 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.
matcherThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
Returns
the DBCursor of the backup or null while having no backup infonation
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.ListCollections ( )
inline

List all the collecion space.

Returns
A DBCursor of all the collection or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.ListCollectionSpaces ( )
inline

List all the collecion space.

Returns
A DBCursor of all the collection space or null
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.ListDomains ( BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint 
)
inline

List domains.

Parameters
matcherThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified 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 null, database automatically match the optimal index to scan data.
Returns
the cursor of the result.
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.ListReplicaGroups ( )
inline

Get all the groups.

Returns
A cursor of all the groups
Exceptions
SequoiaDB.BaseException
System.Exception
DBCursor SequoiaDB.Sequoiadb.ListTasks ( BsonDocument  matcher,
BsonDocument  selector,
BsonDocument  orderBy,
BsonDocument  hint 
)
inline

List the tasks.

Parameters
matcherThe matching rule, return all the documents if null
selectorThe selective rule, return the whole document if null
orderByThe ordered rule, never sort if null
hintSpecified 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 null, database automatically match the optimal index to scan data.
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.RemoveBackup ( BsonDocument  options)
inline

Remove the backups.

Parameters
optionsContains configuration information for removing 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 asigned 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.
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
ReplicaGroup SequoiaDB.Sequoiadb.RemoveReplicaGroup ( string  groupName)
inline

Remove the ReplicaGroup with given name.

Parameters
groupNameThe group name
Exceptions
SequoiaDB.BaseException
System.Exception
Note
We can't remove a replica group which has data
void SequoiaDB.Sequoiadb.RemoveUser ( string  username,
string  password 
)
inline

Remove the user from current database Sequoiadb connection user name Sequoiadb connection password.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.RenameCollectionSpace ( String  oldName,
String  newName 
)
inline

Rename the collection space.

Parameters
oldNameThe original name of current collection space.
newNameThe new name of current collection space.
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.ResetSnapshot ( BsonDocument  options)
inline

Reset the snapshot.

Parameters
[in]optionsThe control options:
Type            : (String) Specify the snapshot type to be reset(default 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,
                  ...
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.SetSessionAttr ( BsonDocument  options)
inline

Set the attributes of the session.

Parameters
optionsThe 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.
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.Sync ( BsonDocument  options)
inline

Sync the current database.

Parameters
[in]optionsThe 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,
...
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.Sync ( )
inline

Sync the current database.

Analyze all collections and indexes to collect statistics information.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.TransactionBegin ( )
inline

Begin the database transaction.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.TransactionCommit ( )
inline

Commit the database transaction.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.TransactionRollback ( )
inline

Rollback the database transaction.

Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.UpdateConfig ( BsonDocument  configs,
BsonDocument  options 
)
inline

Force the node to update configs online.

Parameters
configsthe specific configuration parameters to update. Please reference here for more detail.
optionsThe control options:(Only take effect in coordinate nodes). Please reference here for more detail.
Returns
void
Exceptions
SequoiaDB.BaseException
System.Exception
void SequoiaDB.Sequoiadb.WaitTasks ( List< long >  taskIDs)
inline

Wait the tasks to finish.

Parameters
taskIDsThe list of task id
Exceptions
SequoiaDB.BaseException
System.Exception

Property Documentation

SequoiaDB.Sequoiadb.Connection
get

Return the connection object.

Returns
The Connection
SequoiaDB.Sequoiadb.ServerAddr
getset

Return or group the remote server address.

Returns
The ServerAddress

The documentation for this class was generated from the following file: