28 #if defined (SDB_ENGINE) || defined (SDB_CLIENT)
29 #include "../bson/bson.h"
30 #include "../util/fromjson.hpp"
32 #include "bson/bson.hpp"
33 #include "fromjson.hpp"
43 #define RELEASE_INNER_HANDLE( handle ) \
53 #define DLLEXPORT SDB_EXPORT
55 #define SDB_PAGESIZE_4K 4096
56 #define SDB_PAGESIZE_8K 8192
57 #define SDB_PAGESIZE_16K 16384
58 #define SDB_PAGESIZE_32K 32768
59 #define SDB_PAGESIZE_64K 65536
61 #define SDB_PAGESIZE_DEFAULT 0
64 #define FLG_INSERT_CONTONDUP 0x00000001
66 #define FLG_INSERT_RETURN_OID 0x00000002
68 #define FLG_INSERT_REPLACEONDUP 0x00000004
76 #define SDB_CLIENT_SOCKET_TIMEOUT_DFT 10000
79 #define sdbReplicaNode sdbNode
81 #define activateReplicaGroup activateReplicaGroup
84 #define QUERY_FORCE_HINT 0x00000080
86 #define QUERY_PARALLED 0x00000100
88 #define QUERY_WITH_RETURNDATA 0x00000200
116 const static bson::BSONObj _sdbStaticObject ;
117 const static bson::OID _sdbStaticOid ;
119 class _sdbCollection ;
134 virtual INT32 next ( bson::BSONObj &obj ) = 0 ;
135 virtual INT32 current ( bson::BSONObj &obj ) = 0 ;
136 virtual INT32 close () = 0 ;
183 INT32 next ( bson::BSONObj &obj )
186 return SDB_NOT_CONNECTED ;
187 return pCursor->
next ( obj ) ;
196 INT32 current ( bson::BSONObj &obj )
199 return SDB_NOT_CONNECTED ;
200 return pCursor->current ( obj ) ;
212 return pCursor->close () ;
251 virtual INT32 getCount ( SINT64 &count,
252 const bson::BSONObj &condition = _sdbStaticObject ) = 0 ;
258 virtual INT32 insert (
const bson::BSONObj &obj, bson::OID *
id = NULL ) = 0 ;
260 virtual INT32 bulkInsert ( SINT32 flags,
261 std::vector<bson::BSONObj> &obj
268 virtual INT32 update (
const bson::BSONObj &rule,
269 const bson::BSONObj &condition = _sdbStaticObject,
270 const bson::BSONObj &hint = _sdbStaticObject
280 virtual INT32 upsert (
const bson::BSONObj &rule,
281 const bson::BSONObj &condition = _sdbStaticObject,
282 const bson::BSONObj &hint = _sdbStaticObject,
283 const bson::BSONObj &setOnInsert = _sdbStaticObject
290 virtual INT32 del (
const bson::BSONObj &condition = _sdbStaticObject,
291 const bson::BSONObj &hint = _sdbStaticObject
302 const bson::BSONObj &condition = _sdbStaticObject,
303 const bson::BSONObj &selected = _sdbStaticObject,
304 const bson::BSONObj &orderBy = _sdbStaticObject,
305 const bson::BSONObj &hint = _sdbStaticObject,
307 INT64 numToReturn = -1,
312 const bson::BSONObj &condition = _sdbStaticObject,
313 const bson::BSONObj &selected = _sdbStaticObject,
314 const bson::BSONObj &orderBy = _sdbStaticObject,
315 const bson::BSONObj &hint = _sdbStaticObject,
317 INT64 numToReturn = -1,
321 virtual INT32 queryOne( bson::BSONObj &obj,
322 const bson::BSONObj &condition = _sdbStaticObject,
323 const bson::BSONObj &selected = _sdbStaticObject,
324 const bson::BSONObj &orderBy = _sdbStaticObject,
325 const bson::BSONObj &hint = _sdbStaticObject,
327 INT32 flag = 0 ) = 0 ;
339 virtual INT32 queryAndUpdate (
_sdbCursor **cursor,
340 const bson::BSONObj &update,
341 const bson::BSONObj &condition = _sdbStaticObject,
342 const bson::BSONObj &selected = _sdbStaticObject,
343 const bson::BSONObj &orderBy = _sdbStaticObject,
344 const bson::BSONObj &hint = _sdbStaticObject,
346 INT64 numToReturn = -1,
348 BOOLEAN returnNew = FALSE
359 virtual INT32 queryAndRemove (
_sdbCursor **cursor,
360 const bson::BSONObj &condition = _sdbStaticObject,
361 const bson::BSONObj &selected = _sdbStaticObject,
362 const bson::BSONObj &orderBy = _sdbStaticObject,
363 const bson::BSONObj &hint = _sdbStaticObject,
365 INT64 numToReturn = -1,
376 virtual INT32 createIndex (
const bson::BSONObj &indexDef,
381 virtual INT32 createIndex (
const bson::BSONObj &indexDef,
385 INT32 sortBufferSize ) = 0 ;
386 virtual INT32 getIndexes (
_sdbCursor **cursor,
387 const CHAR *pName ) = 0 ;
388 virtual INT32 getIndexes (
sdbCursor &cursor,
389 const CHAR *pName ) = 0 ;
390 virtual INT32 dropIndex (
const CHAR *pName ) = 0 ;
391 virtual INT32 create () = 0 ;
392 virtual INT32 drop () = 0 ;
393 virtual const CHAR *getCollectionName () = 0 ;
394 virtual const CHAR *getCSName () = 0 ;
395 virtual const CHAR *getFullName () = 0 ;
396 virtual INT32 split (
const CHAR *pSourceGroupName,
397 const CHAR *pTargetGroupName,
398 const bson::BSONObj &splitConditon,
399 const bson::BSONObj &splitEndCondition = _sdbStaticObject) = 0 ;
400 virtual INT32 split (
const CHAR *pSourceGroupName,
401 const CHAR *pTargetGroupName,
402 FLOAT64 percent ) = 0 ;
403 virtual INT32 splitAsync ( SINT64 &taskID,
404 const CHAR *pSourceGroupName,
405 const CHAR *pTargetGroupName,
406 const bson::BSONObj &splitCondition,
407 const bson::BSONObj &splitEndCondition = _sdbStaticObject) = 0 ;
408 virtual INT32 splitAsync (
const CHAR *pSourceGroupName,
409 const CHAR *pTargetGroupName,
411 SINT64 &taskID ) = 0 ;
412 virtual INT32 aggregate (
_sdbCursor **cursor,
413 std::vector<bson::BSONObj> &obj
415 virtual INT32 aggregate (
sdbCursor &cursor,
416 std::vector<bson::BSONObj> &obj
418 virtual INT32 getQueryMeta (
_sdbCursor **cursor,
419 const bson::BSONObj &condition = _sdbStaticObject,
420 const bson::BSONObj &orderBy = _sdbStaticObject,
421 const bson::BSONObj &hint = _sdbStaticObject,
423 INT64 numToReturn = -1
425 virtual INT32 getQueryMeta (
sdbCursor &cursor,
426 const bson::BSONObj &condition = _sdbStaticObject,
427 const bson::BSONObj &orderBy = _sdbStaticObject,
428 const bson::BSONObj &hint = _sdbStaticObject,
430 INT64 numToReturn = -1
432 virtual INT32 attachCollection (
const CHAR *subClFullName,
433 const bson::BSONObj &options) = 0 ;
434 virtual INT32 detachCollection (
const CHAR *subClFullName) = 0 ;
436 virtual INT32 alterCollection (
const bson::BSONObj &options ) = 0 ;
438 virtual INT32 explain (
sdbCursor &cursor,
439 const bson::BSONObj &condition = _sdbStaticObject,
440 const bson::BSONObj &select = _sdbStaticObject,
441 const bson::BSONObj &orderBy = _sdbStaticObject,
442 const bson::BSONObj &hint = _sdbStaticObject,
444 INT64 numToReturn = -1,
446 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
448 virtual INT32 createLob(
sdbLob &lob,
const bson::OID *oid = NULL ) = 0 ;
450 virtual INT32 removeLob(
const bson::OID &oid ) = 0 ;
452 virtual INT32 openLob(
sdbLob &lob,
const bson::OID &oid ) = 0 ;
454 virtual INT32 listLobs(
sdbCursor &cursor ) = 0 ;
457 virtual INT32 truncate() = 0 ;
460 virtual INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
462 virtual INT32 dropIdIndex() = 0 ;
518 INT32 getCount ( SINT64 &count,
519 const bson::BSONObj &condition = _sdbStaticObject )
522 return SDB_NOT_CONNECTED ;
523 return pCollection->
getCount ( count, condition ) ;
543 INT32 split (
const CHAR *pSourceGroupName,
544 const CHAR *pTargetGroupName,
545 const bson::BSONObj &splitCondition,
546 const bson::BSONObj &splitEndCondition = _sdbStaticObject)
549 return SDB_NOT_CONNECTED ;
550 return pCollection->split ( pSourceGroupName,
567 INT32 split (
const CHAR *pSourceGroupName,
568 const CHAR *pTargetGroupName,
572 return SDB_NOT_CONNECTED ;
573 return pCollection->split ( pSourceGroupName,
597 INT32 splitAsync ( SINT64 &taskID,
598 const CHAR *pSourceGroupName,
599 const CHAR *pTargetGroupName,
600 const bson::BSONObj &splitCondition,
601 const bson::BSONObj &splitEndCondition = _sdbStaticObject )
604 return SDB_NOT_CONNECTED ;
605 return pCollection->splitAsync ( taskID,
609 splitEndCondition ) ;
626 INT32 splitAsync (
const CHAR *pSourceGroupName,
627 const CHAR *pTargetGroupName,
632 return SDB_NOT_CONNECTED ;
633 return pCollection->splitAsync ( pSourceGroupName,
654 INT32 alterCollection (
const bson::BSONObj &options )
657 return SDB_NOT_CONNECTED ;
658 return pCollection->alterCollection ( options ) ;
689 INT32 bulkInsert ( SINT32 flags,
690 std::vector<bson::BSONObj> &obj
694 return SDB_NOT_CONNECTED ;
695 return pCollection->bulkInsert ( flags, obj ) ;
705 INT32 insert (
const bson::BSONObj &obj, bson::OID *
id = NULL )
708 return SDB_NOT_CONNECTED ;
709 return pCollection->insert ( obj,
id ) ;
727 INT32 update (
const bson::BSONObj &rule,
728 const bson::BSONObj &condition = _sdbStaticObject,
729 const bson::BSONObj &hint = _sdbStaticObject
733 return SDB_NOT_CONNECTED ;
734 return pCollection->update ( rule, condition, hint ) ;
753 INT32 upsert (
const bson::BSONObj &rule,
754 const bson::BSONObj &condition = _sdbStaticObject,
755 const bson::BSONObj &hint = _sdbStaticObject,
756 const bson::BSONObj &setOnInsert = _sdbStaticObject
760 return SDB_NOT_CONNECTED ;
761 return pCollection->upsert ( rule, condition, hint, setOnInsert ) ;
776 INT32 del (
const bson::BSONObj &condition = _sdbStaticObject,
777 const bson::BSONObj &hint = _sdbStaticObject
781 return SDB_NOT_CONNECTED ;
782 return pCollection->del ( condition, hint ) ;
815 const bson::BSONObj &condition = _sdbStaticObject,
816 const bson::BSONObj &selected = _sdbStaticObject,
817 const bson::BSONObj &orderBy = _sdbStaticObject,
818 const bson::BSONObj &hint = _sdbStaticObject,
820 INT64 numToReturn = -1,
825 return SDB_NOT_CONNECTED ;
826 return pCollection->query ( cursor, condition, selected, orderBy,
827 hint, numToSkip, numToReturn, flags ) ;
860 const bson::BSONObj &condition = _sdbStaticObject,
861 const bson::BSONObj &selected = _sdbStaticObject,
862 const bson::BSONObj &orderBy = _sdbStaticObject,
863 const bson::BSONObj &hint = _sdbStaticObject,
865 INT64 numToReturn = -1,
871 return SDB_NOT_CONNECTED ;
874 return pCollection->query ( cursor, condition, selected, orderBy,
875 hint, numToSkip, numToReturn, flag ) ;
905 INT32 queryOne( bson::BSONObj &obj,
906 const bson::BSONObj &condition = _sdbStaticObject,
907 const bson::BSONObj &selected = _sdbStaticObject,
908 const bson::BSONObj &orderBy = _sdbStaticObject,
909 const bson::BSONObj &hint = _sdbStaticObject,
914 return SDB_NOT_CONNECTED ;
915 return pCollection->queryOne( obj, condition, selected, orderBy,
916 hint, numToSkip, flag ) ;
953 const bson::BSONObj &update,
954 const bson::BSONObj &condition = _sdbStaticObject,
955 const bson::BSONObj &selected = _sdbStaticObject,
956 const bson::BSONObj &orderBy = _sdbStaticObject,
957 const bson::BSONObj &hint = _sdbStaticObject,
959 INT64 numToReturn = -1,
961 BOOLEAN returnNew = FALSE
966 return SDB_NOT_CONNECTED ;
969 return pCollection->queryAndUpdate( &cursor.
pCursor , update, condition,
970 selected, orderBy, hint,
971 numToSkip, numToReturn, flag, returnNew ) ;
1004 const bson::BSONObj &condition = _sdbStaticObject,
1005 const bson::BSONObj &selected = _sdbStaticObject,
1006 const bson::BSONObj &orderBy = _sdbStaticObject,
1007 const bson::BSONObj &hint = _sdbStaticObject,
1008 INT64 numToSkip = 0,
1009 INT64 numToReturn = -1,
1015 return SDB_NOT_CONNECTED ;
1018 return pCollection->queryAndRemove( &cursor.
pCursor , condition,
1019 selected, orderBy, hint,
1020 numToSkip, numToReturn, flag ) ;
1050 INT32 createIndex (
const bson::BSONObj &indexDef,
1051 const CHAR *pIndexName,
1057 return SDB_NOT_CONNECTED ;
1058 return pCollection->createIndex ( indexDef, pIndexName, isUnique,
1078 INT32 createIndex (
const bson::BSONObj &indexDef,
1079 const CHAR *pIndexName,
1082 INT32 sortBufferSize )
1085 return SDB_NOT_CONNECTED ;
1086 return pCollection->createIndex ( indexDef, pIndexName, isUnique,
1087 isEnforced, sortBufferSize ) ;
1099 const CHAR *pIndexName )
1102 return SDB_NOT_CONNECTED ;
1103 return pCollection->getIndexes ( cursor, pIndexName ) ;
1115 const CHAR *pIndexName )
1119 return SDB_NOT_CONNECTED ;
1122 return pCollection->getIndexes ( cursor, pIndexName ) ;
1131 INT32 dropIndex (
const CHAR *pIndexName )
1134 return SDB_NOT_CONNECTED ;
1135 return pCollection->dropIndex ( pIndexName ) ;
1147 return SDB_NOT_CONNECTED ;
1148 return pCollection->create () ;
1160 return SDB_NOT_CONNECTED ;
1161 return pCollection->drop () ;
1169 const CHAR *getCollectionName ()
1173 return pCollection->getCollectionName () ;
1180 const CHAR *getCSName ()
1184 return pCollection->getCSName () ;
1191 const CHAR *getFullName ()
1195 return pCollection->getFullName () ;
1208 std::vector<bson::BSONObj> &obj
1212 return SDB_NOT_CONNECTED ;
1213 return pCollection->aggregate ( cursor, obj ) ;
1226 std::vector<bson::BSONObj> &obj
1231 return SDB_NOT_CONNECTED ;
1234 return pCollection->aggregate ( cursor, obj ) ;
1257 const bson::BSONObj &condition = _sdbStaticObject,
1258 const bson::BSONObj &orderBy = _sdbStaticObject,
1259 const bson::BSONObj &hint = _sdbStaticObject,
1260 INT64 numToSkip = 0,
1261 INT64 numToReturn = -1 ) ;
1284 const bson::BSONObj &condition = _sdbStaticObject,
1285 const bson::BSONObj &orderBy = _sdbStaticObject,
1286 const bson::BSONObj &hint = _sdbStaticObject,
1287 INT64 numToSkip = 0,
1288 INT64 numToReturn = -1 )
1292 return SDB_NOT_CONNECTED ;
1295 return pCollection->getQueryMeta ( cursor, condition, orderBy,
1296 hint, numToSkip, numToReturn ) ;
1308 INT32 attachCollection (
const CHAR *subClFullName,
1309 const bson::BSONObj &options)
1312 return SDB_NOT_CONNECTED ;
1313 return pCollection->attachCollection ( subClFullName, options ) ;
1322 INT32 detachCollection (
const CHAR *subClFullName)
1325 return SDB_NOT_CONNECTED ;
1326 return pCollection->detachCollection ( subClFullName ) ;
1365 const bson::BSONObj &condition = _sdbStaticObject,
1366 const bson::BSONObj &select = _sdbStaticObject,
1367 const bson::BSONObj &orderBy = _sdbStaticObject,
1368 const bson::BSONObj &hint = _sdbStaticObject,
1369 INT64 numToSkip = 0,
1370 INT64 numToReturn = -1,
1372 const bson::BSONObj &options = _sdbStaticObject )
1376 return SDB_NOT_CONNECTED ;
1379 return pCollection->explain( cursor, condition, select, orderBy, hint,
1380 numToSkip, numToReturn, flag, options ) ;
1391 INT32 createLob(
sdbLob &lob,
const bson::OID *oid = NULL )
1394 return SDB_NOT_CONNECTED ;
1395 return pCollection->createLob( lob, oid ) ;
1404 INT32 removeLob(
const bson::OID &oid )
1407 return SDB_NOT_CONNECTED ;
1408 return pCollection->removeLob( oid ) ;
1419 INT32 openLob(
sdbLob &lob,
const bson::OID &oid )
1422 return SDB_NOT_CONNECTED ;
1423 return pCollection->openLob( lob, oid ) ;
1436 return SDB_NOT_CONNECTED ;
1439 return pCollection->listLobs( cursor ) ;
1450 return SDB_NOT_CONNECTED ;
1451 return pCollection->truncate() ;
1463 INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject )
1466 return SDB_NOT_CONNECTED ;
1467 return pCollection->createIdIndex( options ) ;
1479 return SDB_NOT_CONNECTED ;
1480 return pCollection->dropIdIndex() ;
1511 virtual INT32 connect (
_sdb **dbConn ) = 0 ;
1512 virtual INT32 connect (
sdb &dbConn ) = 0 ;
1518 virtual const CHAR *getHostName () = 0 ;
1521 virtual const CHAR *getServiceName () = 0 ;
1524 virtual const CHAR *getNodeName () = 0 ;
1527 virtual INT32 stop () = 0 ;
1530 virtual INT32 start () = 0 ;
1589 INT32 connect (
_sdb **dbConn )
1592 return SDB_NOT_CONNECTED ;
1593 return pNode->connect ( dbConn ) ;
1606 return SDB_NOT_CONNECTED ;
1609 return pNode->connect ( dbConn ) ;
1619 return SDB_NODE_UNKNOWN ;
1620 return pNode->getStatus () ;
1627 const CHAR *getHostName ()
1631 return pNode->getHostName () ;
1638 const CHAR *getServiceName ()
1642 return pNode->getServiceName () ;
1649 const CHAR *getNodeName ()
1653 return pNode->getNodeName () ;
1664 return SDB_NOT_CONNECTED ;
1665 return pNode->stop () ;
1676 return SDB_NOT_CONNECTED ;
1677 return pNode->start () ;
1696 virtual INT32 getNodeNum (
sdbNodeStatus status, INT32 *num ) = 0 ;
1699 virtual INT32 getDetail ( bson::BSONObj &result ) = 0 ;
1702 virtual INT32 getMaster (
_sdbNode **node ) = 0 ;
1703 virtual INT32 getMaster (
sdbNode &node ) = 0 ;
1706 virtual INT32 getSlave (
_sdbNode **node ) = 0 ;
1707 virtual INT32 getSlave (
sdbNode &node ) = 0 ;
1710 virtual INT32 getNode (
const CHAR *pNodeName,
1712 virtual INT32 getNode (
const CHAR *pNodeName,
1716 virtual INT32 getNode (
const CHAR *pHostName,
1717 const CHAR *pServiceName,
1719 virtual INT32 getNode (
const CHAR *pHostName,
1720 const CHAR *pServiceName,
1724 virtual INT32 createNode (
const CHAR *pHostName,
1725 const CHAR *pServiceName,
1726 const CHAR *pDatabasePath,
1727 std::map<std::string,std::string> &config )= 0;
1729 virtual INT32 createNode (
const CHAR *pHostName,
1730 const CHAR *pServiceName,
1731 const CHAR *pDatabasePath,
1732 const bson::BSONObj &options = _sdbStaticObject )= 0;
1735 virtual INT32 removeNode (
const CHAR *pHostName,
1736 const CHAR *pServiceName,
1737 const bson::BSONObj &configure = _sdbStaticObject ) = 0 ;
1739 virtual INT32 stop () = 0 ;
1742 virtual INT32 start () = 0 ;
1745 virtual const CHAR *getName () = 0 ;
1748 virtual BOOLEAN isCatalog () = 0 ;
1751 virtual INT32 attachNode(
const CHAR *pHostName,
1752 const CHAR *pSvcName,
1753 const bson::BSONObj &options ) = 0 ;
1756 virtual INT32 detachNode(
const CHAR *pHostName,
1757 const CHAR *pSvcName,
1758 const bson::BSONObj &options ) = 0 ;
1783 pReplicaGroup = NULL ;
1791 if ( pReplicaGroup )
1792 delete pReplicaGroup ;
1811 if ( !pReplicaGroup )
1812 return SDB_NOT_CONNECTED ;
1813 return pReplicaGroup->
getNodeNum ( status, num ) ;
1822 INT32 getDetail ( bson::BSONObj &result )
1824 if ( !pReplicaGroup )
1825 return SDB_NOT_CONNECTED ;
1826 return pReplicaGroup->getDetail ( result ) ;
1835 INT32 getMaster (
_sdbNode **node )
1837 if ( !pReplicaGroup )
1838 return SDB_NOT_CONNECTED ;
1839 return pReplicaGroup->getMaster ( node ) ;
1850 if ( !pReplicaGroup )
1852 return SDB_NOT_CONNECTED ;
1855 return pReplicaGroup->getMaster ( node ) ;
1867 if ( !pReplicaGroup )
1868 return SDB_NOT_CONNECTED ;
1869 return pReplicaGroup->getSlave ( node ) ;
1881 if ( !pReplicaGroup )
1883 return SDB_NOT_CONNECTED ;
1886 return pReplicaGroup->getSlave ( node ) ;
1897 INT32 getNode (
const CHAR *pNodeName,
1900 if ( !pReplicaGroup )
1901 return SDB_NOT_CONNECTED ;
1902 return pReplicaGroup->getNode ( pNodeName, node ) ;
1913 INT32 getNode (
const CHAR *pNodeName,
1916 if ( !pReplicaGroup )
1918 return SDB_NOT_CONNECTED ;
1921 return pReplicaGroup->getNode ( pNodeName, node ) ;
1934 INT32 getNode (
const CHAR *pHostName,
1935 const CHAR *pServiceName,
1938 if ( !pReplicaGroup )
1939 return SDB_NOT_CONNECTED ;
1940 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
1953 INT32 getNode (
const CHAR *pHostName,
1954 const CHAR *pServiceName,
1957 if ( !pReplicaGroup )
1959 return SDB_NOT_CONNECTED ;
1962 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
1978 INT32 createNode (
const CHAR *pHostName,
1979 const CHAR *pServiceName,
1980 const CHAR *pDatabasePath,
1981 std::map<std::string,std::string> &config )
1983 if ( !pReplicaGroup )
1984 return SDB_NOT_CONNECTED ;
1985 return pReplicaGroup->createNode ( pHostName, pServiceName,
1986 pDatabasePath, config ) ;
2001 INT32 createNode (
const CHAR *pHostName,
2002 const CHAR *pServiceName,
2003 const CHAR *pDatabasePath,
2004 const bson::BSONObj &options = _sdbStaticObject )
2006 if ( !pReplicaGroup )
2007 return SDB_NOT_CONNECTED ;
2008 return pReplicaGroup->createNode ( pHostName, pServiceName,
2009 pDatabasePath, options ) ;
2022 INT32 removeNode (
const CHAR *pHostName,
2023 const CHAR *pServiceName,
2024 const bson::BSONObj &configure = _sdbStaticObject )
2026 if ( !pReplicaGroup )
2027 return SDB_NOT_CONNECTED ;
2028 return pReplicaGroup->removeNode ( pHostName, pServiceName,
2038 if ( !pReplicaGroup )
2039 return SDB_NOT_CONNECTED ;
2040 return pReplicaGroup->stop () ;
2050 if ( !pReplicaGroup )
2051 return SDB_NOT_CONNECTED ;
2052 return pReplicaGroup->start () ;
2059 const CHAR *getName ()
2061 if ( !pReplicaGroup )
2063 return pReplicaGroup->getName() ;
2071 BOOLEAN isCatalog ()
2073 if ( !pReplicaGroup )
2075 return pReplicaGroup->isCatalog() ;
2093 INT32 attachNode(
const CHAR *pHostName,
2094 const CHAR *pSvcName,
2095 const bson::BSONObj &options )
2097 if ( !pReplicaGroup )
2098 return SDB_NOT_CONNECTED ;
2099 return pReplicaGroup->attachNode( pHostName, pSvcName, options ) ;
2119 INT32 detachNode(
const CHAR *pHostName,
2120 const CHAR *pSvcName,
2121 const bson::BSONObj &options )
2123 if ( !pReplicaGroup )
2124 return SDB_NOT_CONNECTED ;
2125 return pReplicaGroup->detachNode( pHostName, pSvcName, options ) ;
2139 virtual INT32 getCollection (
const CHAR *pCollectionName,
2142 virtual INT32 getCollection (
const CHAR *pCollectionName,
2146 virtual INT32 createCollection (
const CHAR *pCollection,
2147 const bson::BSONObj &options,
2150 virtual INT32 createCollection (
const CHAR *pCollection,
2151 const bson::BSONObj &options,
2155 virtual INT32 createCollection (
const CHAR *pCollection,
2158 virtual INT32 createCollection (
const CHAR *pCollection,
2162 virtual INT32 dropCollection (
const CHAR *pCollection ) = 0 ;
2165 virtual INT32 create () = 0 ;
2167 virtual INT32 drop () = 0 ;
2170 virtual const CHAR *getCSName () = 0 ;
2205 pCollectionSpace = NULL ;
2213 if ( pCollectionSpace )
2214 delete pCollectionSpace ;
2224 INT32 getCollection (
const CHAR *pCollectionName,
2227 if ( !pCollectionSpace )
2228 return SDB_NOT_CONNECTED ;
2229 return pCollectionSpace->getCollection ( pCollectionName,
2241 INT32 getCollection (
const CHAR *pCollectionName,
2244 if ( !pCollectionSpace )
2246 return SDB_NOT_CONNECTED ;
2249 return pCollectionSpace->getCollection ( pCollectionName,
2265 INT32 createCollection (
const CHAR *pCollection,
2266 const bson::BSONObj &options,
2269 if ( !pCollectionSpace )
2270 return SDB_NOT_CONNECTED ;
2271 return pCollectionSpace->createCollection ( pCollection,
2288 INT32 createCollection (
const CHAR *pCollection,
2289 const bson::BSONObj &options,
2292 if ( !pCollectionSpace )
2294 return SDB_NOT_CONNECTED ;
2297 return pCollectionSpace->createCollection ( pCollection,
2311 INT32 createCollection (
const CHAR *pCollection,
2314 if ( !pCollectionSpace )
2315 return SDB_NOT_CONNECTED ;
2316 return pCollectionSpace->createCollection ( pCollection,
2329 INT32 createCollection (
const CHAR *pCollection,
2332 if ( !pCollectionSpace )
2334 return SDB_NOT_CONNECTED ;
2337 return pCollectionSpace->createCollection ( pCollection,
2347 INT32 dropCollection (
const CHAR *pCollection )
2349 if ( !pCollectionSpace )
2350 return SDB_NOT_CONNECTED ;
2351 return pCollectionSpace->dropCollection ( pCollection ) ;
2362 if ( !pCollectionSpace )
2363 return SDB_NOT_CONNECTED ;
2364 return pCollectionSpace->create () ;
2375 if ( !pCollectionSpace )
2376 return SDB_NOT_CONNECTED ;
2377 return pCollectionSpace->drop () ;
2385 const CHAR *getCSName ()
2387 if ( !pCollectionSpace )
2389 return pCollectionSpace->getCSName () ;
2402 virtual const CHAR* getName () = 0 ;
2404 virtual INT32 alterDomain (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
2406 virtual INT32 listCollectionSpacesInDomain (
_sdbCursor **cursor ) = 0 ;
2408 virtual INT32 listCollectionSpacesInDomain (
sdbCursor &cursor ) = 0 ;
2410 virtual INT32 listCollectionsInDomain (
_sdbCursor **cursor ) = 0 ;
2412 virtual INT32 listCollectionsInDomain (
sdbCursor &cursor ) = 0 ;
2452 const CHAR *getName ()
2476 INT32 alterDomain (
const bson::BSONObj &options )
2479 return SDB_NOT_CONNECTED ;
2480 return pDomain->alterDomain ( options ) ;
2494 return SDB_NOT_CONNECTED ;
2497 return pDomain->listCollectionSpacesInDomain ( cursor ) ;
2511 return SDB_NOT_CONNECTED ;
2514 return pDomain->listCollectionsInDomain ( cursor ) ;
2530 virtual const CHAR *getName () = 0 ;
2531 virtual INT32 getDetail( bson::BSONObj &retInfo ) = 0 ;
2532 virtual INT32 activateDC() = 0 ;
2533 virtual INT32 deactivateDC() = 0 ;
2534 virtual INT32 enableReadOnly( BOOLEAN isReadOnly ) = 0 ;
2535 virtual INT32 createImage(
const CHAR *pCataAddrList ) = 0 ;
2536 virtual INT32 removeImage() = 0 ;
2537 virtual INT32 enableImage() = 0 ;
2538 virtual INT32 disableImage() = 0 ;
2539 virtual INT32 attachGroups(
const bson::BSONObj &info ) = 0 ;
2540 virtual INT32 detachGroups(
const bson::BSONObj &info ) = 0 ;
2583 const CHAR *getName ()
2596 INT32 getDetail( bson::BSONObj &retInfo )
2599 return SDB_NOT_CONNECTED ;
2600 return pDC->getDetail( retInfo ) ;
2611 return SDB_NOT_CONNECTED ;
2612 return pDC->activateDC() ;
2620 INT32 deactivateDC()
2623 return SDB_NOT_CONNECTED ;
2624 return pDC->deactivateDC() ;
2633 INT32 enableReadOnly( BOOLEAN isReadOnly )
2636 return SDB_NOT_CONNECTED ;
2637 return pDC->enableReadOnly( isReadOnly ) ;
2647 INT32 createImage(
const CHAR *pCataAddrList )
2650 return SDB_NOT_CONNECTED ;
2651 return pDC->createImage( pCataAddrList ) ;
2662 return SDB_NOT_CONNECTED ;
2663 return pDC->removeImage() ;
2674 return SDB_NOT_CONNECTED ;
2675 return pDC->enableImage() ;
2683 INT32 disableImage()
2686 return SDB_NOT_CONNECTED ;
2687 return pDC->disableImage() ;
2696 INT32 attachGroups(
const bson::BSONObj &info )
2699 return SDB_NOT_CONNECTED ;
2700 return pDC->attachGroups( info ) ;
2709 INT32 detachGroups(
const bson::BSONObj &info )
2712 return SDB_NOT_CONNECTED ;
2713 return pDC->detachGroups( info ) ;
2729 virtual INT32 close () = 0 ;
2731 virtual INT32 read ( UINT32 len, CHAR *buf, UINT32 *read ) = 0 ;
2733 virtual INT32 write (
const CHAR *buf, UINT32 len ) = 0 ;
2735 virtual INT32 seek ( SINT64 size,
SDB_LOB_SEEK whence ) = 0 ;
2737 virtual INT32 isClosed( BOOLEAN &flag ) = 0 ;
2739 virtual INT32 getOid( bson::OID &oid ) = 0 ;
2741 virtual INT32 getSize( SINT64 *size ) = 0 ;
2743 virtual INT32 getCreateTime ( UINT64 *millis ) = 0 ;
2745 virtual BOOLEAN isClosed() = 0 ;
2747 virtual bson::OID getOid() = 0 ;
2749 virtual SINT64 getSize() = 0 ;
2751 virtual UINT64 getCreateTime () = 0 ;
2796 return pLob->
close() ;
2807 INT32 read ( UINT32 len, CHAR *buf, UINT32 *read )
2810 return SDB_NOT_CONNECTED ;
2811 return pLob->read( len, buf, read ) ;
2821 INT32 write (
const CHAR *buf, UINT32 len )
2824 return SDB_NOT_CONNECTED ;
2825 return pLob->write( buf, len ) ;
2838 return SDB_NOT_CONNECTED ;
2839 return pLob->seek( size, whence ) ;
2849 INT32 isClosed( BOOLEAN &flag )
2852 return SDB_NOT_CONNECTED ;
2853 return pLob->isClosed ( flag ) ;
2864 return pLob->isClosed () ;
2874 INT32 getOid ( bson::OID &oid )
2877 return SDB_NOT_CONNECTED ;
2878 return pLob->getOid( oid ) ;
2889 return pLob->getOid() ;
2899 INT32 getSize ( SINT64 *size )
2902 return SDB_NOT_CONNECTED ;
2903 return pLob->getSize( size ) ;
2914 return pLob->getSize();
2924 INT32 getCreateTime ( UINT64 *millis )
2927 return SDB_NOT_CONNECTED ;
2928 return pLob->getCreateTime( millis ) ;
2935 UINT64 getCreateTime ()
2939 return pLob->getCreateTime() ;
2952 virtual INT32 connect (
const CHAR *pHostName,
2955 virtual INT32 connect (
const CHAR *pHostName,
2957 const CHAR *pUsrName,
2958 const CHAR *pPasswd ) = 0 ;
2959 virtual INT32 connect (
const CHAR *pHostName,
2960 const CHAR *pServiceName ) = 0 ;
2961 virtual INT32 connect (
const CHAR *pHostName,
2962 const CHAR *pServiceName,
2963 const CHAR *pUsrName,
2964 const CHAR *pPasswd ) = 0 ;
2965 virtual INT32 connect (
const CHAR **pConnAddrs,
2967 const CHAR *pUsrName,
2968 const CHAR *pPasswd ) = 0 ;
2970 virtual void disconnect () = 0 ;
2973 virtual INT32 createUsr(
const CHAR *pUsrName,
2974 const CHAR *pPasswd,
2975 const bson::BSONObj &options = _sdbStaticObject
2978 virtual INT32 removeUsr(
const CHAR *pUsrName,
2979 const CHAR *pPasswd ) = 0 ;
2981 virtual INT32 getSnapshot (
_sdbCursor **cursor,
2983 const bson::BSONObj &condition = _sdbStaticObject,
2984 const bson::BSONObj &selector = _sdbStaticObject,
2985 const bson::BSONObj &orderBy = _sdbStaticObject,
2986 const bson::BSONObj &hint = _sdbStaticObject,
2987 INT64 numToSkip = 0,
2988 INT64 numToReturn = -1
2991 virtual INT32 getSnapshot (
sdbCursor &cursor,
2993 const bson::BSONObj &condition = _sdbStaticObject,
2994 const bson::BSONObj &selector = _sdbStaticObject,
2995 const bson::BSONObj &orderBy = _sdbStaticObject,
2996 const bson::BSONObj &hint = _sdbStaticObject,
2997 INT64 numToSkip = 0,
2998 INT64 numToReturn = -1
3001 virtual INT32 resetSnapshot (
const bson::BSONObj &condition = _sdbStaticObject ) = 0 ;
3005 const bson::BSONObj &condition = _sdbStaticObject,
3006 const bson::BSONObj &selector = _sdbStaticObject,
3007 const bson::BSONObj &orderBy = _sdbStaticObject,
3008 const bson::BSONObj &hint = _sdbStaticObject,
3009 INT64 numToSkip = 0,
3010 INT64 numToReturn = -1
3012 virtual INT32 getList (
sdbCursor &cursor,
3014 const bson::BSONObj &condition = _sdbStaticObject,
3015 const bson::BSONObj &selector = _sdbStaticObject,
3016 const bson::BSONObj &orderBy = _sdbStaticObject,
3017 const bson::BSONObj &hint = _sdbStaticObject,
3018 INT64 numToSkip = 0,
3019 INT64 numToReturn = -1
3022 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
3026 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
3030 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
3034 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
3038 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
3043 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
3048 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
3049 const bson::BSONObj &options,
3053 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
3054 const bson::BSONObj &options,
3058 virtual INT32 dropCollectionSpace (
const CHAR *pCollectionSpaceName )
3061 virtual INT32 listCollectionSpaces (
_sdbCursor **result ) = 0 ;
3063 virtual INT32 listCollectionSpaces (
sdbCursor &result ) = 0 ;
3066 virtual INT32 listCollections (
_sdbCursor **result ) = 0 ;
3068 virtual INT32 listCollections (
sdbCursor &result ) = 0 ;
3071 virtual INT32 listReplicaGroups (
_sdbCursor **result ) = 0 ;
3073 virtual INT32 listReplicaGroups (
sdbCursor &result ) = 0 ;
3075 virtual INT32 getReplicaGroup (
const CHAR *pName,
3078 virtual INT32 getReplicaGroup (
const CHAR *pName,
3081 virtual INT32 getReplicaGroup ( INT32
id,
3084 virtual INT32 getReplicaGroup ( INT32
id,
3087 virtual INT32 createReplicaGroup (
const CHAR *pName,
3090 virtual INT32 createReplicaGroup (
const CHAR *pName,
3093 virtual INT32 removeReplicaGroup (
const CHAR *pName ) = 0 ;
3095 virtual INT32 createReplicaCataGroup (
const CHAR *pHostName,
3096 const CHAR *pServiceName,
3097 const CHAR *pDatabasePath,
3098 const bson::BSONObj &configure ) =0 ;
3100 virtual INT32 activateReplicaGroup (
const CHAR *pName,
3102 virtual INT32 activateReplicaGroup (
const CHAR *pName,
3105 virtual INT32 execUpdate(
const CHAR *sql ) = 0 ;
3107 virtual INT32 exec(
const CHAR *sql,
3110 virtual INT32 exec(
const CHAR *sql,
3113 virtual INT32 transactionBegin() = 0 ;
3115 virtual INT32 transactionCommit() = 0 ;
3117 virtual INT32 transactionRollback() = 0 ;
3119 virtual INT32 flushConfigure(
const bson::BSONObj &options ) = 0 ;
3121 virtual INT32 crtJSProcedure (
const CHAR *code ) = 0 ;
3122 virtual INT32 rmProcedure(
const CHAR *spName ) = 0 ;
3123 virtual INT32 listProcedures(
_sdbCursor **cursor,
const bson::BSONObj &condition ) = 0 ;
3124 virtual INT32 listProcedures(
sdbCursor &cursor,
const bson::BSONObj &condition ) = 0 ;
3125 virtual INT32 evalJS(
const CHAR *code,
3128 bson::BSONObj &errmsg ) = 0 ;
3129 virtual INT32 evalJS(
const CHAR *code,
3132 bson::BSONObj &errmsg ) = 0 ;
3135 virtual INT32 backupOffline (
const bson::BSONObj &options) = 0 ;
3136 virtual INT32 listBackup (
_sdbCursor **cursor,
3137 const bson::BSONObj &options,
3138 const bson::BSONObj &condition = _sdbStaticObject,
3139 const bson::BSONObj &selector = _sdbStaticObject,
3140 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
3141 virtual INT32 listBackup (
sdbCursor &cursor,
3142 const bson::BSONObj &options,
3143 const bson::BSONObj &condition = _sdbStaticObject,
3144 const bson::BSONObj &selector = _sdbStaticObject,
3145 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
3146 virtual INT32 removeBackup (
const bson::BSONObj &options ) = 0 ;
3149 virtual INT32 listTasks (
_sdbCursor **cursor,
3150 const bson::BSONObj &condition = _sdbStaticObject,
3151 const bson::BSONObj &selector = _sdbStaticObject,
3152 const bson::BSONObj &orderBy = _sdbStaticObject,
3153 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
3156 virtual INT32 listTasks (
sdbCursor &cursor,
3157 const bson::BSONObj &condition = _sdbStaticObject,
3158 const bson::BSONObj &selector = _sdbStaticObject,
3159 const bson::BSONObj &orderBy = _sdbStaticObject,
3160 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
3162 virtual INT32 waitTasks (
const SINT64 *taskIDs,
3165 virtual INT32 cancelTask ( SINT64 taskID,
3166 BOOLEAN isAsync ) = 0 ;
3168 virtual INT32 setSessionAttr (
const bson::BSONObj &options =
3169 _sdbStaticObject ) = 0 ;
3171 virtual INT32 getSessionAttr ( bson::BSONObj & result ) = 0 ;
3174 virtual INT32 closeAllCursors () = 0 ;
3177 virtual INT32 isValid( BOOLEAN *result ) = 0 ;
3178 virtual BOOLEAN isValid() = 0 ;
3181 virtual INT32 createDomain (
const CHAR *pDomainName,
3182 const bson::BSONObj &options,
3185 virtual INT32 createDomain (
const CHAR *pDomainName,
3186 const bson::BSONObj &options,
3189 virtual INT32 dropDomain (
const CHAR *pDomainName ) = 0 ;
3191 virtual INT32 getDomain (
const CHAR *pDomainName,
3194 virtual INT32 getDomain (
const CHAR *pDomainName,
3197 virtual INT32 listDomains (
_sdbCursor **cursor,
3198 const bson::BSONObj &condition = _sdbStaticObject,
3199 const bson::BSONObj &selector = _sdbStaticObject,
3200 const bson::BSONObj &orderBy = _sdbStaticObject,
3201 const bson::BSONObj &hint = _sdbStaticObject
3204 virtual INT32 listDomains (
sdbCursor &cursor,
3205 const bson::BSONObj &condition = _sdbStaticObject,
3206 const bson::BSONObj &selector = _sdbStaticObject,
3207 const bson::BSONObj &orderBy = _sdbStaticObject,
3208 const bson::BSONObj &hint = _sdbStaticObject
3212 static _sdb *getObj ( BOOLEAN useSSL = FALSE ) ;
3215 virtual UINT64 getLastAliveTime()
const = 0 ;
3226 sdb (
const sdb& other ) ;
3227 sdb& operator=(
const sdb& ) ;
3241 sdb ( BOOLEAN useSSL = FALSE ) :
3242 pSDB (
_sdb::getObj( useSSL ) )
3264 INT32 connect (
const CHAR *pHostName,
3269 return SDB_NOT_CONNECTED ;
3270 return pSDB->
connect ( pHostName, port ) ;
3286 INT32 connect (
const CHAR *pHostName,
3288 const CHAR *pUsrName,
3293 return SDB_NOT_CONNECTED ;
3294 return pSDB->connect ( pHostName, port,
3295 pUsrName, pPasswd ) ;
3307 INT32 connect (
const CHAR *pHostName,
3308 const CHAR *pServiceName
3312 return SDB_NOT_CONNECTED ;
3313 return pSDB->connect ( pHostName, pServiceName ) ;
3329 INT32 connect (
const CHAR *pHostName,
3330 const CHAR *pServiceName,
3331 const CHAR *pUsrName,
3332 const CHAR *pPasswd )
3335 return SDB_NOT_CONNECTED ;
3336 return pSDB->connect ( pHostName, pServiceName,
3337 pUsrName, pPasswd ) ;
3353 INT32 connect (
const CHAR **pConnAddrs,
3355 const CHAR *pUsrName,
3356 const CHAR *pPasswd )
3359 return SDB_NOT_CONNECTED ;
3360 return pSDB->connect ( pConnAddrs, arrSize,
3361 pUsrName, pPasswd ) ;
3384 INT32 createUsr(
const CHAR *pUsrName,
3385 const CHAR *pPasswd,
3386 const bson::BSONObj &options = _sdbStaticObject )
3389 return SDB_NOT_CONNECTED ;
3390 return pSDB->createUsr( pUsrName, pPasswd, options ) ;
3401 INT32 removeUsr(
const CHAR *pUsrName,
3402 const CHAR *pPasswd )
3405 return SDB_NOT_CONNECTED ;
3406 return pSDB->removeUsr( pUsrName, pPasswd ) ;
3416 pSDB->disconnect () ;
3455 const bson::BSONObj &condition = _sdbStaticObject,
3456 const bson::BSONObj &selector = _sdbStaticObject,
3457 const bson::BSONObj &orderBy = _sdbStaticObject,
3458 const bson::BSONObj &hint = _sdbStaticObject,
3459 INT64 numToSkip = 0,
3460 INT64 numToReturn = -1
3465 return SDB_NOT_CONNECTED ;
3468 return pSDB->getSnapshot ( cursor, snapType,
3469 condition, selector, orderBy, hint,
3470 numToSkip, numToReturn ) ;
3510 const bson::BSONObj &condition = _sdbStaticObject,
3511 const bson::BSONObj &selector = _sdbStaticObject,
3512 const bson::BSONObj &orderBy = _sdbStaticObject,
3513 const bson::BSONObj &hint = _sdbStaticObject,
3514 INT64 numToSkip = 0,
3515 INT64 numToReturn = -1
3519 return SDB_NOT_CONNECTED ;
3520 return pSDB->getSnapshot ( cursor, snapType,
3521 condition, selector, orderBy, hint,
3522 numToSkip, numToReturn ) ;
3538 INT32 resetSnapshot (
const bson::BSONObj &condition = _sdbStaticObject )
3541 return SDB_NOT_CONNECTED ;
3542 return pSDB->resetSnapshot ( condition ) ;
3585 const bson::BSONObj &condition = _sdbStaticObject,
3586 const bson::BSONObj &selector = _sdbStaticObject,
3587 const bson::BSONObj &orderBy = _sdbStaticObject,
3588 const bson::BSONObj &hint = _sdbStaticObject,
3589 INT64 numToSkip = 0,
3590 INT64 numToReturn = -1
3594 return SDB_NOT_CONNECTED ;
3595 return pSDB->getList ( cursor,
3597 condition, selector, orderBy, hint,
3598 numToSkip, numToReturn ) ;
3642 const bson::BSONObj &condition = _sdbStaticObject,
3643 const bson::BSONObj &selector = _sdbStaticObject,
3644 const bson::BSONObj &orderBy = _sdbStaticObject,
3645 const bson::BSONObj &hint = _sdbStaticObject,
3646 INT64 numToSkip = 0,
3647 INT64 numToReturn = -1
3652 return SDB_NOT_CONNECTED ;
3655 return pSDB->getList ( cursor,
3657 condition, selector, orderBy, hint,
3658 numToSkip, numToReturn ) ;
3670 INT32 getCollection (
const CHAR *pCollectionFullName,
3675 return SDB_NOT_CONNECTED ;
3676 return pSDB->getCollection ( pCollectionFullName,
3689 INT32 getCollection (
const CHAR *pCollectionFullName,
3695 return SDB_NOT_CONNECTED ;
3698 return pSDB->getCollection ( pCollectionFullName,
3710 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
3715 return SDB_NOT_CONNECTED ;
3716 return pSDB->getCollectionSpace ( pCollectionSpaceName,
3729 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
3735 return SDB_NOT_CONNECTED ;
3738 return pSDB->getCollectionSpace ( pCollectionSpaceName,
3760 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
3766 return SDB_NOT_CONNECTED ;
3767 return pSDB->createCollectionSpace ( pCollectionSpaceName,
3791 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
3798 return SDB_NOT_CONNECTED ;
3801 return pSDB->createCollectionSpace ( pCollectionSpaceName,
3819 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
3820 const bson::BSONObj &options,
3826 return SDB_NOT_CONNECTED ;
3829 return pSDB->createCollectionSpace ( pCollectionSpaceName,
3839 INT32 dropCollectionSpace (
const CHAR *pCollectionSpaceName )
3842 return SDB_NOT_CONNECTED ;
3843 return pSDB->dropCollectionSpace ( pCollectionSpaceName ) ;
3852 INT32 listCollectionSpaces (
_sdbCursor **result )
3855 return SDB_NOT_CONNECTED ;
3856 return pSDB->listCollectionSpaces ( result ) ;
3869 return SDB_NOT_CONNECTED ;
3872 return pSDB->listCollectionSpaces ( result ) ;
3881 INT32 listCollections (
_sdbCursor **result )
3884 return SDB_NOT_CONNECTED ;
3885 return pSDB->listCollections ( result ) ;
3898 return SDB_NOT_CONNECTED ;
3901 return pSDB->listCollections ( result ) ;
3910 INT32 listReplicaGroups (
_sdbCursor **result )
3913 return SDB_NOT_CONNECTED ;
3914 return pSDB->listReplicaGroups ( result ) ;
3928 return SDB_NOT_CONNECTED ;
3931 return pSDB->listReplicaGroups ( result ) ;
3944 return SDB_NOT_CONNECTED ;
3945 return pSDB->getReplicaGroup ( pName, result ) ;
3960 return SDB_NOT_CONNECTED ;
3963 return pSDB->getReplicaGroup ( pName, result ) ;
3976 return SDB_NOT_CONNECTED ;
3977 return pSDB->getReplicaGroup (
id, result ) ;
3991 return SDB_NOT_CONNECTED ;
3994 return pSDB->getReplicaGroup (
id, result ) ;
4004 INT32 createReplicaGroup (
const CHAR *pName,
_sdbReplicaGroup **replicaGroup )
4007 return SDB_NOT_CONNECTED ;
4008 return pSDB->createReplicaGroup ( pName, replicaGroup ) ;
4022 return SDB_NOT_CONNECTED ;
4025 return pSDB->createReplicaGroup ( pName, replicaGroup ) ;
4034 INT32 removeReplicaGroup (
const CHAR *pName )
4037 return SDB_NOT_CONNECTED ;
4038 return pSDB->removeReplicaGroup ( pName ) ;
4053 INT32 createReplicaCataGroup (
const CHAR *pHostName,
4054 const CHAR *pServiceName,
4055 const CHAR *pDatabasePath,
4056 const bson::BSONObj &configure )
4059 return SDB_NOT_CONNECTED ;
4060 return pSDB->createReplicaCataGroup ( pHostName, pServiceName,
4061 pDatabasePath, configure ) ;
4071 INT32 activateReplicaGroup (
const CHAR *pName,
_sdbReplicaGroup **replicaGroup )
4074 return SDB_NOT_CONNECTED ;
4075 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
4089 return SDB_NOT_CONNECTED ;
4092 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
4101 INT32 execUpdate(
const CHAR *sql )
4104 return SDB_NOT_CONNECTED ;
4105 return pSDB->execUpdate( sql ) ;
4116 INT32 exec(
const CHAR *sql,
4120 return SDB_NOT_CONNECTED ;
4121 return pSDB->exec( sql, result ) ;
4132 INT32 exec(
const CHAR *sql,
4137 return SDB_NOT_CONNECTED ;
4140 return pSDB->exec( sql, result ) ;
4148 INT32 transactionBegin()
4151 return SDB_NOT_CONNECTED ;
4152 return pSDB->transactionBegin() ;
4160 INT32 transactionCommit()
4163 return SDB_NOT_CONNECTED ;
4164 return pSDB->transactionCommit() ;
4172 INT32 transactionRollback()
4175 return SDB_NOT_CONNECTED ;
4176 return pSDB->transactionRollback() ;
4187 INT32 flushConfigure(
const bson::BSONObj &options )
4190 return SDB_NOT_CONNECTED ;
4191 return pSDB->flushConfigure( options ) ;
4200 INT32 crtJSProcedure (
const CHAR *code )
4203 return SDB_NOT_CONNECTED ;
4204 return pSDB->crtJSProcedure( code ) ;
4213 INT32 rmProcedure(
const CHAR *spName )
4216 return SDB_NOT_CONNECTED ;
4217 return pSDB->rmProcedure( spName ) ;
4220 INT32 listProcedures(
_sdbCursor **cursor,
const bson::BSONObj &condition )
4223 return SDB_NOT_CONNECTED ;
4224 return pSDB->listProcedures( cursor, condition ) ;
4234 INT32 listProcedures(
sdbCursor &cursor,
const bson::BSONObj &condition )
4238 return SDB_NOT_CONNECTED ;
4241 return pSDB->listProcedures( cursor, condition ) ;
4258 INT32 evalJS(
const CHAR *code,
4261 bson::BSONObj &errmsg )
4264 return SDB_NOT_CONNECTED ;
4265 return pSDB->evalJS( code, type, cursor, errmsg ) ;
4268 INT32 evalJS(
const CHAR *code,
4271 bson::BSONObj &errmsg )
4275 return SDB_NOT_CONNECTED ;
4278 return pSDB->evalJS( code, type, cursor, errmsg ) ;
4299 INT32 backupOffline (
const bson::BSONObj &options)
4302 return SDB_NOT_CONNECTED ;
4303 return pSDB->backupOffline( options ) ;
4307 const bson::BSONObj &options,
4308 const bson::BSONObj &condition = _sdbStaticObject,
4309 const bson::BSONObj &selector = _sdbStaticObject,
4310 const bson::BSONObj &orderBy = _sdbStaticObject)
4313 return SDB_NOT_CONNECTED ;
4314 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
4340 const bson::BSONObj &options,
4341 const bson::BSONObj &condition = _sdbStaticObject,
4342 const bson::BSONObj &selector = _sdbStaticObject,
4343 const bson::BSONObj &orderBy = _sdbStaticObject)
4347 return SDB_NOT_CONNECTED ;
4350 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
4367 INT32 removeBackup (
const bson::BSONObj &options)
4370 return SDB_NOT_CONNECTED ;
4371 return pSDB->removeBackup( options ) ;
4375 const bson::BSONObj &condition = _sdbStaticObject,
4376 const bson::BSONObj &selector = _sdbStaticObject,
4377 const bson::BSONObj &orderBy = _sdbStaticObject,
4378 const bson::BSONObj &hint = _sdbStaticObject)
4381 return SDB_NOT_CONNECTED ;
4382 return pSDB->listTasks ( cursor,
4406 const bson::BSONObj &condition = _sdbStaticObject,
4407 const bson::BSONObj &selector = _sdbStaticObject,
4408 const bson::BSONObj &orderBy = _sdbStaticObject,
4409 const bson::BSONObj &hint = _sdbStaticObject)
4413 return SDB_NOT_CONNECTED ;
4416 return pSDB->listTasks ( cursor,
4431 INT32 waitTasks (
const SINT64 *taskIDs,
4435 return SDB_NOT_CONNECTED ;
4436 return pSDB->waitTasks ( taskIDs,
4449 INT32 cancelTask ( SINT64 taskID,
4453 return SDB_NOT_CONNECTED ;
4454 return pSDB->cancelTask ( taskID,
4479 INT32 setSessionAttr (
const bson::BSONObj &options = _sdbStaticObject )
4482 return SDB_NOT_CONNECTED ;
4483 return pSDB->setSessionAttr ( options ) ;
4492 INT32 getSessionAttr ( bson::BSONObj & result )
4496 return SDB_NOT_CONNECTED ;
4498 return pSDB->getSessionAttr( result ) ;
4507 INT32 closeAllCursors ()
4510 return SDB_NOT_CONNECTED ;
4511 return pSDB->closeAllCursors () ;
4521 INT32 isValid ( BOOLEAN *result )
4524 return SDB_NOT_CONNECTED ;
4525 return pSDB->isValid ( result ) ;
4537 return pSDB->isValid () ;
4558 INT32 createDomain (
const CHAR *pDomainName,
4559 const bson::BSONObj &options,
4564 return SDB_NOT_CONNECTED ;
4567 return pSDB->createDomain ( pDomainName, options, domain ) ;
4569 INT32 dropDomain (
const CHAR *pDomainName )
4578 return SDB_NOT_CONNECTED ;
4579 return pSDB->dropDomain ( pDomainName ) ;
4590 INT32 getDomain (
const CHAR *pDomainName,
4595 return SDB_NOT_CONNECTED ;
4598 return pSDB->getDomain ( pDomainName, domain ) ;
4619 const bson::BSONObj &condition = _sdbStaticObject,
4620 const bson::BSONObj &selector = _sdbStaticObject,
4621 const bson::BSONObj &orderBy = _sdbStaticObject,
4622 const bson::BSONObj &hint = _sdbStaticObject )
4626 return SDB_NOT_CONNECTED ;
4629 return pSDB->listDomains ( cursor, condition, selector, orderBy, hint ) ;
4641 return SDB_NOT_CONNECTED ;
4644 return pSDB->getDC ( dc ) ;