SequoiaDB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Public Attributes | List of all members
sdbclient::sdbCollectionSpace Class Reference

Database operation interfaces of collection space. More...

#include <client.hpp>

Public Member Functions

 sdbCollectionSpace ()
 Default constructor.
 
 ~sdbCollectionSpace ()
 Destructor.
 
INT32 getCollection (const CHAR *pCollectionName, sdbCollection &collection, BOOLEAN checkExist=TRUE)
 Get the named collection.
 
INT32 createCollection (const CHAR *pCollection, const bson::BSONObj &options, sdbCollection &collection)
 Create the specified collection in current collection space with options.
 
INT32 createCollection (const CHAR *pCollection, sdbCollection &collection)
 Create the specified collection in current collection space without sharding key and default ReplSize.
 
INT32 dropCollection (const CHAR *pCollection)
 Drop the specified collection in current collection space.
 
INT32 listCollections (_sdbCursor **cursor)
 list all collections in current collection space.
 
INT32 listCollections (sdbCursor &cursor)
 list all collections in current collection space.
 
INT32 create ()
 Create a new collection space.
 
INT32 drop ()
 Drop current collection space.
 
const CHAR * getCSName ()
 Get the current collection space name.
 
INT32 renameCollection (const CHAR *oldName, const CHAR *newName, const bson::BSONObj &options=_sdbStaticObject)
 Rename collection.
 
INT32 alterCollectionSpace (const bson::BSONObj &options)
 Alter collection space.
 
INT32 setDomain (const bson::BSONObj &options)
 Alter collection space to set domain.
 
INT32 getDomainName (CHAR *result, INT32 resultLen)
 get the Domain name in current collection space.
 
INT32 removeDomain ()
 Alter collection space to remove domain.
 
INT32 enableCapped ()
 Alter collection space to enable capped.
 
INT32 disableCapped ()
 Alter collection space to disable capped.
 
INT32 setAttributes (const bson::BSONObj &options)
 Alter collection space.
 

Public Attributes

_sdbCollectionSpace * pCollectionSpace
 

Detailed Description

Database operation interfaces of collection space.

Member Function Documentation

INT32 sdbclient::sdbCollectionSpace::alterCollectionSpace ( const bson::BSONObj &  options)
inline

Alter collection space.

Parameters
[in]optionsThe options of collection space to be changed, e.g. { "PageSize": 4096, "Domain": "mydomain" }.
PageSize     : The page size of the collection space
LobPageSize  : The page size of LOB objects in the collection space
Domain       : The domain which the collection space belongs to
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::create ( )
inline

Create a new collection space.

Deprecated:
This function will be deprecated in SequoiaDB2.x, use sdb::createCollectionSpace instead of it.
Return values
SDB_OKOperation Success.
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::createCollection ( const CHAR *  pCollection,
const bson::BSONObj &  options,
sdbCollection collection 
)
inline

Create the specified collection in current collection space with options.

Parameters
[in]pCollectionThe collection name
[in]optionsThe options are as following:
ShardingKey          : Assign the sharding key, foramt: { ShardingKey: { <key name>: <1/-1>} },
                       1 indicates positive order, -1 indicates reverse order.
                       e.g. { ShardingKey: { age: 1 } }
ShardingType         : Assign the sharding type, default is "hash"
Partition            : The number of partition, it is valid when ShardingType is "hash",
                       the range is [2^3, 2^20], default is 4096
ReplSize             : Assign how many replica nodes need to be synchronized when a write
                       request (insert, update, etc) is executed, default is 1
Compressed           : Whether to enable data compression, default is true
CompressionType      : The compression type of data, could be "snappy" or "lzw", default is "lzw"
AutoSplit            : Whether to enable the automatic partitioning, it is valid when ShardingType
                       is "hash", defalut is false
Group                : Assign the data group to which it belongs, default: The collection will
                       be created in any data group of the domain that the collection belongs to
