public class Sequoiadb extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static class |
Sequoiadb.Builder
The builder of Sequoiadb.
|
static class |
Sequoiadb.SptEvalResult
Class for executing stored procedure result.
|
static class |
Sequoiadb.SptReturnType |
Modifier and Type | Field and Description |
---|---|
static String |
CATALOG_GROUP_NAME |
static int |
FMP_FUNC_TYPE_C |
static int |
FMP_FUNC_TYPE_INVALID |
static int |
FMP_FUNC_TYPE_JAVA |
static int |
FMP_FUNC_TYPE_JS |
static int |
SDB_LIST_BACKUPS
List of backups
|
static int |
SDB_LIST_CL_IN_DOMAIN |
static int |
SDB_LIST_COLLECTIONS
List of collections
|
static int |
SDB_LIST_COLLECTIONSPACES
List of collection spaces
|
static int |
SDB_LIST_CONTEXTS
List of all the contexts of all the sessions
|
static int |
SDB_LIST_CONTEXTS_CURRENT
List of the contexts of current session
|
static int |
SDB_LIST_CS_IN_DOMAIN |
static int |
SDB_LIST_DATASOURCES
List of data source
|
static int |
SDB_LIST_DOMAINS
List of domains
|
static int |
SDB_LIST_GROUPS
List of all the groups
|
static int |
SDB_LIST_SEQUENCES
List of sequences
|
static int |
SDB_LIST_SESSIONS
List of all the sessions
|
static int |
SDB_LIST_SESSIONS_CURRENT
List of current session
|
static int |
SDB_LIST_STORAGEUNITS
List of strorage units
|
static int |
SDB_LIST_STOREPROCEDURES
List of store procedures
|
static int |
SDB_LIST_SVCTASKS
List of service tasks
|
static int |
SDB_LIST_TASKS
List of tasks
|
static int |
SDB_LIST_TRANSACTIONS
List of all the transactions of all the sessions
|
static int |
SDB_LIST_TRANSACTIONS_CURRENT
List of all transactions of current session
|
static int |
SDB_LIST_USERS
List of users
|
static int |
SDB_PAGESIZE_16K
specified the package size of the collections in current collection space to be 16K
|
static int |
SDB_PAGESIZE_32K
specified the package size of the collections in current collection space to be 32K
|
static int |
SDB_PAGESIZE_4K
specified the package size of the collections in current collection space to be 4K
|
static int |
SDB_PAGESIZE_64K
specified the package size of the collections in current collection space to be 64K
|
static int |
SDB_PAGESIZE_8K
specified the package size of the collections in current collection space to be 8K
|
static int |
SDB_PAGESIZE_DEFAULT
0 means using database's default pagesize, it 64k now
|
static int |
SDB_SNAP_ACCESSPLANS
Snapshot of access plans
|
static int |
SDB_SNAP_CATALOG
Snapshot of catalog
|
static int |
SDB_SNAP_COLLECTIONS
Snapshot of collections
|
static int |
SDB_SNAP_COLLECTIONSPACES
Snapshot of collection spaces
|
static int |
SDB_SNAP_CONFIGS
Snapshot of configs
|
static int |
SDB_SNAP_CONTEXTS
Snapshot of all the contexts of all the sessions
|
static int |
SDB_SNAP_CONTEXTS_CURRENT
Snapshot of the contexts of current session
|
static int |
SDB_SNAP_DATABASE
Snapshot of database
|
static int |
SDB_SNAP_HEALTH
Snapshot of health
|
static int |
SDB_SNAP_INDEXSTATS
Snapshot of index statistics
|
static int |
SDB_SNAP_LATCHWAITS
Snapshot of latch waits
|
static int |
SDB_SNAP_LOCKWAITS
Snapshot of lock waits
|
static int |
SDB_SNAP_QUERIES
Snapshot of queries
|
static int |
SDB_SNAP_SEQUENCES
Snapshot of sequences
|
static int |
SDB_SNAP_SESSIONS
Snapshot of all the sessions
|
static int |
SDB_SNAP_SESSIONS_CURRENT
Snapshot of current session
|
static int |
SDB_SNAP_SVCTASKS
Snapshot of service tasks
|
static int |
SDB_SNAP_SYSTEM
Snapshot of system
|
static int |
SDB_SNAP_TRANSACTIONS
Snapshot of all the transactions of all the sessions
|
static int |
SDB_SNAP_TRANSACTIONS_CURRENT
Snapshot of all transactions of current session
|
static int |
SDB_SNAP_TRANSDEADLOCK
Snapshot of transaction deadlock
|
static int |
SDB_SNAP_TRANSWAITS
Snapshot of transaction waits
|
Constructor and Description |
---|
Sequoiadb(List<String> connStrings,
String username,
String password,
ConfigOptions options)
Use a random valid address to connect to database.
|
Sequoiadb(String host,
int port,
String username,
String password) |
Sequoiadb(String host,
int port,
String username,
String password,
ConfigOptions options) |
Sequoiadb(String connString,
String username,
String password) |
Sequoiadb(String connString,
String username,
String password,
ConfigOptions options) |
Modifier and Type | Method and Description |
---|---|
void |
activateReplicaGroup(String rgName)
Active replica group by name.
|
void |
analyze()
Analyze all collections and indexes to collect statistics information
|
void |
analyze(BSONObject options)
Analyze collection or index to collect statistics information
|
void |
backup(BSONObject options)
Backup database.
|
void |
beginTransaction()
Begin the transaction.
|
static Sequoiadb.Builder |
builder()
Get a builder to create Sequoiadb instance.
|
void |
cancelTask(long taskID,
boolean isAsync)
Cancel the specified task.
|
protected void |
cleanRequestBuff() |
void |
close()
Close the connection.
|
void |
closeAllCursors()
Close all the cursors created in current connection, we can't use those cursors to get data
again.
|
void |
commit()
Commit the transaction.
|
CollectionSpace |
createCollectionSpace(String csName)
Create the named collection space with default SDB_PAGESIZE_64K.
|
CollectionSpace |
createCollectionSpace(String csName,
BSONObject options)
Create collection space.
|
CollectionSpace |
createCollectionSpace(String csName,
int pageSize)
Create collection space.
|
DataSource |
createDataSource(String dataSourceName,
String addresses,
String user,
String password,
String type,
BSONObject option)
Create data source.
|
Domain |
createDomain(String domainName,
BSONObject options)
Create a domain.
|
void |
createReplicaCataGroup(String hostName,
int port,
String dbPath,
BSONObject options)
Create the replica Catalog group with the given options.
|
ReplicaGroup |
createReplicaGroup(String rgName)
Create replica group by name.
|
DBSequence |
createSequence(String seqName)
Create a sequence.
|
DBSequence |
createSequence(String seqName,
BSONObject options)
Create a sequence with the specified options.
|
void |
createUser(String username,
String password)
Create an user in current database.
|
void |
crtJSProcedure(String code)
Create a storage procedure.
|
void |
deleteConfig(BSONObject configs,
BSONObject options)
Force the node to delete configs online.
|
void |
dropCollectionSpace(String csName)
Remove the named collection space.
|
void |
dropCollectionSpace(String csName,
BSONObject options)
Remove the named collection space.
|
void |
dropDataSource(String dataSourceName)
Drop data source.
|
void |
dropDomain(String domainName)
Drop a domain.
|
void |
dropSequence(String seqName)
Drop the specified sequence.
|
Sequoiadb.SptEvalResult |
evalJS(String code)
Eval javascript code.
|
DBCursor |
exec(String sql)
Execute sql in database.
|
void |
execUpdate(String sql)
Execute sql in database.
|
void |
flushConfigure(BSONObject options)
Flush the options to configuration file.
|
void |
forceSession(long sessionID)
Stop the specified session's current operation and terminate it.
|
void |
forceSession(long sessionID,
BSONObject option)
Stop the specified session's current operation and terminate it.
|
ByteOrder |
getByteOrder() |
ArrayList<String> |
getCollectionNames()
Get all the collection names.
|
CollectionSpace |
getCollectionSpace(String csName)
Get the named collection space.
|
ArrayList<String> |
getCollectionSpaceNames()
Get all the collection space names.
|
com.sequoiadb.net.ConnectionProxy |
getConnProxy()
Get the connection proxy object, which can be used to update the configuration
of the connection object.
|
int |
getCurrentCacheSize()
Reserve.
|
DataSource |
getDataSource(String dataSourceName)
Get data source.
|
Domain |
getDomain(String domainName)
Get the specified domain.
|
String |
getHost() |
String |
getIP() |
long |
getLastUseTime() |
DBCursor |
getList(int listType,
BSONObject query,
BSONObject selector,
BSONObject orderBy)
Get the information of specified type.
|
DBCursor |
getList(int listType,
BSONObject query,
BSONObject selector,
BSONObject orderBy,
BSONObject hint,
long skipRows,
long returnRows)
Get the information of specified type.
|
String |
getLocalAddress() |
String |
getNodeName() |
int |
getPort() |
String |
getRemoteAddress() |
ReplicaGroup |
getReplicaGroup(int rgId)
Get replica group by id.
|
ReplicaGroup |
getReplicaGroup(String rgName)
Get replica group by name.
|
ArrayList<String> |
getReplicaGroupNames()
Get all the replica groups' name.
|
ArrayList<String> |
getReplicaGroupsInfo()
Get the information of the replica groups.
|
DBSequence |
getSequence(String seqName)
Get the specified sequence.
|
BSONObject |
getSessionAttr()
Get the attributes of the current session from the local cache if possible.
|
BSONObject |
getSessionAttr(boolean useCache)
Get the attributes of the current session.
|
DBCursor |
getSnapshot(int snapType,
BSONObject matcher,
BSONObject selector,
BSONObject orderBy)
Get snapshot of the database.
|
DBCursor |
getSnapshot(int snapType,
BSONObject matcher,
BSONObject selector,
BSONObject orderBy,
BSONObject hint,
long skipRows,
long returnRows)
Get snapshot of the database.
|
ArrayList<String> |
getStorageUnits()
Get all the storage units.
|
static void |
initClient(ClientOptions options)
Initialize the global configuration of SequoiaDB driver.
|
void |
interrupt()
Send an interrupt message to engine.
|
void |
interruptOperation()
Send "INTERRUPT_SELF" message to engine to stop the current operation.
|
void |
invalidateCache(BSONObject options)
Clear the cache of the nodes (data/coord node).
|
boolean |
isClosed()
Whether the connection has been closed or not.
|
boolean |
isCollectionSpaceExist(String csName)
Verify the existence of collection space.
|
boolean |
isDataSourceExist(String dataSourceName)
Whether the data source exists or not.
|
boolean |
isDomainExist(String domainName)
Verify the existence of domain.
|
boolean |
isRelicaGroupExist(String rgName)
This interface will be deprecated, please use
isReplicaGroupExist(String) . |
boolean |
isReplicaGroupExist(int rgId)
whether the replica group exists in the database or not
|
boolean |
isReplicaGroupExist(String rgName)
whether the replica group exists in the database or not
|
boolean |
isValid()
Send a test message to database to test whether the connection is valid or not.
|
DBCursor |
listBackup(BSONObject options,
BSONObject matcher,
BSONObject selector,
BSONObject orderBy)
List the backups.
|
DBCursor |
listCollections()
Get all the collections.
|
DBCursor |
listCollectionSpaces()
Get all the collection spaces.
|
DBCursor |
listDataSources(BSONObject matcher,
BSONObject selector,
BSONObject orderBy,
BSONObject hint)
List data source.
|
DBCursor |
listDomains(BSONObject matcher,
BSONObject selector,
BSONObject orderBy,
BSONObject hint)
List domains.
|
DBCursor |
listProcedures(BSONObject condition)
List the storage procedures.
|
DBCursor |
listReplicaGroups()
List all the replica group.
|
DBCursor |
listTasks(BSONObject matcher,
BSONObject selector,
BSONObject orderBy,
BSONObject hint)
List the tasks.
|
void |
loadCollectionSpace(String csName,
BSONObject options) |
void |
msg(String message)
Send message to server.
|
void |
releaseResource()
Release the resource of the connection.
|
void |
removeBackup(BSONObject options)
Remove the backups.
|
void |
removeReplicaGroup(String rgName)
Remove replica group by name.
|
void |
removeUser(String username,
String password)
Remove the specified user from current database.
|
void |
renameCollectionSpace(String oldName,
String newName) |
void |
renameSequence(String oldName,
String newName)
Rename sequence.
|
void |
resetSnapshot()
Reset the snapshot.
|
void |
resetSnapshot(BSONObject options)
Reset the snapshot.
|
void |
rmProcedure(String name)
Remove a store procedure.
|
void |
rollback()
Rollback the transaction.
|
void |
setSessionAttr(BSONObject options)
Set the attributes of the current session.
|
void |
sync()
Sync the whole database to disk.
|
void |
sync(BSONObject options)
Sync the database to disk.
|
String |
toString() |
void |
unloadCollectionSpace(String csName,
BSONObject options) |
void |
updateConfig(BSONObject configs)
Force the node to update configs online.
|
void |
updateConfig(BSONObject configs,
BSONObject options)
Force the node to update configs online.
|
void |
waitTasks(long[] taskIDs)
Wait the tasks to finish.
|
public static final String CATALOG_GROUP_NAME
public static final int FMP_FUNC_TYPE_C
public static final int FMP_FUNC_TYPE_INVALID
public static final int FMP_FUNC_TYPE_JAVA
public static final int FMP_FUNC_TYPE_JS
public static final int SDB_LIST_BACKUPS
public static final int SDB_LIST_CL_IN_DOMAIN
public static final int SDB_LIST_COLLECTIONS
public static final int SDB_LIST_COLLECTIONSPACES
public static final int SDB_LIST_CONTEXTS
public static final int SDB_LIST_CONTEXTS_CURRENT
public static final int SDB_LIST_CS_IN_DOMAIN
public static final int SDB_LIST_DATASOURCES
public static final int SDB_LIST_DOMAINS
public static final int SDB_LIST_GROUPS
public static final int SDB_LIST_SEQUENCES
public static final int SDB_LIST_SESSIONS
public static final int SDB_LIST_SESSIONS_CURRENT
public static final int SDB_LIST_STORAGEUNITS
public static final int SDB_LIST_STOREPROCEDURES
public static final int SDB_LIST_SVCTASKS
public static final int SDB_LIST_TASKS
public static final int SDB_LIST_TRANSACTIONS
public static final int SDB_LIST_TRANSACTIONS_CURRENT
public static final int SDB_LIST_USERS
public static final int SDB_PAGESIZE_16K
public static final int SDB_PAGESIZE_32K
public static final int SDB_PAGESIZE_4K
public static final int SDB_PAGESIZE_64K
public static final int SDB_PAGESIZE_8K
public static final int SDB_PAGESIZE_DEFAULT
public static final int SDB_SNAP_ACCESSPLANS
public static final int SDB_SNAP_CATALOG
public static final int SDB_SNAP_COLLECTIONS
public static final int SDB_SNAP_COLLECTIONSPACES
public static final int SDB_SNAP_CONFIGS
public static final int SDB_SNAP_CONTEXTS
public static final int SDB_SNAP_CONTEXTS_CURRENT
public static final int SDB_SNAP_DATABASE
public static final int SDB_SNAP_HEALTH
public static final int SDB_SNAP_INDEXSTATS
public static final int SDB_SNAP_LATCHWAITS
public static final int SDB_SNAP_LOCKWAITS
public static final int SDB_SNAP_QUERIES
public static final int SDB_SNAP_SEQUENCES
public static final int SDB_SNAP_SESSIONS
public static final int SDB_SNAP_SESSIONS_CURRENT
public static final int SDB_SNAP_SVCTASKS
public static final int SDB_SNAP_SYSTEM
public static final int SDB_SNAP_TRANSACTIONS
public static final int SDB_SNAP_TRANSACTIONS_CURRENT
public static final int SDB_SNAP_TRANSDEADLOCK
public static final int SDB_SNAP_TRANSWAITS
public Sequoiadb(List<String> connStrings, String username, String password, ConfigOptions options) throws BaseException
connStrings
- The array of the coord's address.username
- The user's name of the account.password
- The password of the account.options
- The options for connection.BaseException
- If error happens.public Sequoiadb(String host, int port, String username, String password) throws BaseException
host
- the address of coordport
- the port of coordusername
- the user's name of the accountpassword
- the password of the accountBaseException
- SDB_NETWORK means network error, SDB_INVALIDARG means wrong address or the
address don't map to the hosts table.public Sequoiadb(String host, int port, String username, String password, ConfigOptions options) throws BaseException
host
- the address of coordport
- the port of coordusername
- the user's name of the accountpassword
- the password of the accountBaseException
- SDB_NETWORK means network error, SDB_INVALIDARG means wrong address or the
address don't map to the hosts table.public Sequoiadb(String connString, String username, String password) throws BaseException
connString
- remote server address "Host:Port"username
- the user's name of the accountpassword
- the password of the accountBaseException
- SDB_NETWORK means network error, SDB_INVALIDARG means wrong address or the
address don't map to the hosts tablepublic Sequoiadb(String connString, String username, String password, ConfigOptions options) throws BaseException
connString
- remote server address "Host:Port"username
- the user's name of the accountpassword
- the password of the accountoptions
- the options for connectionBaseException
- SDB_NETWORK means network error, SDB_INVALIDARG means wrong address or the
address don't map to the hosts table.public void activateReplicaGroup(String rgName) throws BaseException
rgName
- replica group nameBaseException
- If error happens.public void analyze() throws BaseException
BaseException
- If error happens.public void analyze(BSONObject options) throws BaseException
options
- The control options:(can be null)
BaseException
- If error happens.public void backup(BSONObject options) throws BaseException
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}
BaseException
- If error happens.public void beginTransaction() throws BaseException
BaseException
- If error happens.public static Sequoiadb.Builder builder()
public void cancelTask(long taskID, boolean isAsync) throws BaseException
taskID
- The task idisAsync
- The operation "cancel task" is async or not, "true" for async, "false" for sync.
Default sync.BaseException
- If error happens.protected void cleanRequestBuff()
public void close() throws BaseException
close
in interface Closeable
close
in interface AutoCloseable
BaseException
- If error happens.public void closeAllCursors() throws BaseException
BaseException
- If error happens.public void commit() throws BaseException
BaseException
- If error happens.public CollectionSpace createCollectionSpace(String csName) throws BaseException
csName
- The collection space nameBaseException
- If error happens.public CollectionSpace createCollectionSpace(String csName, BSONObject options) throws BaseException
csName
- The name of collection spaceoptions
- Contains configuration information for create collection space. The options are as
below:
BaseException
- If error happens.public CollectionSpace createCollectionSpace(String csName, int pageSize) throws BaseException
csName
- The name of collection spacepageSize
- The Page Size as below:
BaseException
- If error happens.public DataSource createDataSource(String dataSourceName, String addresses, String user, String password, String type, BSONObject option) throws BaseException
dataSourceName
- The data source nameaddresses
- The list of coord addresses for the target sequoiadb cluster, spearated by ','user
- User name of the data sourcepassword
- User password of the data sourcetype
- Data source type, default is "SequoiaDB"option
- Optional configuration option for create data source, as follows:
BaseException
- If error happens.public Domain createDomain(String domainName, BSONObject options) throws BaseException
domainName
- The name of the creating domainoptions
- The options for the domain. The options are as below:
BaseException
- If error happens.public void createReplicaCataGroup(String hostName, int port, String dbPath, BSONObject options)
hostName
- The host nameport
- The portdbPath
- The database pathoptions
- The configure optionsBaseException
- If error happens.public ReplicaGroup createReplicaGroup(String rgName) throws BaseException
rgName
- replica group's nameBaseException
- If error happens.public DBSequence createSequence(String seqName)
seqName
- The name of sequencepublic DBSequence createSequence(String seqName, BSONObject options)
seqName
- The name of sequenceoptions
- The options specified by user, details as bellow:
public void createUser(String username, String password) throws BaseException
username
- The connection user namepassword
- The connection passwordBaseException
- If error happens.public void crtJSProcedure(String code) throws BaseException
code
- The code of storage procedureBaseException
- If error happens.public void deleteConfig(BSONObject configs, BSONObject options) throws BaseException
configs
- The specific configuration parameters to deleteoptions
- Options The control options:(Only take effect in coordinate nodes) GroupID:INT32,
GroupName:String, NodeID:INT32, HostName:String, svcname:String, ...BaseException
- If error happens.public void dropCollectionSpace(String csName) throws BaseException
csName
- The collection space nameBaseException
- If error happens.public void dropCollectionSpace(String csName, BSONObject options) throws BaseException
csName
- The collection space nameoptions
- Contains configuration information for drop collection space. The options are as
below:
BaseException
- If error happens.public void dropDataSource(String dataSourceName) throws BaseException
dataSourceName
- The data source nameBaseException
- If error happens.public void dropDomain(String domainName) throws BaseException
domainName
- the name of the domainBaseException
- If error happens.public void dropSequence(String seqName)
seqName
- The name of sequencepublic Sequoiadb.SptEvalResult evalJS(String code) throws BaseException
code
- The javascript codeBaseException
- If error happens.public DBCursor exec(String sql) throws BaseException
sql
- the SQL commandBaseException
- If error happens.public void execUpdate(String sql) throws BaseException
sql
- the SQL command.BaseException
- If error happens.public void flushConfigure(BSONObject options) throws BaseException
options
- The param of flush, 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 behaviourBaseException
- If error happens.public void forceSession(long sessionID)
sessionID
- The ID of the session.public void forceSession(long sessionID, BSONObject option)
sessionID
- The ID of the session.option
- The control options, Please reference
here
for more detail.public ByteOrder getByteOrder()
public ArrayList<String> getCollectionNames() throws BaseException
BaseException
- If error happens.public CollectionSpace getCollectionSpace(String csName) throws BaseException
csName
- The collection space name.BaseException
- If error happens.public ArrayList<String> getCollectionSpaceNames() throws BaseException
BaseException
- If error happens.public com.sequoiadb.net.ConnectionProxy getConnProxy()
public int getCurrentCacheSize()
public DataSource getDataSource(String dataSourceName) throws BaseException
dataSourceName
- The data source nameBaseException
- If error happens.public Domain getDomain(String domainName) throws BaseException
domainName
- the name of the domainBaseException
- If the domain not exit, throw BaseException with the error
SDB_CAT_DOMAIN_NOT_EXIST.public String getHost()
public String getIP()
public long getLastUseTime()
public DBCursor getList(int listType, BSONObject query, BSONObject selector, BSONObject orderBy) throws BaseException
listType
- The list type as below:
SDB_LIST_CONTEXTS
SDB_LIST_CONTEXTS_CURRENT
SDB_LIST_SESSIONS
SDB_LIST_SESSIONS_CURRENT
SDB_LIST_COLLECTIONS
SDB_LIST_COLLECTIONSPACES
SDB_LIST_STORAGEUNITS
SDB_LIST_GROUPS
SDB_LIST_STOREPROCEDURES
SDB_LIST_DOMAINS
SDB_LIST_TASKS
SDB_LIST_TRANSACTIONS
SDB_LIST_TRANSACTIONS_CURRENT
SDB_LIST_SVCTASKS
SDB_LIST_SEQUENCES
SDB_LIST_USERS
SDB_LIST_BACKUPS
SDB_LIST_DATASOURCES
query
- The matching rule, match all the documents if null.selector
- The selective rule, return the whole document if null.orderBy
- The ordered rule, never sort if null.BaseException
- If error happens.public DBCursor getList(int listType, BSONObject query, BSONObject selector, BSONObject orderBy, BSONObject hint, long skipRows, long returnRows) throws BaseException
listType
- The list type as below:
SDB_LIST_CONTEXTS
SDB_LIST_CONTEXTS_CURRENT
SDB_LIST_SESSIONS
SDB_LIST_SESSIONS_CURRENT
SDB_LIST_COLLECTIONS
SDB_LIST_COLLECTIONSPACES
SDB_LIST_STORAGEUNITS
SDB_LIST_GROUPS
SDB_LIST_STOREPROCEDURES
SDB_LIST_DOMAINS
SDB_LIST_TASKS
SDB_LIST_TRANSACTIONS
SDB_LIST_TRANSACTIONS_CURRENT
SDB_LIST_SVCTASKS
SDB_LIST_SEQUENCES
SDB_LIST_USERS
SDB_LIST_BACKUPS
SDB_LIST_DATASOURCES
query
- The matching rule, match all the documents if null.selector
- The selective rule, return the whole document if null.orderBy
- The ordered rule, never sort if null.hint
- The options provided for specific list type. Reserved.skipRows
- Skip the first skipRows documents.returnRows
- Only return returnRows documents. -1 means return all matched results.BaseException
- If error happens.public String getLocalAddress()
public String getNodeName()
public int getPort()
public String getRemoteAddress()
public ReplicaGroup getReplicaGroup(int rgId) throws BaseException
rgId
- replica group idBaseException
- If error happens.public ReplicaGroup getReplicaGroup(String rgName) throws BaseException
rgName
- replica group's nameBaseException
- If error happens.public ArrayList<String> getReplicaGroupNames() throws BaseException
BaseException
- If error happens.public ArrayList<String> getReplicaGroupsInfo() throws BaseException
BaseException
- If error happens.public DBSequence getSequence(String seqName)
seqName
- The name of sequencepublic BSONObject getSessionAttr() throws BaseException
BaseException
- If error happens.public BSONObject getSessionAttr(boolean useCache) throws BaseException
useCache
- use the local cache or not.BaseException
- If error happens.public DBCursor getSnapshot(int snapType, BSONObject matcher, BSONObject selector, BSONObject orderBy) throws BaseException
snapType
- The snapshot type as below:
SDB_SNAP_CONTEXTS
SDB_SNAP_CONTEXTS_CURRENT
SDB_SNAP_SESSIONS
SDB_SNAP_SESSIONS_CURRENT
SDB_SNAP_COLLECTIONS
SDB_SNAP_COLLECTIONSPACES
SDB_SNAP_DATABASE
SDB_SNAP_SYSTEM
SDB_SNAP_CATALOG
SDB_SNAP_TRANSACTIONS
SDB_SNAP_TRANSACTIONS_CURRENT
SDB_SNAP_ACCESSPLANS
SDB_SNAP_HEALTH
SDB_SNAP_CONFIGS
SDB_SNAP_SVCTASKS
SDB_SNAP_SEQUENCES
SDB_SNAP_QUERIES
SDB_SNAP_LATCHWAITS
SDB_SNAP_LOCKWAITS
SDB_SNAP_INDEXSTATS
SDB_SNAP_TRANSWAITS
SDB_SNAP_TRANSDEADLOCK
matcher
- the matching rule, match all the documents if nullselector
- the selective rule, return the whole document if nullorderBy
- the ordered rule, never sort if nullBaseException
- If error happens.public DBCursor getSnapshot(int snapType, BSONObject matcher, BSONObject selector, BSONObject orderBy, BSONObject hint, long skipRows, long returnRows) throws BaseException
snapType
- The snapshot type as below:
SDB_SNAP_CONTEXTS
SDB_SNAP_CONTEXTS_CURRENT
SDB_SNAP_SESSIONS
SDB_SNAP_SESSIONS_CURRENT
SDB_SNAP_COLLECTIONS
SDB_SNAP_COLLECTIONSPACES
SDB_SNAP_DATABASE
SDB_SNAP_SYSTEM
SDB_SNAP_CATALOG
SDB_SNAP_TRANSACTIONS
SDB_SNAP_TRANSACTIONS_CURRENT
SDB_SNAP_ACCESSPLANS
SDB_SNAP_HEALTH
SDB_SNAP_CONFIGS
SDB_SNAP_SVCTASKS
SDB_SNAP_SEQUENCES
SDB_SNAP_QUERIES
SDB_SNAP_LATCHWAITS
SDB_SNAP_LOCKWAITS
SDB_SNAP_INDEXSTATS
SDB_SNAP_TRANSWAITS
SDB_SNAP_TRANSDEADLOCK
matcher
- the matching rule, match all the documents if nullselector
- the selective rule, return the whole document if nullorderBy
- the ordered rule, never sort if nullhint
- the hint rule, the options provided for specific snapshot type format:{
'$Options': { skipRows
- skip the first numToSkip documents, never skip if this parameter is 0returnRows
- return the specified amount of documents, when returnRows is 0, return nothing,
when returnRows is -1, return all the documents.BaseException
- If error happens.public ArrayList<String> getStorageUnits() throws BaseException
BaseException
- If error happens.public static void initClient(ClientOptions options)
options
- The global configuration of SequoiaDB driverpublic void interrupt() throws BaseException
BaseException
- If error happens.public void interruptOperation() throws BaseException
BaseException
- If error happens.public void invalidateCache(BSONObject options)
options
- The control options:(Only take effect in coordinate nodes). About the parameter
'options', please reference to the official website(www.sequoiadb.com) and then
search "命令位置参数" for more details. Some of its optional parameters are as
bellow:
public boolean isClosed()
public boolean isCollectionSpaceExist(String csName) throws BaseException
csName
- The collection space name.BaseException
- If error happens.public boolean isDataSourceExist(String dataSourceName) throws BaseException
dataSourceName
- The data source nameBaseException
- If error happens.public boolean isDomainExist(String domainName) throws BaseException
domainName
- the name of domainBaseException
- If error happens.public boolean isRelicaGroupExist(String rgName)
isReplicaGroupExist(String)
.public boolean isReplicaGroupExist(int rgId)
rgId
- id of replica grouppublic boolean isReplicaGroupExist(String rgName)
rgName
- replica group's namepublic boolean isValid() throws BaseException
BaseException
- If error happens.public DBCursor listBackup(BSONObject options, BSONObject matcher, BSONObject selector, BSONObject orderBy) throws BaseException
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":["rgName1", "rgName2"],
"Path":"/opt/sequoiadb/backup", "Name":"backupName"}
matcher
- The matching rule, return all the documents if nullselector
- The selective rule, return the whole document if nullorderBy
- The ordered rule, never sort if nullBaseException
- If error happens.public DBCursor listCollections() throws BaseException
BaseException
- If error happens.public DBCursor listCollectionSpaces() throws BaseException
BaseException
- If error happens.public DBCursor listDataSources(BSONObject matcher, BSONObject selector, BSONObject orderBy, BSONObject hint) throws BaseException
matcher
- The matching rule, return all the records if nullselector
- The selective rule, return the whole records if nullorderBy
- The ordered rule, never sort if nullhint
- Reserved, please specify nullBaseException
- If error happens.public DBCursor listDomains(BSONObject matcher, BSONObject selector, BSONObject orderBy, BSONObject hint) throws BaseException
matcher
- the matching rule, return all the documents if nullselector
- the selective rule, return the whole document if nullorderBy
- the ordered rule, never sort if nullhint
- 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
null, database automatically match the optimal index to scan data.BaseException
- If error happens.public DBCursor listProcedures(BSONObject condition) throws BaseException
condition
- The condition of list eg: {"name":"sum"}. return all if nullBaseException
- If error happens.public DBCursor listReplicaGroups() throws BaseException
BaseException
- If error happens.public DBCursor listTasks(BSONObject matcher, BSONObject selector, BSONObject orderBy, BSONObject hint) throws BaseException
matcher
- The matching rule, return all the documents if nullselector
- The selective rule, return the whole document if nullorderBy
- The ordered rule, never sort if nullhint
- 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
null, database automatically match the optimal index to scan data.BaseException
- If error happens.public void loadCollectionSpace(String csName, BSONObject options) throws BaseException
csName
- The collection space nameoptions
- The control options:(Only take effect in coordinate nodes, can be null)
BaseException
- If error happens.public void msg(String message)
message
- The message to send to server.public void releaseResource() throws BaseException
BaseException
- If error happens.public void removeBackup(BSONObject options) throws BaseException
options
- Contains 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"}
BaseException
- If error happens.public void removeReplicaGroup(String rgName) throws BaseException
rgName
- replica group's nameBaseException
- If error happens.public void removeUser(String username, String password) throws BaseException
username
- The connection user namepassword
- The connection passwordBaseException
- If error happens.public void renameCollectionSpace(String oldName, String newName) throws BaseException
oldName
- The old collection space namenewName
- The new collection space nameBaseException
- If error happens.public void renameSequence(String oldName, String newName)
oldName
- The old name of sequencenewName
- The new name of sequencepublic void resetSnapshot() throws BaseException
BaseException
- If error happens.public void resetSnapshot(BSONObject options) throws BaseException
options
- The control options:(can be null)
BaseException
- If error happens.public void rmProcedure(String name) throws BaseException
name
- The name of store procedure to be removedBaseException
- If error happens.public void rollback() throws BaseException
BaseException
- If error happens.public void setSessionAttr(BSONObject options) throws BaseException
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.BaseException
- If error happens.public void sync() throws BaseException
BaseException
- If error happens.public void sync(BSONObject options) throws BaseException
options
- The control options:(can be null)
BaseException
- If error happens.public void unloadCollectionSpace(String csName, BSONObject options) throws BaseException
csName
- The collection space nameoptions
- The control options:(Only take effect in coordinate nodes, can be null)
BaseException
- If error happens.public void updateConfig(BSONObject configs) throws BaseException
configs
- The specific configuration parameters to updateBaseException
- If error happens.public void updateConfig(BSONObject configs, BSONObject options) throws BaseException
configs
- The specific configuration parameters to updateoptions
- Options The control options:(Only take effect in coordinate nodes) GroupID:INT32,
GroupName:String, NodeID:INT32, HostName:String, svcname:String, ...BaseException
- If error happens.public void waitTasks(long[] taskIDs) throws BaseException
taskIDs
- The array of task idBaseException
- If error happens.Copyright © 2023. All rights reserved.