AutoIndexId          : Whether to build "$id" index, default is true
EnsureShardingIndex  : Whether to build sharding index, default is true
StrictDataMode       : Whether to enable strict date mode in numeric operations, default is false
AutoIncrement        : Assign attributes of an autoincrement field or batch autoincrement fields
                       e.g. { AutoIncrement : { Field : "a", MaxValue : 2000 } },
                       { AutoIncrement : [ { Field : "a", MaxValue : 2000}, { Field : "a", MaxValue : 4000 } ] }
LobShardingKeyFormat : Assign the format of lob sharding key, could be "YYYYMMDD", "YYYYMM" or "YYYY".
                       It is valid when the collection is main collection
IsMainCL             : Main collection or not, default is false, which means it is not main collection
DataSource           : The name of the date soure used
Mapping              : The name of the collection to be mapped
[out]collectionThe return collection object .
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::createCollection ( const CHAR *  pCollection,
sdbCollection collection 
)
inline

Create the specified collection in current collection space without sharding key and default ReplSize.

Parameters
[in]pCollectionThe collection name.
[out]collectionThe return collection object.
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::disableCapped ( )
inline

Alter collection space to disable capped.

Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::drop ( )
inline

Drop current collection space.

Deprecated:
This function will be deprecated in SequoiaDB2.x, use sdb::dropCollectionSpace instead of it.
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::dropCollection ( const CHAR *  pCollection)
inline

Drop the specified collection in current collection space.

Parameters
[in]pCollectionThe collection name.
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::enableCapped ( )
inline

Alter collection space to enable capped.

Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::getCollection ( const CHAR *  pCollectionName,
sdbCollection collection,
BOOLEAN  checkExist = TRUE 
)
inline

Get the named collection.

Parameters
[in]pCollectionNameThe full name of the collection.
[in]checkExistCheck if the collection exists, default is true.
[out]collectionThe return collection object.
Return values
SDB_OKOperation Success
OthersOperation Fail
const CHAR * sdbclient::sdbCollectionSpace::getCSName ( )
inline

Get the current collection space name.

Returns
The name of current collection space.
INT32 sdbclient::sdbCollectionSpace::getDomainName ( CHAR *  result,
INT32  resultLen 
)
inline

get the Domain name in current collection space.

Parameters
[out]resultReturned domain name in the collection space
[in]resultLenThe length of the result to get the domain name
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::listCollections ( _sdbCursor **  cursor)
inline

list all collections in current collection space.

Parameters
[out]cursorThe sdbCursor object of result
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::listCollections ( sdbCursor cursor)
inline

list all collections in current collection space.

Parameters
[out]cursorThe sdbCursor object of result
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::removeDomain ( )
inline

Alter collection space to remove domain.

Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::renameCollection ( const CHAR *  oldName,
const CHAR *  newName,
const bson::BSONObj &  options = _sdbStaticObject 
)
inline

Rename collection.

Parameters
[in]oldNameThe old name of collectionSpace.
[in]newNameThe new name of collectionSpace.
[in]optionsReserved argument
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::setAttributes ( const bson::BSONObj &  options)
inline

Alter collection space.

Parameters
[in]optionsThe options of collection space to be changed, e.g. { "PageSize": 4096, "Domain": "mydomain" }.
PageSize     : The page size of the collection space
LobPageSize  : The page size of LOB objects in the collection space
Domain       : The domain which the collection space belongs to
Return values
SDB_OKOperation Success
OthersOperation Fail
INT32 sdbclient::sdbCollectionSpace::setDomain ( const bson::BSONObj &  options)
inline

Alter collection space to set domain.

Parameters
[in]optionsThe options of collection space to be changed.
Domain       : The domain which the collection space belongs to
Return values
SDB_OKOperation Success
OthersOperation Fail

Member Data Documentation

sdbclient::sdbCollectionSpace::pCollectionSpace

A pointer of virtual base class _sdbCollectionSpace

Class sdbCollectionSpace is a shell for _sdbCollectionSpace. We use pCollectionSpace to call the methods in class _sdbCollectionSpace.


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