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"
41 #define RELEASE_INNER_HANDLE( handle ) \
51 #define DLLEXPORT SDB_EXPORT
54 #define SDB_PAGESIZE_4K 4096
56 #define SDB_PAGESIZE_8K 8192
58 #define SDB_PAGESIZE_16K 16384
60 #define SDB_PAGESIZE_32K 32768
62 #define SDB_PAGESIZE_64K 65536
64 #define SDB_PAGESIZE_DEFAULT 0
68 #define FLG_INSERT_CONTONDUP 0x00000001
70 #define FLG_INSERT_RETURNNUM 0x00000002
72 #define FLG_INSERT_REPLACEONDUP 0x00000004
74 #define FLG_INSERT_UPDATEONDUP 0x00000008
78 #define FLG_INSERT_CONTONDUP_ID 0x00000020
81 #define FLG_INSERT_REPLACEONDUP_ID 0x00000040
83 #define FLG_INSERT_RETURN_OID 0x10000000
90 #define SDB_CLIENT_SOCKET_TIMEOUT_DFT 10000
93 #define sdbReplicaNode sdbNode
96 #define QUERY_FORCE_HINT 0x00000080
98 #define QUERY_PARALLED 0x00000100
100 #define QUERY_WITH_RETURNDATA 0x00000200
102 #define QUERY_PREPARE_MORE 0x00004000
104 #define QUERY_KEEP_SHARDINGKEY_IN_UPDATE 0x00008000
109 #define QUERY_FOR_UPDATE 0x00010000
114 #define QUERY_FOR_SHARE 0x00040000
118 #define UPDATE_KEEP_SHARDINGKEY QUERY_KEEP_SHARDINGKEY_IN_UPDATE
120 #define UPDATE_ONE 0x00000002
122 #define UPDATE_RETURNNUM 0x00000004
125 #define FLG_DELETE_ONE 0x00000002
127 #define FLG_DELETE_RETURNNUM 0x00000004
129 #define SDB_INDEX_SORT_BUFFER_DEFAULT_SIZE 64
159 const static bson::BSONObj _sdbStaticObject ;
160 const static bson::OID _sdbStaticOid ;
161 const static std::vector<INT32> _sdbStaticVec ;
162 const static std::vector<UINT32> _sdbStaticUINT32Vec ;
164 class _sdbCollection ;
174 const CHAR *pDescription,
175 const CHAR *pDetail ) ;
183 class DLLEXPORT _sdbCursor
186 _sdbCursor (
const _sdbCursor& other ) ;
187 _sdbCursor& operator=(
const _sdbCursor& ) ;
190 virtual ~_sdbCursor () {}
191 virtual INT32 next ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE ) = 0 ;
192 virtual INT32 current ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE ) = 0 ;
193 virtual INT32 close () = 0 ;
194 virtual INT32 advance (
const bson::BSONObj &option,
195 bson::BSONObj *pResult = NULL ) = 0 ;
250 INT32 next ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE )
254 return SDB_NOT_CONNECTED ;
256 return pCursor->
next ( obj, getOwned ) ;
275 INT32 current ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE )
279 return SDB_NOT_CONNECTED ;
281 return pCursor->current ( obj, getOwned ) ;
291 INT32 advance (
const bson::BSONObj &option, bson::BSONObj *pResult = NULL )
295 return SDB_NOT_CONNECTED ;
297 return pCursor->advance( option, pResult ) ;
311 return pCursor->close () ;
315 class DLLEXPORT _sdbCollection
318 _sdbCollection (
const _sdbCollection& other ) ;
319 _sdbCollection& operator=(
const _sdbCollection& ) ;
322 virtual ~_sdbCollection () {}
325 virtual INT32 getCount ( SINT64 &count,
326 const bson::BSONObj &condition = _sdbStaticObject,
327 const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
332 virtual INT32 insert (
const bson::BSONObj &obj, bson::OID *
id = NULL ) = 0 ;
333 virtual INT32 insert (
const bson::BSONObj &obj,
335 bson::BSONObj *pResult = NULL ) = 0 ;
336 virtual INT32 insert (
const bson::BSONObj &obj,
337 const bson::BSONObj &hint,
339 bson::BSONObj *pResult = NULL ) = 0 ;
340 virtual INT32 insert ( std::vector<bson::BSONObj> &objs,
342 bson::BSONObj *pResult = NULL ) = 0 ;
343 virtual INT32 insert ( std::vector<bson::BSONObj> &objs,
344 const bson::BSONObj &hint,
346 bson::BSONObj *pResult = NULL ) = 0 ;
347 virtual INT32 insert (
const bson::BSONObj objs[],
350 bson::BSONObj *pResult = NULL ) = 0 ;
351 virtual INT32 bulkInsert ( SINT32 flags,
352 std::vector<bson::BSONObj> &obj
361 virtual INT32 update (
const bson::BSONObj &rule,
362 const bson::BSONObj &condition = _sdbStaticObject,
363 const bson::BSONObj &hint = _sdbStaticObject,
365 bson::BSONObj *pResult = NULL
377 virtual INT32 upsert (
const bson::BSONObj &rule,
378 const bson::BSONObj &condition = _sdbStaticObject,
379 const bson::BSONObj &hint = _sdbStaticObject,
380 const bson::BSONObj &setOnInsert = _sdbStaticObject,
382 bson::BSONObj *pResult = NULL
391 virtual INT32 del (
const bson::BSONObj &condition = _sdbStaticObject,
392 const bson::BSONObj &hint = _sdbStaticObject,
394 bson::BSONObj *pResult = NULL
404 virtual INT32 query ( _sdbCursor **cursor,
405 const bson::BSONObj &condition = _sdbStaticObject,
406 const bson::BSONObj &selected = _sdbStaticObject,
407 const bson::BSONObj &orderBy = _sdbStaticObject,
408 const bson::BSONObj &hint = _sdbStaticObject,
410 INT64 numToReturn = -1,
414 virtual INT32 query ( sdbCursor &cursor,
415 const bson::BSONObj &condition = _sdbStaticObject,
416 const bson::BSONObj &selected = _sdbStaticObject,
417 const bson::BSONObj &orderBy = _sdbStaticObject,
418 const bson::BSONObj &hint = _sdbStaticObject,
420 INT64 numToReturn = -1,
424 virtual INT32 queryOne( bson::BSONObj &obj,
425 const bson::BSONObj &condition = _sdbStaticObject,
426 const bson::BSONObj &selected = _sdbStaticObject,
427 const bson::BSONObj &orderBy = _sdbStaticObject,
428 const bson::BSONObj &hint = _sdbStaticObject,
430 INT32 flags = 0 ) = 0 ;
442 virtual INT32 queryAndUpdate ( _sdbCursor **cursor,
443 const bson::BSONObj &update,
444 const bson::BSONObj &condition = _sdbStaticObject,
445 const bson::BSONObj &selected = _sdbStaticObject,
446 const bson::BSONObj &orderBy = _sdbStaticObject,
447 const bson::BSONObj &hint = _sdbStaticObject,
449 INT64 numToReturn = -1,
451 BOOLEAN returnNew = FALSE
462 virtual INT32 queryAndRemove ( _sdbCursor **cursor,
463 const bson::BSONObj &condition = _sdbStaticObject,
464 const bson::BSONObj &selected = _sdbStaticObject,
465 const bson::BSONObj &orderBy = _sdbStaticObject,
466 const bson::BSONObj &hint = _sdbStaticObject,
468 INT64 numToReturn = -1,
479 virtual INT32 createIndex (
const bson::BSONObj &indexDef,
483 INT32 sortBufferSize ) = 0 ;
484 virtual INT32 createIndex (
const bson::BSONObj &indexDef,
486 const bson::BSONObj &indexAttr = _sdbStaticObject,
487 const bson::BSONObj &option = _sdbStaticObject
489 virtual INT32 createIndexAsync ( SINT64 &taskID,
490 const bson::BSONObj &indexDef,
492 const bson::BSONObj &indexAttr = _sdbStaticObject,
493 const bson::BSONObj &option = _sdbStaticObject
495 virtual INT32 snapshotIndexes ( _sdbCursor **cursor,
496 const bson::BSONObj &condition = _sdbStaticObject,
497 const bson::BSONObj &selector = _sdbStaticObject,
498 const bson::BSONObj &orderby = _sdbStaticObject,
499 const bson::BSONObj &hint = _sdbStaticObject,
501 INT64 numToReturn = -1 ) = 0 ;
502 virtual INT32 getIndexes ( _sdbCursor **cursor,
503 const CHAR *pName ) = 0 ;
504 virtual INT32 getIndexes ( sdbCursor &cursor,
505 const CHAR *pIndexName ) = 0 ;
506 virtual INT32 getIndexes ( std::vector<bson::BSONObj> &infos ) = 0 ;
507 virtual INT32 getIndex (
const CHAR *pIndexName, bson::BSONObj &info ) = 0 ;
508 virtual INT32 dropIndex (
const CHAR *pIndexName ) = 0 ;
509 virtual INT32 dropIndexAsync ( SINT64 &taskID,
510 const CHAR *pIndexName ) = 0 ;
511 virtual INT32 copyIndex (
const CHAR *subClFullName,
512 const CHAR *pIndexName ) = 0 ;
513 virtual INT32 copyIndexAsync ( SINT64 &taskID,
514 const CHAR *subClFullName,
515 const CHAR *pIndexName ) = 0 ;
516 virtual INT32 create () = 0 ;
517 virtual INT32 drop () = 0 ;
518 virtual const CHAR *getCollectionName () = 0 ;
519 virtual const CHAR *getCSName () = 0 ;
520 virtual const CHAR *getFullName () = 0 ;
521 virtual INT32 split (
const CHAR *pSourceGroupName,
522 const CHAR *pTargetGroupName,
523 const bson::BSONObj &splitConditon,
524 const bson::BSONObj &splitEndCondition = _sdbStaticObject) = 0 ;
525 virtual INT32 split (
const CHAR *pSourceGroupName,
526 const CHAR *pTargetGroupName,
527 FLOAT64 percent ) = 0 ;
528 virtual INT32 splitAsync ( SINT64 &taskID,
529 const CHAR *pSourceGroupName,
530 const CHAR *pTargetGroupName,
531 const bson::BSONObj &splitCondition,
532 const bson::BSONObj &splitEndCondition = _sdbStaticObject) = 0 ;
533 virtual INT32 splitAsync (
const CHAR *pSourceGroupName,
534 const CHAR *pTargetGroupName,
536 SINT64 &taskID ) = 0 ;
537 virtual INT32 aggregate ( _sdbCursor **cursor,
538 std::vector<bson::BSONObj> &obj
540 virtual INT32 aggregate ( sdbCursor &cursor,
541 std::vector<bson::BSONObj> &obj
543 virtual INT32 getQueryMeta ( _sdbCursor **cursor,
544 const bson::BSONObj &condition = _sdbStaticObject,
545 const bson::BSONObj &orderBy = _sdbStaticObject,
546 const bson::BSONObj &hint = _sdbStaticObject,
548 INT64 numToReturn = -1
550 virtual INT32 getQueryMeta ( sdbCursor &cursor,
551 const bson::BSONObj &condition = _sdbStaticObject,
552 const bson::BSONObj &orderBy = _sdbStaticObject,
553 const bson::BSONObj &hint = _sdbStaticObject,
555 INT64 numToReturn = -1
557 virtual INT32 attachCollection (
const CHAR *subClFullName,
558 const bson::BSONObj &options) = 0 ;
559 virtual INT32 detachCollection (
const CHAR *subClFullName) = 0 ;
561 virtual INT32 alterCollection (
const bson::BSONObj &options ) = 0 ;
563 virtual INT32 explain ( sdbCursor &cursor,
564 const bson::BSONObj &condition = _sdbStaticObject,
565 const bson::BSONObj &select = _sdbStaticObject,
566 const bson::BSONObj &orderBy = _sdbStaticObject,
567 const bson::BSONObj &hint = _sdbStaticObject,
569 INT64 numToReturn = -1,
571 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
573 virtual INT32 explain ( _sdbCursor **cursor,
574 const bson::BSONObj &condition = _sdbStaticObject,
575 const bson::BSONObj &select = _sdbStaticObject,
576 const bson::BSONObj &orderBy = _sdbStaticObject,
577 const bson::BSONObj &hint = _sdbStaticObject,
579 INT64 numToReturn = -1,
581 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
583 virtual INT32 createLob( sdbLob &lob,
const bson::OID *oid = NULL ) = 0 ;
585 virtual INT32 removeLob(
const bson::OID &oid ) = 0 ;
587 virtual INT32 truncateLob(
const bson::OID &oid, INT64 length ) = 0 ;
589 virtual INT32 openLob( sdbLob &lob,
const bson::OID &oid,
592 virtual INT32 openLob( sdbLob &lob,
const bson::OID &oid,
595 virtual INT32 listLobs( sdbCursor &cursor,
596 const bson::BSONObj &condition = _sdbStaticObject,
597 const bson::BSONObj &selected = _sdbStaticObject,
598 const bson::BSONObj &orderBy = _sdbStaticObject,
599 const bson::BSONObj &hint = _sdbStaticObject,
601 INT64 numToReturn = -1 ) = 0 ;
603 virtual INT32 listLobs( _sdbCursor **cursor,
604 const bson::BSONObj &condition = _sdbStaticObject,
605 const bson::BSONObj &selected = _sdbStaticObject,
606 const bson::BSONObj &orderBy = _sdbStaticObject,
607 const bson::BSONObj &hint = _sdbStaticObject,
609 INT64 numToReturn = -1 ) = 0 ;
611 virtual INT32 createLobID( bson::OID &oid,
const CHAR *pTimeStamp = NULL ) = 0 ;
613 virtual INT32 listLobPieces(
615 const bson::BSONObj &condition = _sdbStaticObject,
616 const bson::BSONObj &selected = _sdbStaticObject,
617 const bson::BSONObj &orderBy = _sdbStaticObject,
618 const bson::BSONObj &hint = _sdbStaticObject,
620 INT64 numToReturn = -1 ) = 0 ;
622 virtual INT32 listLobPieces(
624 const bson::BSONObj &condition = _sdbStaticObject,
625 const bson::BSONObj &selected = _sdbStaticObject,
626 const bson::BSONObj &orderBy = _sdbStaticObject,
627 const bson::BSONObj &hint = _sdbStaticObject,
629 INT64 numToReturn = -1 ) = 0 ;
632 virtual INT32 truncate(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
635 virtual INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
637 virtual INT32 dropIdIndex() = 0 ;
639 virtual INT32 createAutoIncrement(
const bson::BSONObj &options ) = 0;
641 virtual INT32 createAutoIncrement(
const std::vector<bson::BSONObj> &options ) = 0;
643 virtual INT32 dropAutoIncrement(
const CHAR *fieldName ) = 0;
645 virtual INT32 dropAutoIncrement(
const std::vector<const CHAR*> &fieldNames ) = 0;
647 virtual INT32 pop (
const bson::BSONObj &option = _sdbStaticObject ) = 0 ;
649 virtual INT32 enableSharding (
const bson::BSONObj &options ) = 0 ;
651 virtual INT32 disableSharding () = 0 ;
653 virtual INT32 enableCompression (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
655 virtual INT32 disableCompression () = 0 ;
657 virtual INT32 setAttributes (
const bson::BSONObj &options ) = 0 ;
659 virtual INT32 getDetail ( _sdbCursor **cursor ) = 0 ;
661 virtual INT32 getDetail ( sdbCursor &cursor ) = 0 ;
663 virtual INT32 getCollectionStat ( bson::BSONObj &result ) = 0 ;
665 virtual INT32 getIndexStat (
const CHAR *pIndexName,
666 bson::BSONObj &result,
667 BOOLEAN detail = FALSE ) = 0 ;
669 virtual void setVersion( INT32 clVersion ) = 0;
670 virtual INT32 getVersion() = 0;
671 virtual INT32 setConsistencyStrategy( INT32 value ) = 0 ;
733 INT32 getCount ( SINT64 &count,
734 const bson::BSONObj &condition = _sdbStaticObject,
735 const bson::BSONObj &hint = _sdbStaticObject )
739 return SDB_NOT_CONNECTED ;
741 return pCollection->
getCount ( count, condition, hint ) ;
761 INT32 split (
const CHAR *pSourceGroupName,
762 const CHAR *pTargetGroupName,
763 const bson::BSONObj &splitCondition,
764 const bson::BSONObj &splitEndCondition = _sdbStaticObject)
768 return SDB_NOT_CONNECTED ;
770 return pCollection->split ( pSourceGroupName,
787 INT32 split (
const CHAR *pSourceGroupName,
788 const CHAR *pTargetGroupName,
793 return SDB_NOT_CONNECTED ;
795 return pCollection->split ( pSourceGroupName,
819 INT32 splitAsync ( SINT64 &taskID,
820 const CHAR *pSourceGroupName,
821 const CHAR *pTargetGroupName,
822 const bson::BSONObj &splitCondition,
823 const bson::BSONObj &splitEndCondition = _sdbStaticObject )
827 return SDB_NOT_CONNECTED ;
829 return pCollection->splitAsync ( taskID,
833 splitEndCondition ) ;
849 INT32 splitAsync (
const CHAR *pSourceGroupName,
850 const CHAR *pTargetGroupName,
856 return SDB_NOT_CONNECTED ;
858 return pCollection->splitAsync ( pSourceGroupName,
890 INT32 alterCollection (
const bson::BSONObj &options )
894 return SDB_NOT_CONNECTED ;
896 return pCollection->alterCollection ( options ) ;
921 INT32 insert (
const bson::BSONObj &obj, bson::OID *pId = NULL )
925 return SDB_NOT_CONNECTED ;
927 return pCollection->insert ( obj, pId ) ;
976 INT32 insert (
const bson::BSONObj &obj,
978 bson::BSONObj *pResult = NULL )
982 return SDB_NOT_CONNECTED ;
984 return pCollection->insert ( obj, flags, pResult ) ;
1043 INT32 insert (
const bson::BSONObj &obj,
1044 const bson::BSONObj &hint,
1046 bson::BSONObj *pResult = NULL )
1050 return SDB_NOT_CONNECTED ;
1052 return pCollection->insert ( obj, hint, flags, pResult ) ;
1104 INT32 insert ( std::vector<bson::BSONObj> &objs,
1106 bson::BSONObj *pResult = NULL )
1110 return SDB_NOT_CONNECTED ;
1112 return pCollection->insert( objs, flags, pResult ) ;
1169 INT32 insert ( std::vector<bson::BSONObj> &objs,
1170 const bson::BSONObj &hint,
1172 bson::BSONObj *pResult = NULL )
1176 return SDB_NOT_CONNECTED ;
1178 return pCollection->insert( objs, hint, flags, pResult ) ;
1232 INT32 insert (
const bson::BSONObj objs[],
1235 bson::BSONObj *pResult = NULL )
1239 return SDB_NOT_CONNECTED ;
1241 return pCollection->insert ( objs, size, flags, pResult ) ;
1271 INT32 bulkInsert ( SINT32 flags,
1272 std::vector<bson::BSONObj> &objs )
1276 return SDB_NOT_CONNECTED ;
1278 return pCollection->bulkInsert ( flags, objs ) ;
1313 INT32 update (
const bson::BSONObj &rule,
1314 const bson::BSONObj &condition = _sdbStaticObject,
1315 const bson::BSONObj &hint = _sdbStaticObject,
1317 bson::BSONObj *pResult = NULL
1322 return SDB_NOT_CONNECTED ;
1324 return pCollection->update ( rule, condition, hint, flag, pResult ) ;
1360 INT32 upsert (
const bson::BSONObj &rule,
1361 const bson::BSONObj &condition = _sdbStaticObject,
1362 const bson::BSONObj &hint = _sdbStaticObject,
1363 const bson::BSONObj &setOnInsert = _sdbStaticObject,
1365 bson::BSONObj *pResult = NULL
1370 return SDB_NOT_CONNECTED ;
1372 return pCollection->upsert ( rule, condition, hint, setOnInsert,
1397 INT32 del (
const bson::BSONObj &condition = _sdbStaticObject,
1398 const bson::BSONObj &hint = _sdbStaticObject,
1400 bson::BSONObj *pResult = NULL
1405 return SDB_NOT_CONNECTED ;
1407 return pCollection->del ( condition, hint, flag, pResult ) ;
1440 INT32 query ( _sdbCursor **cursor,
1441 const bson::BSONObj &condition = _sdbStaticObject,
1442 const bson::BSONObj &selected = _sdbStaticObject,
1443 const bson::BSONObj &orderBy = _sdbStaticObject,
1444 const bson::BSONObj &hint = _sdbStaticObject,
1445 INT64 numToSkip = 0,
1446 INT64 numToReturn = -1,
1452 return SDB_NOT_CONNECTED ;
1454 return pCollection->query ( cursor, condition, selected, orderBy,
1455 hint, numToSkip, numToReturn, flags ) ;
1489 const bson::BSONObj &condition = _sdbStaticObject,
1490 const bson::BSONObj &selected = _sdbStaticObject,
1491 const bson::BSONObj &orderBy = _sdbStaticObject,
1492 const bson::BSONObj &hint = _sdbStaticObject,
1493 INT64 numToSkip = 0,
1494 INT64 numToReturn = -1,
1500 return SDB_NOT_CONNECTED ;
1503 return pCollection->query ( cursor, condition, selected, orderBy,
1504 hint, numToSkip, numToReturn, flags ) ;
1535 INT32 queryOne( bson::BSONObj &obj,
1536 const bson::BSONObj &condition = _sdbStaticObject,
1537 const bson::BSONObj &selected = _sdbStaticObject,
1538 const bson::BSONObj &orderBy = _sdbStaticObject,
1539 const bson::BSONObj &hint = _sdbStaticObject,
1540 INT64 numToSkip = 0,
1545 return SDB_NOT_CONNECTED ;
1547 return pCollection->queryOne( obj, condition, selected, orderBy,
1548 hint, numToSkip, flag ) ;
1587 const bson::BSONObj &update,
1588 const bson::BSONObj &condition = _sdbStaticObject,
1589 const bson::BSONObj &selected = _sdbStaticObject,
1590 const bson::BSONObj &orderBy = _sdbStaticObject,
1591 const bson::BSONObj &hint = _sdbStaticObject,
1592 INT64 numToSkip = 0,
1593 INT64 numToReturn = -1,
1595 BOOLEAN returnNew = FALSE
1600 return SDB_NOT_CONNECTED ;
1603 return pCollection->queryAndUpdate( &cursor.
pCursor , update, condition,
1604 selected, orderBy, hint,
1605 numToSkip, numToReturn, flag, returnNew ) ;
1639 const bson::BSONObj &condition = _sdbStaticObject,
1640 const bson::BSONObj &selected = _sdbStaticObject,
1641 const bson::BSONObj &orderBy = _sdbStaticObject,
1642 const bson::BSONObj &hint = _sdbStaticObject,
1643 INT64 numToSkip = 0,
1644 INT64 numToReturn = -1,
1650 return SDB_NOT_CONNECTED ;
1653 return pCollection->queryAndRemove( &cursor.
pCursor , condition,
1654 selected, orderBy, hint,
1655 numToSkip, numToReturn, flag ) ;
1674 INT32 createIndex (
const bson::BSONObj &indexDef,
1675 const CHAR *pIndexName,
1678 INT32 sortBufferSize =
1679 SDB_INDEX_SORT_BUFFER_DEFAULT_SIZE )
1683 return SDB_NOT_CONNECTED ;
1685 return pCollection->createIndex ( indexDef, pIndexName, isUnique,
1686 isEnforced, sortBufferSize ) ;
1715 INT32 createIndex (
const bson::BSONObj &indexDef,
1716 const CHAR *pIndexName,
1717 const bson::BSONObj &indexAttr = _sdbStaticObject,
1718 const bson::BSONObj &option = _sdbStaticObject )
1721 return SDB_NOT_CONNECTED ;
1722 return pCollection->createIndex ( indexDef, pIndexName,
1723 indexAttr, option ) ;
1749 INT32 createIndexAsync ( SINT64 &taskID,
1750 const bson::BSONObj &indexDef,
1751 const CHAR *pIndexName,
1752 const bson::BSONObj &indexAttr = _sdbStaticObject,
1753 const bson::BSONObj &option = _sdbStaticObject )
1757 return SDB_NOT_CONNECTED ;
1759 return pCollection->createIndexAsync ( taskID, indexDef, pIndexName,
1760 indexAttr, option ) ;
1781 INT32 snapshotIndexes ( _sdbCursor **cursor,
1782 const bson::BSONObj &condition = _sdbStaticObject,
1783 const bson::BSONObj &selector = _sdbStaticObject,
1784 const bson::BSONObj &orderby = _sdbStaticObject,
1785 const bson::BSONObj &hint = _sdbStaticObject,
1786 INT64 numToSkip = 0,
1787 INT64 numToReturn = -1 )
1791 return SDB_NOT_CONNECTED ;
1793 return pCollection->snapshotIndexes ( cursor, condition,
1794 selector, orderby, hint,
1795 numToSkip, numToReturn ) ;
1806 INT32 getIndexes ( _sdbCursor **cursor,
1807 const CHAR *pIndexName )
1811 return SDB_NOT_CONNECTED ;
1813 return pCollection->getIndexes ( cursor, pIndexName ) ;
1826 const CHAR *pIndexName )
1830 return SDB_NOT_CONNECTED ;
1833 return pCollection->getIndexes ( cursor, pIndexName ) ;
1842 INT32 getIndexes ( std::vector<bson::BSONObj> &infos )
1846 return SDB_NOT_CONNECTED ;
1848 return pCollection->getIndexes ( infos ) ;
1858 INT32 getIndex (
const CHAR *pIndexName, bson::BSONObj &info )
1862 return SDB_NOT_CONNECTED ;
1864 return pCollection->getIndex ( pIndexName, info ) ;
1873 INT32 dropIndex (
const CHAR *pIndexName )
1877 return SDB_NOT_CONNECTED ;
1879 return pCollection->dropIndex ( pIndexName ) ;
1890 INT32 dropIndexAsync ( SINT64 &taskID,
const CHAR *pIndexName )
1893 return SDB_NOT_CONNECTED ;
1894 return pCollection->dropIndexAsync ( taskID, pIndexName ) ;
1905 INT32 copyIndex (
const CHAR *subClFullName,
const CHAR *pIndexName )
1908 return SDB_NOT_CONNECTED ;
1909 return pCollection->copyIndex ( subClFullName, pIndexName ) ;
1922 INT32 copyIndexAsync ( SINT64 &taskID,
const CHAR *subClFullName,
1923 const CHAR *pIndexName )
1926 return SDB_NOT_CONNECTED ;
1927 return pCollection->copyIndexAsync ( taskID, subClFullName,
1941 return SDB_NOT_CONNECTED ;
1943 return pCollection->create () ;
1956 return SDB_NOT_CONNECTED ;
1958 return pCollection->drop () ;
1965 const CHAR *getCollectionName ()
1971 return pCollection->getCollectionName () ;
1978 const CHAR *getCSName ()
1984 return pCollection->getCSName () ;
1991 const CHAR *getFullName ()
1997 return pCollection->getFullName () ;
2009 INT32 aggregate ( _sdbCursor **cursor,
2010 std::vector<bson::BSONObj> &obj
2015 return SDB_NOT_CONNECTED ;
2017 return pCollection->aggregate ( cursor, obj ) ;
2030 std::vector<bson::BSONObj> &obj
2035 return SDB_NOT_CONNECTED ;
2038 return pCollection->aggregate ( cursor, obj ) ;
2060 INT32 getQueryMeta ( _sdbCursor **cursor,
2061 const bson::BSONObj &condition = _sdbStaticObject,
2062 const bson::BSONObj &orderBy = _sdbStaticObject,
2063 const bson::BSONObj &hint = _sdbStaticObject,
2064 INT64 numToSkip = 0,
2065 INT64 numToReturn = -1 )
2069 return SDB_NOT_CONNECTED ;
2071 return pCollection->getQueryMeta ( cursor, condition, orderBy,
2072 hint, numToSkip, numToReturn ) ;
2096 const bson::BSONObj &condition = _sdbStaticObject,
2097 const bson::BSONObj &orderBy = _sdbStaticObject,
2098 const bson::BSONObj &hint = _sdbStaticObject,
2099 INT64 numToSkip = 0,
2100 INT64 numToReturn = -1 )
2104 return SDB_NOT_CONNECTED ;
2107 return pCollection->getQueryMeta ( cursor, condition, orderBy,
2108 hint, numToSkip, numToReturn ) ;
2124 INT32 attachCollection (
const CHAR *subClFullName,
2125 const bson::BSONObj &options )
2129 return SDB_NOT_CONNECTED ;
2131 return pCollection->attachCollection ( subClFullName, options ) ;
2140 INT32 detachCollection (
const CHAR *subClFullName )
2144 return SDB_NOT_CONNECTED ;
2146 return pCollection->detachCollection ( subClFullName ) ;
2185 const bson::BSONObj &condition = _sdbStaticObject,
2186 const bson::BSONObj &select = _sdbStaticObject,
2187 const bson::BSONObj &orderBy = _sdbStaticObject,
2188 const bson::BSONObj &hint = _sdbStaticObject,
2189 INT64 numToSkip = 0,
2190 INT64 numToReturn = -1,
2192 const bson::BSONObj &options = _sdbStaticObject )
2196 return SDB_NOT_CONNECTED ;
2199 return pCollection->explain( cursor, condition, select, orderBy, hint,
2200 numToSkip, numToReturn, flag, options ) ;
2203 INT32 explain ( _sdbCursor **cursor,
2204 const bson::BSONObj &condition = _sdbStaticObject,
2205 const bson::BSONObj &select = _sdbStaticObject,
2206 const bson::BSONObj &orderBy = _sdbStaticObject,
2207 const bson::BSONObj &hint = _sdbStaticObject,
2208 INT64 numToSkip = 0,
2209 INT64 numToReturn = -1,
2211 const bson::BSONObj &options = _sdbStaticObject )
2215 return SDB_NOT_CONNECTED ;
2217 return pCollection->explain( cursor, condition, select, orderBy, hint,
2218 numToSkip, numToReturn, flag, options ) ;
2229 INT32 createLob(
sdbLob &lob,
const bson::OID *oid = NULL )
2233 return SDB_NOT_CONNECTED ;
2235 return pCollection->createLob( lob, oid ) ;
2244 INT32 removeLob(
const bson::OID &oid )
2248 return SDB_NOT_CONNECTED ;
2250 return pCollection->removeLob( oid ) ;
2260 INT32 truncateLob(
const bson::OID &oid, INT64 length )
2264 return SDB_NOT_CONNECTED ;
2266 return pCollection->truncateLob( oid, length ) ;
2278 INT32 openLob(
sdbLob &lob,
const bson::OID &oid,
2283 return SDB_NOT_CONNECTED ;
2285 return pCollection->openLob( lob, oid, mode ) ;
2297 INT32 openLob(
sdbLob &lob,
const bson::OID &oid, INT32 mode )
2301 return SDB_NOT_CONNECTED ;
2303 return pCollection->openLob( lob, oid, mode ) ;
2324 const bson::BSONObj &condition = _sdbStaticObject,
2325 const bson::BSONObj &selected = _sdbStaticObject,
2326 const bson::BSONObj &orderBy = _sdbStaticObject,
2327 const bson::BSONObj &hint = _sdbStaticObject,
2328 INT64 numToSkip = 0,
2329 INT64 numToReturn = -1 )
2333 return SDB_NOT_CONNECTED ;
2336 return pCollection->listLobs( cursor, condition, selected, orderBy,
2337 hint, numToSkip, numToReturn ) ;
2340 INT32 listLobs( _sdbCursor **cursor,
2341 const bson::BSONObj &condition = _sdbStaticObject,
2342 const bson::BSONObj &selected = _sdbStaticObject,
2343 const bson::BSONObj &orderBy = _sdbStaticObject,
2344 const bson::BSONObj &hint = _sdbStaticObject,
2345 INT64 numToSkip = 0,
2346 INT64 numToReturn = -1 )
2350 return SDB_NOT_CONNECTED ;
2352 return pCollection->listLobs( cursor, condition, selected, orderBy,
2353 hint, numToSkip, numToReturn ) ;
2364 INT32 createLobID( bson::OID &oid,
const CHAR *pTimeStamp = NULL )
2368 return SDB_NOT_CONNECTED ;
2370 return pCollection->createLobID( oid, pTimeStamp ) ;
2380 INT32 truncate(
const bson::BSONObj &options = _sdbStaticObject )
2384 return SDB_NOT_CONNECTED ;
2386 return pCollection->truncate( options ) ;
2398 INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject )
2402 return SDB_NOT_CONNECTED ;
2404 return pCollection->createIdIndex( options ) ;
2417 return SDB_NOT_CONNECTED ;
2419 return pCollection->dropIdIndex() ;
2439 INT32 createAutoIncrement (
const bson::BSONObj &options )
2443 return SDB_NOT_CONNECTED ;
2445 return pCollection->createAutoIncrement( options ) ;
2454 INT32 createAutoIncrement (
const std::vector<bson::BSONObj> &options )
2458 return SDB_NOT_CONNECTED ;
2460 return pCollection->createAutoIncrement( options ) ;
2469 INT32 dropAutoIncrement (
const CHAR * fieldName )
2473 return SDB_NOT_CONNECTED ;
2475 return pCollection->dropAutoIncrement( fieldName ) ;
2484 INT32 dropAutoIncrement (
const std::vector<const CHAR*> &fieldNames )
2488 return SDB_NOT_CONNECTED ;
2490 return pCollection->dropAutoIncrement( fieldNames ) ;
2506 INT32 enableSharding (
const bson::BSONObj & options = _sdbStaticObject )
2510 return SDB_NOT_CONNECTED ;
2512 return pCollection->enableSharding( options ) ;
2520 INT32 disableSharding ()
2524 return SDB_NOT_CONNECTED ;
2526 return pCollection->disableSharding() ;
2537 INT32 enableCompression (
const bson::BSONObj & options = _sdbStaticObject )
2541 return SDB_NOT_CONNECTED ;
2543 return pCollection->enableCompression( options ) ;
2551 INT32 disableCompression ()
2555 return SDB_NOT_CONNECTED ;
2557 return pCollection->disableCompression() ;
2580 INT32 setAttributes (
const bson::BSONObj &options )
2584 return SDB_NOT_CONNECTED ;
2586 return pCollection->setAttributes( options ) ;
2598 INT32 pop (
const bson::BSONObj &option = _sdbStaticObject )
2602 return SDB_NOT_CONNECTED ;
2604 return pCollection->pop( option ) ;
2607 INT32 listLobPieces( _sdbCursor **cursor,
2608 const bson::BSONObj &condition = _sdbStaticObject,
2609 const bson::BSONObj &selected = _sdbStaticObject,
2610 const bson::BSONObj &orderBy = _sdbStaticObject,
2611 const bson::BSONObj &hint = _sdbStaticObject,
2612 INT64 numToSkip = 0,
2613 INT64 numToReturn = -1 )
2617 return SDB_NOT_CONNECTED ;
2619 return pCollection->listLobPieces( cursor, condition, selected,
2620 orderBy, hint, numToSkip,
2637 INT32 listLobPieces( sdbCursor &cursor,
2638 const bson::BSONObj &condition = _sdbStaticObject,
2639 const bson::BSONObj &selected = _sdbStaticObject,
2640 const bson::BSONObj &orderBy = _sdbStaticObject,
2641 const bson::BSONObj &hint = _sdbStaticObject,
2642 INT64 numToSkip = 0,
2643 INT64 numToReturn = -1 )
2647 return SDB_NOT_CONNECTED ;
2650 return pCollection->listLobPieces( cursor, condition, selected,
2651 orderBy, hint, numToSkip,
2661 INT32 getDetail ( _sdbCursor **cursor )
2665 return SDB_NOT_CONNECTED ;
2667 return pCollection->getDetail ( cursor ) ;
2680 return SDB_NOT_CONNECTED ;
2682 return pCollection->getDetail( cursor ) ;
2691 INT32 getCollectionStat( bson::BSONObj &result )
2695 return SDB_NOT_CONNECTED ;
2697 return pCollection->getCollectionStat( result ) ;
2709 INT32 getIndexStat(
const CHAR *pIndexName, bson::BSONObj &result,
2710 BOOLEAN detail = FALSE )
2714 return SDB_NOT_CONNECTED ;
2716 return pCollection->getIndexStat( pIndexName, result, detail ) ;
2723 void setVersion( INT32 clVersion )
2725 pCollection->setVersion( clVersion ) ;
2733 return pCollection->getVersion() ;
2741 INT32 setConsistencyStrategy( INT32 value )
2743 return pCollection->setConsistencyStrategy( value ) ;
2763 class DLLEXPORT _sdbNode
2766 _sdbNode (
const _sdbNode& other ) ;
2767 _sdbNode& operator=(
const _sdbNode& ) ;
2770 virtual ~_sdbNode () {}
2772 virtual INT32 connect ( _sdb **dbConn ) = 0 ;
2773 virtual INT32 connect (
sdb &dbConn ) = 0 ;
2779 virtual const CHAR *getHostName () = 0 ;
2782 virtual const CHAR *getServiceName () = 0 ;
2785 virtual const CHAR *getNodeName () = 0 ;
2788 virtual INT32 getNodeID( INT32 &nodeID )
const = 0 ;
2791 virtual INT32 stop () = 0 ;
2794 virtual INT32 start () = 0 ;
2796 virtual INT32 setLocation (
const CHAR *pLocation ) = 0 ;
2798 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
2854 INT32 connect ( _sdb **dbConn )
2858 return SDB_NOT_CONNECTED ;
2860 return pNode->connect ( dbConn ) ;
2874 return SDB_NOT_CONNECTED ;
2879 return pNode->connect ( dbConn ) ;
2892 return SDB_NODE_UNKNOWN ;
2894 return pNode->getStatus () ;
2901 const CHAR *getHostName ()
2907 return pNode->getHostName () ;
2914 const CHAR *getServiceName ()
2920 return pNode->getServiceName () ;
2927 const CHAR *getNodeName ()
2933 return pNode->getNodeName () ;
2940 INT32 getNodeID( INT32 &nodeID )
const
2944 return SDB_NOT_CONNECTED ;
2946 return pNode->getNodeID( nodeID ) ;
2958 return SDB_NOT_CONNECTED ;
2960 return pNode->stop () ;
2972 return SDB_NOT_CONNECTED ;
2974 return pNode->start () ;
2987 INT32 setLocation (
const CHAR *pLocation )
2991 return SDB_NOT_CONNECTED ;
2993 return pNode->setLocation( pLocation ) ;
3005 INT32 setAttributes (
const bson::BSONObj & options )
3009 return SDB_NOT_CONNECTED ;
3011 return pNode->setAttributes( options ) ;
3024 class DLLEXPORT _sdbReplicaGroup
3027 _sdbReplicaGroup (
const _sdbReplicaGroup& other ) ;
3028 _sdbReplicaGroup& operator=(
const _sdbReplicaGroup& ) ;
3030 _sdbReplicaGroup () {}
3031 virtual ~_sdbReplicaGroup () {}
3033 virtual INT32 getNodeNum (
sdbNodeStatus status, INT32 *num ) = 0 ;
3036 virtual INT32 getDetail ( bson::BSONObj &result ) = 0 ;
3039 virtual INT32 getMaster ( _sdbNode **node ) = 0 ;
3040 virtual INT32 getMaster ( sdbNode &node ) = 0 ;
3043 virtual INT32 getSlave ( _sdbNode **node,
3044 const vector<INT32>& positions = _sdbStaticVec ) = 0 ;
3045 virtual INT32 getSlave ( sdbNode &node,
3046 const vector<INT32>& positions = _sdbStaticVec ) = 0 ;
3049 virtual INT32 getNode (
const CHAR *pNodeName,
3050 _sdbNode **node ) = 0 ;
3051 virtual INT32 getNode (
const CHAR *pNodeName,
3052 sdbNode &node ) = 0 ;
3055 virtual INT32 getNode (
const CHAR *pHostName,
3056 const CHAR *pServiceName,
3057 _sdbNode **node ) = 0 ;
3058 virtual INT32 getNode (
const CHAR *pHostName,
3059 const CHAR *pServiceName,
3060 sdbNode &node ) = 0 ;
3063 virtual INT32 createNode (
const CHAR *pHostName,
3064 const CHAR *pServiceName,
3065 const CHAR *pDatabasePath,
3066 std::map<std::string,std::string> &config,
3067 _sdbNode **ppNode = NULL ) = 0 ;
3069 virtual INT32 createNode (
const CHAR *pHostName,
3070 const CHAR *pServiceName,
3071 const CHAR *pDatabasePath,
3072 const bson::BSONObj &options = _sdbStaticObject,
3073 _sdbNode **ppNode = NULL ) = 0 ;
3076 virtual INT32 removeNode (
const CHAR *pHostName,
3077 const CHAR *pServiceName,
3078 const bson::BSONObj &configure = _sdbStaticObject ) = 0 ;
3080 virtual INT32 stop () = 0 ;
3083 virtual INT32 start () = 0 ;
3086 virtual const CHAR *getName () = 0 ;
3089 virtual BOOLEAN isCatalog () = 0 ;
3092 virtual INT32 attachNode(
const CHAR *pHostName,
3093 const CHAR *pSvcName,
3094 const bson::BSONObj &options ) = 0 ;
3097 virtual INT32 detachNode(
const CHAR *pHostName,
3098 const CHAR *pSvcName,
3099 const bson::BSONObj &options ) = 0 ;
3102 virtual INT32 reelect(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
3105 virtual INT32 reelectLocation(
const CHAR* pLocation,
3106 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
3109 virtual INT32 setActiveLocation (
const CHAR *pActiveLocation ) = 0 ;
3111 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
3114 virtual INT32 startCriticalMode(
const bson::BSONObj &options ) = 0 ;
3117 virtual INT32 stopCriticalMode() = 0 ;
3120 virtual INT32 startMaintenanceMode(
const bson::BSONObj &options ) = 0 ;
3123 virtual INT32 stopMaintenanceMode(
const bson::BSONObj &options ) = 0 ;
3148 pReplicaGroup = NULL ;
3156 if ( pReplicaGroup )
3158 delete pReplicaGroup ;
3178 if ( !pReplicaGroup )
3180 return SDB_NOT_CONNECTED ;
3182 return pReplicaGroup->
getNodeNum ( status, num ) ;
3191 INT32 getDetail ( bson::BSONObj &result )
3193 if ( !pReplicaGroup )
3195 return SDB_NOT_CONNECTED ;
3197 return pReplicaGroup->getDetail ( result ) ;
3206 INT32 getMaster ( _sdbNode **node )
3208 if ( !pReplicaGroup )
3210 return SDB_NOT_CONNECTED ;
3212 return pReplicaGroup->getMaster ( node ) ;
3223 if ( !pReplicaGroup )
3225 return SDB_NOT_CONNECTED ;
3228 return pReplicaGroup->getMaster ( node ) ;
3239 INT32 getSlave ( _sdbNode **node,
3240 const vector<INT32>& positions = _sdbStaticVec )
3242 if ( !pReplicaGroup )
3244 return SDB_NOT_CONNECTED ;
3246 return pReplicaGroup->getSlave ( node, positions ) ;
3258 const vector<INT32>& positions = _sdbStaticVec )
3260 if ( !pReplicaGroup )
3262 return SDB_NOT_CONNECTED ;
3265 return pReplicaGroup->getSlave ( node, positions ) ;
3276 INT32 getNode (
const CHAR *pNodeName,
3279 if ( !pReplicaGroup )
3281 return SDB_NOT_CONNECTED ;
3283 return pReplicaGroup->getNode ( pNodeName, node ) ;
3294 INT32 getNode (
const CHAR *pNodeName,
3297 if ( !pReplicaGroup )
3299 return SDB_NOT_CONNECTED ;
3302 return pReplicaGroup->getNode ( pNodeName, node ) ;
3305 INT32 getNode (
const CHAR *pHostName,
3306 const CHAR *pServiceName,
3309 if ( !pReplicaGroup )
3311 return SDB_NOT_CONNECTED ;
3313 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
3326 INT32 getNode (
const CHAR *pHostName,
3327 const CHAR *pServiceName,
3330 if ( !pReplicaGroup )
3332 return SDB_NOT_CONNECTED ;
3335 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
3351 INT32 createNode (
const CHAR *pHostName,
3352 const CHAR *pServiceName,
3353 const CHAR *pDatabasePath,
3354 std::map<std::string,std::string> &config,
3355 _sdbNode **pNode = NULL )
3357 if ( !pReplicaGroup )
3359 return SDB_NOT_CONNECTED ;
3361 return pReplicaGroup->createNode ( pHostName, pServiceName,
3362 pDatabasePath, config, pNode ) ;
3377 INT32 createNode (
const CHAR *pHostName,
3378 const CHAR *pServiceName,
3379 const CHAR *pDatabasePath,
3380 const bson::BSONObj &options = _sdbStaticObject,
3381 _sdbNode **pNode = NULL )
3383 if ( !pReplicaGroup )
3385 return SDB_NOT_CONNECTED ;
3387 return pReplicaGroup->createNode ( pHostName, pServiceName,
3388 pDatabasePath, options, pNode ) ;
3401 INT32 removeNode (
const CHAR *pHostName,
3402 const CHAR *pServiceName,
3403 const bson::BSONObj &configure = _sdbStaticObject )
3405 if ( !pReplicaGroup )
3407 return SDB_NOT_CONNECTED ;
3409 return pReplicaGroup->removeNode ( pHostName, pServiceName,
3419 if ( !pReplicaGroup )
3421 return SDB_NOT_CONNECTED ;
3423 return pReplicaGroup->stop () ;
3433 if ( !pReplicaGroup )
3435 return SDB_NOT_CONNECTED ;
3437 return pReplicaGroup->start () ;
3444 const CHAR *getName ()
3446 if ( !pReplicaGroup )
3450 return pReplicaGroup->getName() ;
3458 BOOLEAN isCatalog ()
3460 if ( !pReplicaGroup )
3464 return pReplicaGroup->isCatalog() ;
3481 INT32 attachNode(
const CHAR *pHostName,
3482 const CHAR *pSvcName,
3483 const bson::BSONObj &options )
3485 if ( !pReplicaGroup )
3487 return SDB_NOT_CONNECTED ;
3489 return pReplicaGroup->attachNode( pHostName, pSvcName, options ) ;
3507 INT32 detachNode(
const CHAR *pHostName,
3508 const CHAR *pSvcName,
3509 const bson::BSONObj &options )
3511 if ( !pReplicaGroup )
3513 return SDB_NOT_CONNECTED ;
3515 return pReplicaGroup->detachNode( pHostName, pSvcName, options ) ;
3526 INT32 reelect(
const bson::BSONObj &options = _sdbStaticObject )
3528 if( !pReplicaGroup )
3530 return SDB_NOT_CONNECTED ;
3532 return pReplicaGroup->reelect( options ) ;
3542 INT32 reelectLocation(
const CHAR* pLocation,
3543 const bson::BSONObj &options = _sdbStaticObject )
3545 if( !pReplicaGroup )
3547 return SDB_NOT_CONNECTED ;
3549 return pReplicaGroup->reelectLocation( pLocation, options ) ;
3563 INT32 setActiveLocation (
const CHAR *pActiveLocation )
3565 if ( !pReplicaGroup )
3567 return SDB_NOT_CONNECTED ;
3569 return pReplicaGroup->setActiveLocation( pActiveLocation ) ;
3582 INT32 setAttributes (
const bson::BSONObj & options )
3584 if ( !pReplicaGroup )
3586 return SDB_NOT_CONNECTED ;
3588 return pReplicaGroup->setAttributes( options ) ;
3604 INT32 startCriticalMode(
const bson::BSONObj &options )
3606 if ( !pReplicaGroup )
3608 return SDB_NOT_CONNECTED ;
3610 return pReplicaGroup->startCriticalMode( options ) ;
3618 INT32 stopCriticalMode()
3620 if ( !pReplicaGroup )
3622 return SDB_NOT_CONNECTED ;
3624 return pReplicaGroup->stopCriticalMode () ;
3639 INT32 startMaintenanceMode(
const bson::BSONObj &options )
3641 if ( !pReplicaGroup )
3643 return SDB_NOT_CONNECTED ;
3645 return pReplicaGroup->startMaintenanceMode( options ) ;
3658 INT32 stopMaintenanceMode(
const bson::BSONObj &options )
3660 if ( !pReplicaGroup )
3662 return SDB_NOT_CONNECTED ;
3664 return pReplicaGroup->stopMaintenanceMode ( options ) ;
3668 class DLLEXPORT _sdbCollectionSpace
3671 _sdbCollectionSpace (
const _sdbCollectionSpace& other ) ;
3672 _sdbCollectionSpace& operator=(
const _sdbCollectionSpace& ) ;
3674 _sdbCollectionSpace () {}
3675 virtual ~_sdbCollectionSpace () {}
3677 virtual INT32 getCollection (
const CHAR *pCollectionName,
3678 _sdbCollection **collection,
3679 BOOLEAN checkExist = TRUE ) = 0 ;
3681 virtual INT32 getCollection (
const CHAR *pCollectionName,
3682 sdbCollection &collection,
3683 BOOLEAN checkExist = TRUE ) = 0 ;
3686 virtual INT32 createCollection (
const CHAR *pCollection,
3687 const bson::BSONObj &options,
3688 _sdbCollection **collection ) = 0 ;
3690 virtual INT32 createCollection (
const CHAR *pCollection,
3691 const bson::BSONObj &options,
3692 sdbCollection &collection ) = 0 ;
3695 virtual INT32 createCollection (
const CHAR *pCollection,
3696 _sdbCollection **collection ) = 0 ;
3698 virtual INT32 createCollection (
const CHAR *pCollection,
3699 sdbCollection &collection ) = 0 ;
3702 virtual INT32 dropCollection(
const CHAR *pCollection,
3703 const bson::BSONObj &options ) = 0 ;
3705 virtual INT32 listCollections ( _sdbCursor **cursor ) = 0 ;
3707 virtual INT32 listCollections ( sdbCursor &cursor ) = 0 ;
3710 virtual INT32 create () = 0 ;
3712 virtual INT32 drop () = 0 ;
3715 virtual const CHAR *getCSName () = 0 ;
3718 virtual INT32 renameCollection(
const CHAR* oldName,
const CHAR* newName,
3719 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
3721 virtual INT32 alterCollectionSpace (
const bson::BSONObj & options ) = 0 ;
3723 virtual INT32 setDomain (
const bson::BSONObj & options ) = 0 ;
3725 virtual INT32 getDomainName ( CHAR *result, INT32 resultLen ) = 0 ;
3727 virtual INT32 removeDomain () = 0 ;
3729 virtual INT32 enableCapped () = 0 ;
3731 virtual INT32 disableCapped () = 0 ;
3733 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
3767 pCollectionSpace = NULL ;
3775 if ( pCollectionSpace )
3777 delete pCollectionSpace ;
3781 INT32 getCollection (
const CHAR *pCollectionName,
3782 _sdbCollection **collection,
3783 BOOLEAN checkExist = TRUE )
3785 if ( !pCollectionSpace )
3787 return SDB_NOT_CONNECTED ;
3789 return pCollectionSpace->getCollection ( pCollectionName,
3790 collection, checkExist ) ;
3803 INT32 getCollection (
const CHAR *pCollectionName,
3805 BOOLEAN checkExist = TRUE )
3807 if ( !pCollectionSpace )
3809 return SDB_NOT_CONNECTED ;
3812 return pCollectionSpace->getCollection ( pCollectionName,
3817 INT32 createCollection (
const CHAR *pCollection,
3818 const bson::BSONObj &options,
3819 _sdbCollection **collection )
3821 if ( !pCollectionSpace )
3823 return SDB_NOT_CONNECTED ;
3825 return pCollectionSpace->createCollection ( pCollection,
3867 INT32 createCollection (
const CHAR *pCollection,
3868 const bson::BSONObj &options,
3871 if ( !pCollectionSpace )
3873 return SDB_NOT_CONNECTED ;
3876 return pCollectionSpace->createCollection ( pCollection,
3881 INT32 createCollection (
const CHAR *pCollection,
3882 _sdbCollection **collection )
3884 if ( !pCollectionSpace )
3886 return SDB_NOT_CONNECTED ;
3888 return pCollectionSpace->createCollection ( pCollection,
3901 INT32 createCollection (
const CHAR *pCollection,
3904 if ( !pCollectionSpace )
3906 return SDB_NOT_CONNECTED ;
3909 return pCollectionSpace->createCollection ( pCollection,
3922 INT32 dropCollection(
const CHAR *pCollection,
3923 const bson::BSONObj &options = _sdbStaticObject )
3925 if ( !pCollectionSpace )
3927 return SDB_NOT_CONNECTED ;
3929 return pCollectionSpace->dropCollection( pCollection, options ) ;
3938 INT32 listCollections ( _sdbCursor **cursor )
3940 if ( !pCollectionSpace )
3942 return SDB_NOT_CONNECTED ;
3944 return pCollectionSpace->listCollections( cursor ) ;
3955 if ( !pCollectionSpace )
3957 return SDB_NOT_CONNECTED ;
3960 return pCollectionSpace->listCollections( cursor ) ;
3971 if ( !pCollectionSpace )
3973 return SDB_NOT_CONNECTED ;
3975 return pCollectionSpace->create () ;
3986 if ( !pCollectionSpace )
3988 return SDB_NOT_CONNECTED ;
3990 return pCollectionSpace->drop () ;
3997 const CHAR *getCSName ()
3999 if ( !pCollectionSpace )
4003 return pCollectionSpace->getCSName () ;
4016 INT32 renameCollection(
const CHAR* oldName,
const CHAR* newName,
4017 const bson::BSONObj &options = _sdbStaticObject )
4019 if( !pCollectionSpace )
4021 return SDB_NOT_CONNECTED ;
4023 return pCollectionSpace->renameCollection( oldName, newName, options ) ;
4037 INT32 alterCollectionSpace (
const bson::BSONObj & options )
4039 if ( NULL == pCollectionSpace )
4041 return SDB_NOT_CONNECTED ;
4043 return pCollectionSpace->alterCollectionSpace( options ) ;
4055 INT32 setDomain (
const bson::BSONObj & options )
4057 if ( NULL == pCollectionSpace )
4059 return SDB_NOT_CONNECTED ;
4061 return pCollectionSpace->setDomain( options ) ;
4071 INT32 getDomainName ( CHAR *result, INT32 resultLen )
4073 if ( !pCollectionSpace )
4075 return SDB_NOT_CONNECTED ;
4077 return pCollectionSpace->getDomainName( result, resultLen ) ;
4085 INT32 removeDomain ()
4087 if ( NULL == pCollectionSpace )
4089 return SDB_NOT_CONNECTED ;
4091 return pCollectionSpace->removeDomain() ;
4099 INT32 enableCapped ()
4101 if ( NULL == pCollectionSpace )
4103 return SDB_NOT_CONNECTED ;
4105 return pCollectionSpace->enableCapped() ;
4113 INT32 disableCapped ()
4115 if ( NULL == pCollectionSpace )
4117 return SDB_NOT_CONNECTED ;
4119 return pCollectionSpace->disableCapped() ;
4133 INT32 setAttributes (
const bson::BSONObj & options )
4135 if ( NULL == pCollectionSpace )
4137 return SDB_NOT_CONNECTED ;
4139 return pCollectionSpace->setAttributes( options ) ;
4143 class DLLEXPORT _sdbDomain
4146 _sdbDomain (
const _sdbDomain& other ) ;
4147 _sdbDomain& operator= (
const _sdbDomain& ) ;
4150 virtual ~_sdbDomain () {}
4152 virtual const CHAR* getName () = 0 ;
4154 virtual INT32 alterDomain (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4156 virtual INT32 listCollectionSpacesInDomain ( _sdbCursor **cursor ) = 0 ;
4158 virtual INT32 listCollectionSpacesInDomain ( sdbCursor &cursor ) = 0 ;
4160 virtual INT32 listCollectionsInDomain ( _sdbCursor **cursor ) = 0 ;
4162 virtual INT32 listCollectionsInDomain ( sdbCursor &cursor ) = 0 ;
4164 virtual INT32 listReplicaGroupInDomain( _sdbCursor **cursor ) = 0 ;
4166 virtual INT32 listReplicaGroupInDomain( sdbCursor &cursor ) = 0 ;
4168 virtual INT32 addGroups (
const bson::BSONObj & options ) = 0 ;
4170 virtual INT32 setGroups (
const bson::BSONObj & options ) = 0 ;
4172 virtual INT32 setActiveLocation (
const CHAR *pActiveLocation ) = 0 ;
4174 virtual INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation ) = 0 ;
4176 virtual INT32 removeGroups (
const bson::BSONObj & options ) = 0 ;
4178 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
4219 const CHAR *getName ()
4245 INT32 alterDomain (
const bson::BSONObj &options )
4249 return SDB_NOT_CONNECTED ;
4251 return pDomain->alterDomain ( options ) ;
4264 INT32 addGroups (
const bson::BSONObj & options )
4266 if ( NULL == pDomain )
4268 return SDB_NOT_CONNECTED ;
4270 return pDomain->addGroups( options ) ;
4285 INT32 setGroups (
const bson::BSONObj & options )
4287 if ( NULL == pDomain )
4289 return SDB_NOT_CONNECTED ;
4291 return pDomain->setGroups( options ) ;
4304 INT32 setActiveLocation (
const CHAR *pActiveLocation )
4306 if ( NULL == pDomain )
4308 return SDB_NOT_CONNECTED ;
4310 return pDomain->setActiveLocation( pActiveLocation ) ;
4325 INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation )
4327 if ( NULL == pDomain )
4329 return SDB_NOT_CONNECTED ;
4331 return pDomain->setLocation( pHostName, pLocation ) ;
4346 INT32 removeGroups (
const bson::BSONObj & options )
4348 if ( NULL == pDomain )
4350 return SDB_NOT_CONNECTED ;
4352 return pDomain->removeGroups( options ) ;
4372 INT32 setAttributes (
const bson::BSONObj &options )
4376 return SDB_NOT_CONNECTED ;
4378 return pDomain->setAttributes( options ) ;
4392 return SDB_NOT_CONNECTED ;
4395 return pDomain->listCollectionSpacesInDomain ( cursor ) ;
4398 INT32 listCollectionSpacesInDomain ( _sdbCursor **cursor )
4402 return SDB_NOT_CONNECTED ;
4404 return pDomain->listCollectionSpacesInDomain ( cursor ) ;
4418 return SDB_NOT_CONNECTED ;
4421 return pDomain->listCollectionsInDomain ( cursor ) ;
4431 INT32 listCollectionsInDomain ( _sdbCursor **cursor )
4435 return SDB_NOT_CONNECTED ;
4437 return pDomain->listCollectionsInDomain ( cursor ) ;
4440 INT32 listReplicaGroupInDomain( _sdbCursor **cursor )
4444 return SDB_NOT_CONNECTED ;
4446 return pDomain->listReplicaGroupInDomain( cursor ) ;
4459 return SDB_NOT_CONNECTED ;
4462 return pDomain->listReplicaGroupInDomain( cursor ) ;
4466 class DLLEXPORT _sdbDataCenter
4469 _sdbDataCenter (
const _sdbDataCenter& other ) ;
4470 _sdbDataCenter& operator= (
const _sdbDataCenter& ) ;
4473 _sdbDataCenter () {}
4474 virtual ~_sdbDataCenter () {}
4477 virtual const CHAR *getName () = 0 ;
4478 virtual INT32 getDetail( bson::BSONObj &retInfo ) = 0 ;
4479 virtual INT32 activateDC() = 0 ;
4480 virtual INT32 deactivateDC() = 0 ;
4481 virtual INT32 enableReadOnly( BOOLEAN isReadOnly ) = 0 ;
4482 virtual INT32 createImage(
const CHAR *pCataAddrList ) = 0 ;
4483 virtual INT32 removeImage() = 0 ;
4484 virtual INT32 enableImage() = 0 ;
4485 virtual INT32 disableImage() = 0 ;
4486 virtual INT32 attachGroups(
const bson::BSONObj &info ) = 0 ;
4487 virtual INT32 detachGroups(
const bson::BSONObj &info ) = 0 ;
4488 virtual INT32 setActiveLocation (
const CHAR *pActiveLocation ) = 0 ;
4489 virtual INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation ) = 0 ;
4490 virtual INT32 startMaintenanceMode(
const bson::BSONObj &options ) = 0 ;
4491 virtual INT32 stopMaintenanceMode(
const bson::BSONObj &options ) = 0 ;
4497 class DLLEXPORT sdbDataCenter
4500 sdbDataCenter (
const sdbDataCenter& ) ;
4501 sdbDataCenter& operator= (
const sdbDataCenter& ) ;
4511 _sdbDataCenter *pDC ;
4516 sdbDataCenter() { pDC = NULL ; }
4535 const CHAR *getName ()
4541 return pDC->getName() ;
4550 INT32 getDetail( bson::BSONObj &retInfo )
4554 return SDB_NOT_CONNECTED ;
4556 return pDC->getDetail( retInfo ) ;
4568 return SDB_NOT_CONNECTED ;
4570 return pDC->activateDC() ;
4578 INT32 deactivateDC()
4582 return SDB_NOT_CONNECTED ;
4584 return pDC->deactivateDC() ;
4593 INT32 enableReadOnly( BOOLEAN isReadOnly )
4597 return SDB_NOT_CONNECTED ;
4599 return pDC->enableReadOnly( isReadOnly ) ;
4609 INT32 createImage(
const CHAR *pCataAddrList )
4613 return SDB_NOT_CONNECTED ;
4615 return pDC->createImage( pCataAddrList ) ;
4627 return SDB_NOT_CONNECTED ;
4629 return pDC->removeImage() ;
4641 return SDB_NOT_CONNECTED ;
4643 return pDC->enableImage() ;
4651 INT32 disableImage()
4655 return SDB_NOT_CONNECTED ;
4657 return pDC->disableImage() ;
4666 INT32 attachGroups(
const bson::BSONObj &info )
4670 return SDB_NOT_CONNECTED ;
4672 return pDC->attachGroups( info ) ;
4681 INT32 detachGroups(
const bson::BSONObj &info )
4685 return SDB_NOT_CONNECTED ;
4687 return pDC->detachGroups( info ) ;
4700 INT32 setActiveLocation (
const CHAR *pActiveLocation )
4704 return SDB_NOT_CONNECTED ;
4706 return pDC->setActiveLocation( pActiveLocation ) ;
4721 INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation )
4725 return SDB_NOT_CONNECTED ;
4727 return pDC->setLocation( pHostName, pLocation ) ;
4742 INT32 startMaintenanceMode(
const bson::BSONObj &options )
4746 return SDB_NOT_CONNECTED ;
4748 return pDC->startMaintenanceMode( options ) ;
4761 INT32 stopMaintenanceMode(
const bson::BSONObj &options )
4765 return SDB_NOT_CONNECTED ;
4767 return pDC->stopMaintenanceMode ( options ) ;
4772 class DLLEXPORT _sdbRecycleBin
4775 _sdbRecycleBin (
const _sdbRecycleBin& other ) ;
4776 _sdbRecycleBin& operator= (
const _sdbRecycleBin& ) ;
4779 _sdbRecycleBin () {}
4780 virtual ~_sdbRecycleBin () {}
4783 virtual INT32 getDetail( bson::BSONObj &retInfo ) = 0 ;
4784 virtual INT32 enable() = 0 ;
4785 virtual INT32 disable() = 0 ;
4786 virtual INT32 setAttributes(
const bson::BSONObj &options ) = 0 ;
4787 virtual INT32 alter(
const bson::BSONObj &options ) = 0 ;
4788 virtual INT32 returnItem(
const CHAR *recycleName,
4789 const bson::BSONObj &options = _sdbStaticObject,
4790 bson::BSONObj *result = NULL ) = 0 ;
4791 virtual INT32 returnItemToName(
const CHAR *recycleName,
4792 const CHAR *returnName,
4793 const bson::BSONObj &options = _sdbStaticObject,
4794 bson::BSONObj *result = NULL ) = 0 ;
4795 virtual INT32 dropItem(
const CHAR *recycleName,
4796 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4797 virtual INT32 dropAll(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4798 virtual INT32 list( _sdbCursor **cursor,
4799 const bson::BSONObj &condition = _sdbStaticObject,
4800 const bson::BSONObj &selector = _sdbStaticObject,
4801 const bson::BSONObj &orderBy = _sdbStaticObject,
4802 const bson::BSONObj &hint = _sdbStaticObject,
4803 INT64 numToSkip = 0,
4804 INT64 numToReturn = -1 ) = 0 ;
4805 virtual INT32 list( sdbCursor &cursor,
4806 const bson::BSONObj &condition = _sdbStaticObject,
4807 const bson::BSONObj &selector = _sdbStaticObject,
4808 const bson::BSONObj &orderBy = _sdbStaticObject,
4809 const bson::BSONObj &hint = _sdbStaticObject,
4810 INT64 numToSkip = 0,
4811 INT64 numToReturn = -1 ) = 0 ;
4812 virtual INT32 snapshot( _sdbCursor **cursor,
4813 const bson::BSONObj &condition = _sdbStaticObject,
4814 const bson::BSONObj &selector = _sdbStaticObject,
4815 const bson::BSONObj &orderBy = _sdbStaticObject,
4816 const bson::BSONObj &hint = _sdbStaticObject,
4817 INT64 numToSkip = 0,
4818 INT64 numToReturn = -1 ) = 0 ;
4819 virtual INT32 snapshot( sdbCursor &cursor,
4820 const bson::BSONObj &condition = _sdbStaticObject,
4821 const bson::BSONObj &selector = _sdbStaticObject,
4822 const bson::BSONObj &orderBy = _sdbStaticObject,
4823 const bson::BSONObj &hint = _sdbStaticObject,
4824 INT64 numToSkip = 0,
4825 INT64 numToReturn = -1 ) = 0 ;
4826 virtual INT32 getCount( INT64 &count,
4827 const bson::BSONObj &condition = _sdbStaticObject ) = 0 ;
4833 class DLLEXPORT sdbRecycleBin
4836 sdbRecycleBin(
const sdbRecycleBin & ) ;
4837 sdbRecycleBin &operator =(
const sdbRecycleBin & ) ;
4847 _sdbRecycleBin *pRecycleBin ;
4852 sdbRecycleBin() { pRecycleBin = NULL ; }
4861 delete pRecycleBin ;
4873 INT32 getDetail( bson::BSONObj &retInfo )
4875 if ( NULL == pRecycleBin )
4877 return SDB_NOT_CONNECTED ;
4879 return pRecycleBin->getDetail( retInfo ) ;
4889 if ( NULL == pRecycleBin )
4891 return SDB_NOT_CONNECTED ;
4893 return pRecycleBin->enable() ;
4903 if ( NULL == pRecycleBin )
4905 return SDB_NOT_CONNECTED ;
4907 return pRecycleBin->disable() ;
4923 INT32 setAttributes(
const bson::BSONObj &options )
4925 if ( NULL == pRecycleBin )
4927 return SDB_NOT_CONNECTED ;
4929 return pRecycleBin->setAttributes( options ) ;
4945 INT32 alter(
const bson::BSONObj &options )
4947 if ( NULL == pRecycleBin )
4949 return SDB_NOT_CONNECTED ;
4951 return pRecycleBin->alter( options ) ;
4964 INT32 returnItem(
const CHAR *recycleName,
4965 const bson::BSONObj &options = _sdbStaticObject,
4966 bson::BSONObj *result = NULL )
4968 if ( NULL == pRecycleBin )
4970 return SDB_NOT_CONNECTED ;
4972 return pRecycleBin->returnItem( recycleName, options, result ) ;
4987 INT32 returnItemToName(
const CHAR *recycleName,
4988 const CHAR *returnName,
4989 const bson::BSONObj &options = _sdbStaticObject,
4990 bson::BSONObj *result = NULL )
4992 if ( NULL == pRecycleBin )
4994 return SDB_NOT_CONNECTED ;
4996 return pRecycleBin->returnItemToName( recycleName,
5009 INT32 dropItem(
const CHAR *recycleName,
5010 const bson::BSONObj &options = _sdbStaticObject )
5012 if ( NULL == pRecycleBin )
5014 return SDB_NOT_CONNECTED ;
5016 return pRecycleBin->dropItem( recycleName, options ) ;
5025 INT32 dropAll(
const bson::BSONObj &options = _sdbStaticObject )
5027 if ( NULL == pRecycleBin )
5029 return SDB_NOT_CONNECTED ;
5031 return pRecycleBin->dropAll( options ) ;
5053 INT32 list( _sdbCursor **cursor,
5054 const bson::BSONObj &condition = _sdbStaticObject,
5055 const bson::BSONObj &selector = _sdbStaticObject,
5056 const bson::BSONObj &orderBy = _sdbStaticObject,
5057 const bson::BSONObj &hint = _sdbStaticObject,
5058 INT64 numToSkip = 0,
5059 INT64 numToReturn = -1 )
5061 if ( NULL == pRecycleBin )
5063 return SDB_NOT_CONNECTED ;
5065 return pRecycleBin->list( cursor,
5093 INT32 list( sdbCursor &cursor,
5094 const bson::BSONObj &condition = _sdbStaticObject,
5095 const bson::BSONObj &selector = _sdbStaticObject,
5096 const bson::BSONObj &orderBy = _sdbStaticObject,
5097 const bson::BSONObj &hint = _sdbStaticObject,
5098 INT64 numToSkip = 0,
5099 INT64 numToReturn = -1 )
5101 if ( NULL == pRecycleBin )
5103 return SDB_NOT_CONNECTED ;
5105 return pRecycleBin->list( cursor,
5133 INT32 snapshot( _sdbCursor **cursor,
5134 const bson::BSONObj &condition = _sdbStaticObject,
5135 const bson::BSONObj &selector = _sdbStaticObject,
5136 const bson::BSONObj &orderBy = _sdbStaticObject,
5137 const bson::BSONObj &hint = _sdbStaticObject,
5138 INT64 numToSkip = 0,
5139 INT64 numToReturn = -1 )
5141 if ( NULL == pRecycleBin )
5143 return SDB_NOT_CONNECTED ;
5145 return pRecycleBin->snapshot( cursor,
5173 INT32 snapshot( sdbCursor &cursor,
5174 const bson::BSONObj &condition = _sdbStaticObject,
5175 const bson::BSONObj &selector = _sdbStaticObject,
5176 const bson::BSONObj &orderBy = _sdbStaticObject,
5177 const bson::BSONObj &hint = _sdbStaticObject,
5178 INT64 numToSkip = 0,
5179 INT64 numToReturn = -1 )
5181 if ( NULL == pRecycleBin )
5183 return SDB_NOT_CONNECTED ;
5185 return pRecycleBin->snapshot( cursor,
5202 INT32 getCount( INT64 &count,
5203 const bson::BSONObj &condition = _sdbStaticObject )
5205 if ( NULL == pRecycleBin )
5207 return SDB_NOT_CONNECTED ;
5209 return pRecycleBin->getCount( count, condition ) ;
5213 class DLLEXPORT _sdbLob
5216 _sdbLob (
const _sdbLob& other ) ;
5217 _sdbLob& operator= (
const _sdbLob& ) ;
5222 virtual ~_sdbLob () {}
5224 virtual INT32 close () = 0 ;
5226 virtual INT32 read ( UINT32 len, CHAR *buf, UINT32 *read ) = 0 ;
5228 virtual INT32 write (
const CHAR *buf, UINT32 len ) = 0 ;
5230 virtual INT32 seek ( SINT64 size,
SDB_LOB_SEEK whence ) = 0 ;
5232 virtual INT32 lock( INT64 offset, INT64 length ) = 0 ;
5234 virtual INT32 lockAndSeek( INT64 offset, INT64 length ) = 0 ;
5236 virtual INT32 isClosed( BOOLEAN &flag ) = 0 ;
5238 virtual INT32 getOid( bson::OID &oid ) = 0 ;
5240 virtual INT32 getSize( SINT64 *size ) = 0 ;
5242 virtual INT32 getCreateTime ( UINT64 *millis ) = 0 ;
5244 virtual BOOLEAN isClosed() = 0 ;
5246 virtual bson::OID getOid() = 0 ;
5248 virtual SINT64 getSize() = 0 ;
5250 virtual UINT64 getCreateTime () = 0 ;
5252 virtual UINT64 getModificationTime() = 0 ;
5254 virtual INT32 getPiecesInfoNum() = 0 ;
5256 virtual bson::BSONArray getPiecesInfo() = 0 ;
5258 virtual BOOLEAN isEof() = 0 ;
5260 virtual INT32 getRunTimeDetail( bson::BSONObj &detail ) = 0 ;
5309 return pLob->
close() ;
5320 INT32 read ( UINT32 len, CHAR *buf, UINT32 *read )
5324 return SDB_NOT_CONNECTED ;
5326 return pLob->read( len, buf, read ) ;
5336 INT32 write (
const CHAR *buf, UINT32 len )
5340 return SDB_NOT_CONNECTED ;
5342 return pLob->write( buf, len ) ;
5356 return SDB_NOT_CONNECTED ;
5358 return pLob->seek( size, whence ) ;
5368 INT32 lock ( INT64 offset, INT64 length )
5372 return SDB_NOT_CONNECTED ;
5374 return pLob->lock( offset, length ) ;
5384 INT32 lockAndSeek ( INT64 offset, INT64 length )
5388 return SDB_NOT_CONNECTED ;
5390 return pLob->lockAndSeek( offset, length ) ;
5400 INT32 isClosed( BOOLEAN &flag )
5404 return SDB_NOT_CONNECTED ;
5406 return pLob->isClosed ( flag ) ;
5419 return pLob->isClosed () ;
5429 INT32 getOid ( bson::OID &oid )
5433 return SDB_NOT_CONNECTED ;
5435 return pLob->getOid( oid ) ;
5448 return pLob->getOid() ;
5458 INT32 getSize ( SINT64 *size )
5462 return SDB_NOT_CONNECTED ;
5464 return pLob->getSize( size ) ;
5477 return pLob->getSize();
5487 INT32 getCreateTime ( UINT64 *millis )
5491 return SDB_NOT_CONNECTED ;
5493 return pLob->getCreateTime( millis ) ;
5500 UINT64 getCreateTime ()
5506 return pLob->getCreateTime() ;
5513 UINT64 getModificationTime ()
5519 return pLob->getModificationTime() ;
5526 INT32 getPiecesInfoNum()
5532 return pLob->getPiecesInfoNum() ;
5539 bson::BSONArray getPiecesInfo()
5543 return bson::BSONArray() ;
5545 return pLob->getPiecesInfo() ;
5558 return pLob->isEof() ;
5566 INT32 getRunTimeDetail( bson::BSONObj &detail )
5572 return pLob->getRunTimeDetail( detail ) ;
5577 class DLLEXPORT _sdbSequence
5580 _sdbSequence (
const _sdbSequence& other ) ;
5581 _sdbSequence& operator=(
const _sdbSequence& ) ;
5584 virtual ~_sdbSequence () {}
5586 virtual INT32 setAttributes (
const bson::BSONObj &options ) = 0 ;
5588 virtual INT32 getNextValue ( INT64 &value ) = 0 ;
5590 virtual INT32 getCurrentValue ( INT64 &value ) = 0 ;
5592 virtual INT32 setCurrentValue (
const INT64 value ) = 0 ;
5594 virtual INT32 fetch(
const INT32 fetchNum,
5597 INT32 &Increment ) = 0 ;
5599 virtual INT32 restart(
const INT64 startValue ) = 0 ;
5664 INT32 setAttributes (
const bson::BSONObj & options )
5666 if ( NULL == pSequence )
5668 return SDB_NOT_CONNECTED ;
5679 INT32 getNextValue( INT64 &value )
5681 if ( NULL == pSequence )
5683 return SDB_NOT_CONNECTED ;
5685 return pSequence->getNextValue( value ) ;
5694 INT32 getCurrentValue( INT64 &value )
5696 if ( NULL == pSequence )
5698 return SDB_NOT_CONNECTED ;
5700 return pSequence->getCurrentValue( value ) ;
5709 INT32 setCurrentValue(
const INT64 value )
5711 if ( NULL == pSequence )
5713 return SDB_NOT_CONNECTED ;
5715 return pSequence->setCurrentValue( value ) ;
5728 INT32 fetch(
const INT32 fetchNum, INT64 &nextValue,
5729 INT32 &returnNum, INT32 &increment )
5731 if ( NULL == pSequence )
5733 return SDB_NOT_CONNECTED ;
5735 return pSequence->fetch( fetchNum, nextValue, returnNum, increment ) ;
5744 INT32 restart(
const INT64 startValue )
5746 if ( NULL == pSequence )
5748 return SDB_NOT_CONNECTED ;
5750 return pSequence->restart( startValue ) ;
5754 class DLLEXPORT _sdbDataSource
5757 _sdbDataSource(
const _sdbDataSource& other ) ;
5758 _sdbDataSource& operator=(
const _sdbDataSource& ) ;
5761 virtual ~_sdbDataSource() {}
5763 virtual INT32 alterDataSource(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5764 virtual const CHAR *getName() = 0 ;
5776 _sdbDataSource *pDataSource ;
5780 pDataSource = NULL ;
5787 delete pDataSource ;
5831 INT32 alterDataSource(
const bson::BSONObj &options )
5835 return SDB_NOT_CONNECTED ;
5844 const CHAR *getName()
5850 return pDataSource->getName() ;
5854 class DLLEXPORT _sdb
5857 _sdb (
const _sdb& other ) ;
5858 _sdb& operator=(
const _sdb& ) ;
5862 virtual INT32 connect (
const CHAR *pHostName,
5865 virtual INT32 connect (
const CHAR *pHostName,
5867 const CHAR *pUsrName,
5868 const CHAR *pPasswd ) = 0 ;
5869 virtual INT32 connect (
const CHAR *pHostName,
5870 const CHAR *pServiceName ) = 0 ;
5871 virtual INT32 connect (
const CHAR *pHostName,
5872 const CHAR *pServiceName,
5873 const CHAR *pUsrName,
5874 const CHAR *pPasswd ) = 0 ;
5875 virtual INT32 connect (
const CHAR **pConnAddrs,
5877 const CHAR *pUsrName,
5878 const CHAR *pPasswd ) = 0 ;
5879 virtual INT32 connect (
const CHAR **pConnAddrs,
5881 const CHAR *pUsrName,
5883 const CHAR *pCipherFile ) = 0 ;
5885 virtual void disconnect () = 0 ;
5887 virtual UINT64 getDbStartTime() = 0 ;
5889 virtual const CHAR *getAddress() = 0 ;
5891 virtual void getVersion( UINT8 &version, UINT8 &subVersion,
5892 UINT8 &fixVersion ) = 0 ;
5894 virtual INT32 createUsr(
const CHAR *pUsrName,
5895 const CHAR *pPasswd,
5896 const bson::BSONObj &options = _sdbStaticObject
5899 virtual INT32 removeUsr(
const CHAR *pUsrName,
5900 const CHAR *pPasswd ) = 0 ;
5902 virtual INT32 alterUsr(
const CHAR *pUsrName,
5903 const CHAR *pAction,
5904 const bson::BSONObj &options ) = 0 ;
5906 virtual INT32 changeUsrPasswd(
const CHAR *pUsrName,
5907 const CHAR *pOldPasswd,
5908 const CHAR *pNewPasswd ) = 0 ;
5910 virtual INT32 getSnapshot ( _sdbCursor **cursor,
5912 const bson::BSONObj &condition = _sdbStaticObject,
5913 const bson::BSONObj &selector = _sdbStaticObject,
5914 const bson::BSONObj &orderBy = _sdbStaticObject,
5915 const bson::BSONObj &hint = _sdbStaticObject,
5916 INT64 numToSkip = 0,
5917 INT64 numToReturn = -1
5920 virtual INT32 getSnapshot ( sdbCursor &cursor,
5922 const bson::BSONObj &condition = _sdbStaticObject,
5923 const bson::BSONObj &selector = _sdbStaticObject,
5924 const bson::BSONObj &orderBy = _sdbStaticObject,
5925 const bson::BSONObj &hint = _sdbStaticObject,
5926 INT64 numToSkip = 0,
5927 INT64 numToReturn = -1
5930 virtual INT32 resetSnapshot (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5932 virtual INT32 getList ( _sdbCursor **cursor,
5934 const bson::BSONObj &condition = _sdbStaticObject,
5935 const bson::BSONObj &selector = _sdbStaticObject,
5936 const bson::BSONObj &orderBy = _sdbStaticObject,
5937 const bson::BSONObj &hint = _sdbStaticObject,
5938 INT64 numToSkip = 0,
5939 INT64 numToReturn = -1
5941 virtual INT32 getList ( sdbCursor &cursor,
5943 const bson::BSONObj &condition = _sdbStaticObject,
5944 const bson::BSONObj &selector = _sdbStaticObject,
5945 const bson::BSONObj &orderBy = _sdbStaticObject,
5946 const bson::BSONObj &hint = _sdbStaticObject,
5947 INT64 numToSkip = 0,
5948 INT64 numToReturn = -1
5951 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
5952 _sdbCollection **collection,
5953 BOOLEAN checkExist = TRUE
5956 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
5957 sdbCollection &collection,
5958 BOOLEAN checkExist = TRUE
5961 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5962 _sdbCollectionSpace **cs,
5963 BOOLEAN checkExist = TRUE
5966 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5967 sdbCollectionSpace &cs,
5968 BOOLEAN checkExist = TRUE
5971 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5973 _sdbCollectionSpace **cs
5976 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5978 sdbCollectionSpace &cs
5981 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5982 const bson::BSONObj &options,
5983 _sdbCollectionSpace **cs
5986 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5987 const bson::BSONObj &options,
5988 sdbCollectionSpace &cs
5991 virtual INT32 dropCollectionSpace (
5992 const CHAR *pCollectionSpaceName,
5993 const bson::BSONObj &options = _sdbStaticObject
5996 virtual INT32 listCollectionSpaces ( _sdbCursor **result ) = 0 ;
5998 virtual INT32 listCollectionSpaces ( sdbCursor &result ) = 0 ;
6001 virtual INT32 listCollections ( _sdbCursor **result ) = 0 ;
6003 virtual INT32 listCollections ( sdbCursor &result ) = 0 ;
6006 virtual INT32 listReplicaGroups ( _sdbCursor **result ) = 0 ;
6008 virtual INT32 listReplicaGroups ( sdbCursor &result ) = 0 ;
6010 virtual INT32 getReplicaGroup (
const CHAR *pName,
6011 _sdbReplicaGroup **result ) = 0 ;
6013 virtual INT32 getReplicaGroup (
const CHAR *pName,
6014 sdbReplicaGroup &result ) = 0 ;
6016 virtual INT32 getReplicaGroup ( INT32
id,
6017 _sdbReplicaGroup **result ) = 0 ;
6019 virtual INT32 getReplicaGroup ( INT32
id,
6020 sdbReplicaGroup &result ) = 0 ;
6022 virtual INT32 createReplicaGroup (
const CHAR *pName,
6023 _sdbReplicaGroup **replicaGroup ) = 0 ;
6025 virtual INT32 createReplicaGroup (
const CHAR *pName,
6026 sdbReplicaGroup &replicaGroup ) = 0 ;
6028 virtual INT32 removeReplicaGroup (
const CHAR *pName ) = 0 ;
6030 virtual INT32 createReplicaCataGroup (
const CHAR *pHostName,
6031 const CHAR *pServiceName,
6032 const CHAR *pDatabasePath,
6033 const bson::BSONObj &configure ) =0 ;
6035 virtual INT32 activateReplicaGroup (
const CHAR *pName,
6036 _sdbReplicaGroup **replicaGroup ) = 0 ;
6037 virtual INT32 activateReplicaGroup (
const CHAR *pName,
6038 sdbReplicaGroup &replicaGroup ) = 0 ;
6040 virtual INT32 execUpdate(
const CHAR *sql,
6041 bson::BSONObj *pResult = NULL ) = 0 ;
6043 virtual INT32 exec(
const CHAR *sql,
6044 _sdbCursor **result ) = 0 ;
6046 virtual INT32 exec(
const CHAR *sql,
6047 sdbCursor &result ) = 0 ;
6049 virtual INT32 transactionBegin() = 0 ;
6051 virtual INT32 transactionCommit(
const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
6053 virtual INT32 transactionRollback() = 0 ;
6055 virtual INT32 flushConfigure(
const bson::BSONObj &options ) = 0 ;
6057 virtual INT32 crtJSProcedure (
const CHAR *code ) = 0 ;
6058 virtual INT32 rmProcedure(
const CHAR *spName ) = 0 ;
6059 virtual INT32 listProcedures( _sdbCursor **cursor,
const bson::BSONObj &condition ) = 0 ;
6060 virtual INT32 listProcedures( sdbCursor &cursor,
const bson::BSONObj &condition ) = 0 ;
6061 virtual INT32 evalJS(
const CHAR *code,
6063 _sdbCursor **cursor,
6064 bson::BSONObj &errmsg ) = 0 ;
6065 virtual INT32 evalJS(
const CHAR *code,
6068 bson::BSONObj &errmsg ) = 0 ;
6071 virtual INT32 backup (
const bson::BSONObj &options) = 0 ;
6072 virtual INT32 listBackup ( _sdbCursor **cursor,
6073 const bson::BSONObj &options,
6074 const bson::BSONObj &condition = _sdbStaticObject,
6075 const bson::BSONObj &selector = _sdbStaticObject,
6076 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
6077 virtual INT32 listBackup ( sdbCursor &cursor,
6078 const bson::BSONObj &options,
6079 const bson::BSONObj &condition = _sdbStaticObject,
6080 const bson::BSONObj &selector = _sdbStaticObject,
6081 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
6082 virtual INT32 removeBackup (
const bson::BSONObj &options ) = 0 ;
6085 virtual INT32 listTasks ( _sdbCursor **cursor,
6086 const bson::BSONObj &condition = _sdbStaticObject,
6087 const bson::BSONObj &selector = _sdbStaticObject,
6088 const bson::BSONObj &orderBy = _sdbStaticObject,
6089 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
6092 virtual INT32 listTasks ( sdbCursor &cursor,
6093 const bson::BSONObj &condition = _sdbStaticObject,
6094 const bson::BSONObj &selector = _sdbStaticObject,
6095 const bson::BSONObj &orderBy = _sdbStaticObject,
6096 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
6098 virtual INT32 waitTasks (
const SINT64 *taskIDs,
6101 virtual INT32 cancelTask ( SINT64 taskID,
6102 BOOLEAN isAsync ) = 0 ;
6104 virtual INT32 setSessionAttr (
const bson::BSONObj &options =
6105 _sdbStaticObject ) = 0 ;
6107 virtual INT32 getSessionAttr ( bson::BSONObj &result,
6108 BOOLEAN useCache = TRUE ) = 0 ;
6111 virtual INT32 closeAllCursors () = 0 ;
6114 virtual INT32 interrupt() = 0 ;
6115 virtual INT32 interruptOperation() = 0 ;
6118 virtual INT32 isValid( BOOLEAN *result ) = 0 ;
6119 virtual BOOLEAN isValid() = 0 ;
6121 virtual BOOLEAN isClosed() = 0 ;
6124 virtual INT32 createDomain (
const CHAR *pDomainName,
6125 const bson::BSONObj &options,
6126 _sdbDomain **domain ) = 0 ;
6128 virtual INT32 createDomain (
const CHAR *pDomainName,
6129 const bson::BSONObj &options,
6130 sdbDomain &domain ) = 0 ;
6132 virtual INT32 dropDomain (
const CHAR *pDomainName ) = 0 ;
6134 virtual INT32 getDomain (
const CHAR *pDomainName,
6135 _sdbDomain **domain ) = 0 ;
6137 virtual INT32 getDomain (
const CHAR *pDomainName,
6138 sdbDomain &domain ) = 0 ;
6140 virtual INT32 listDomains ( _sdbCursor **cursor,
6141 const bson::BSONObj &condition = _sdbStaticObject,
6142 const bson::BSONObj &selector = _sdbStaticObject,
6143 const bson::BSONObj &orderBy = _sdbStaticObject,
6144 const bson::BSONObj &hint = _sdbStaticObject
6147 virtual INT32 listDomains ( sdbCursor &cursor,
6148 const bson::BSONObj &condition = _sdbStaticObject,
6149 const bson::BSONObj &selector = _sdbStaticObject,
6150 const bson::BSONObj &orderBy = _sdbStaticObject,
6151 const bson::BSONObj &hint = _sdbStaticObject
6153 virtual INT32 getDC( _sdbDataCenter **dc ) = 0 ;
6154 virtual INT32 getDC( sdbDataCenter &dc ) = 0 ;
6156 virtual INT32 getRecycleBin( _sdbRecycleBin **recycleBin ) = 0 ;
6157 virtual INT32 getRecycleBin( sdbRecycleBin &recycleBin ) = 0 ;
6159 static _sdb *getObj ( BOOLEAN useSSL = FALSE ) ;
6162 virtual UINT64 getLastAliveTime()
const = 0 ;
6164 virtual INT32 syncDB(
6165 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6167 virtual INT32 analyze(
6168 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6170 virtual INT32 forceSession(
6172 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6174 virtual INT32 forceStepUp(
6175 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6177 virtual INT32 invalidateCache(
6178 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6180 virtual INT32 reloadConfig(
6181 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6183 virtual INT32 updateConfig (
const bson::BSONObj &configs = _sdbStaticObject,
6184 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6186 virtual INT32 deleteConfig (
const bson::BSONObj &configs = _sdbStaticObject,
6187 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6189 virtual INT32 setPDLevel( INT32 level,
6190 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6192 virtual INT32 memTrim(
const CHAR *maskStr =
"",
6193 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6195 virtual INT32 msg(
const CHAR* msg ) = 0 ;
6197 virtual INT32 loadCS(
const CHAR* csName,
6198 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6200 virtual INT32 unloadCS(
const CHAR* csName,
6201 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6203 virtual INT32 traceStart( UINT32 traceBufferSize,
6204 const CHAR* component = NULL,
6205 const CHAR* breakpoint = NULL,
6206 const vector<UINT32> &tidVec = _sdbStaticUINT32Vec ) = 0 ;
6208 virtual INT32 traceStart( UINT32 traceBufferSize,
6209 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6211 virtual INT32 traceStop(
const CHAR* dumpFileName ) = 0 ;
6213 virtual INT32 traceResume() = 0 ;
6215 virtual INT32 traceStatus( _sdbCursor** cursor ) = 0 ;
6217 virtual INT32 traceStatus( sdbCursor& cursor ) = 0 ;
6220 virtual INT32 renameCollectionSpace(
const CHAR* oldName,
6221 const CHAR* newName,
6222 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6224 virtual INT32 getLastErrorObj( bson::BSONObj &result ) = 0 ;
6225 virtual void cleanLastErrorObj() = 0 ;
6227 virtual INT32 getLastResultObj( bson::BSONObj &result,
6228 BOOLEAN getOwned = FALSE )
const = 0 ;
6231 virtual INT32 createSequence(
const CHAR *pSequenceName,
6232 const bson::BSONObj &options,
6233 _sdbSequence **sequence ) = 0 ;
6235 virtual INT32 createSequence(
const CHAR *pSequenceName,
6236 const bson::BSONObj &options,
6237 sdbSequence &sequence ) = 0 ;
6239 virtual INT32 createSequence(
const CHAR *pSequenceName,
6240 sdbSequence &sequence ) = 0 ;
6243 virtual INT32 getSequence(
const CHAR *pSequenceName,
6244 _sdbSequence **sequence ) = 0 ;
6246 virtual INT32 getSequence(
const CHAR *pSequenceName,
6247 sdbSequence &sequence ) = 0 ;
6249 virtual INT32 renameSequence(
const CHAR *pOldName,
6250 const CHAR *pNewName ) = 0 ;
6252 virtual INT32 dropSequence(
const CHAR *pSequenceName ) = 0 ;
6254 virtual INT32 createDataSource( _sdbDataSource **dataSource,
6255 const CHAR *pDataSourceName,
6256 const CHAR *addresses,
6257 const CHAR *user = NULL,
6258 const CHAR *password = NULL,
6259 const CHAR *type = NULL,
6260 const bson::BSONObj *options = NULL
6263 virtual INT32 dropDataSource(
const CHAR *pDataSourceName ) = 0 ;
6265 virtual INT32 getDataSource(
const CHAR *pDataSourceName,
6266 _sdbDataSource **dataSource ) = 0 ;
6268 virtual INT32 listDataSources( _sdbCursor** cursor,
6269 const bson::BSONObj &condition = _sdbStaticObject,
6270 const bson::BSONObj &selector = _sdbStaticObject,
6271 const bson::BSONObj &orderBy = _sdbStaticObject,
6272 const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
6274 virtual INT32 createRole(
const bson::BSONObj &role) = 0;
6276 virtual INT32 dropRole(
const CHAR *pRoleName ) = 0;
6278 virtual INT32 getRole(
const CHAR *pRoleName,
6279 const bson::BSONObj &options,
6280 bson::BSONObj &role ) = 0;
6282 virtual INT32 listRoles( _sdbCursor **result,
const bson::BSONObj &options ) = 0;
6284 virtual INT32 updateRole(
const CHAR *pRoleName,
6285 const bson::BSONObj &role ) = 0;
6287 virtual INT32 grantPrivilegesToRole(
const CHAR *pRoleName,
6288 const bson::BSONObj &privileges ) = 0;
6290 virtual INT32 revokePrivilegesFromRole(
const CHAR *pRoleName,
6291 const bson::BSONObj &privileges ) = 0;
6293 virtual INT32 grantRolesToRole(
const CHAR *pRoleName,
6294 const bson::BSONObj &roles ) = 0;
6296 virtual INT32 revokeRolesFromRole(
const CHAR *pRoleName,
6297 const bson::BSONObj &roles ) = 0;
6299 virtual INT32 grantRolesToUser(
const CHAR *pUsrName,
6300 const bson::BSONObj &roles ) = 0;
6302 virtual INT32 revokeRolesFromUser(
const CHAR *pUsrName,
6303 const bson::BSONObj &roles ) = 0;
6305 virtual INT32 getUser(
const CHAR *pUserName,
6306 const bson::BSONObj &options,
6307 bson::BSONObj &user ) = 0;
6309 virtual INT32 invalidateUserCache(
const CHAR *pUserName = NULL,
6310 const bson::BSONObj &options = _sdbStaticObject ) = 0;
6314 typedef class _sdb _sdb ;
6321 sdb (
const sdb& other ) ;
6322 sdb& operator=(
const sdb& ) ;
6336 sdb ( BOOLEAN useSSL = FALSE ) :
6337 pSDB ( _sdb::getObj( useSSL ) )
6361 INT32 connect (
const CHAR *pHostName,
6367 return SDB_NOT_CONNECTED ;
6369 return pSDB->
connect ( pHostName, port ) ;
6385 INT32 connect (
const CHAR *pHostName,
6387 const CHAR *pUsrName,
6393 return SDB_NOT_CONNECTED ;
6395 return pSDB->connect ( pHostName, port,
6396 pUsrName, pPasswd ) ;
6408 INT32 connect (
const CHAR *pHostName,
6409 const CHAR *pServiceName
6414 return SDB_NOT_CONNECTED ;
6416 return pSDB->connect ( pHostName, pServiceName ) ;
6432 INT32 connect (
const CHAR *pHostName,
6433 const CHAR *pServiceName,
6434 const CHAR *pUsrName,
6435 const CHAR *pPasswd )
6439 return SDB_NOT_CONNECTED ;
6441 return pSDB->connect ( pHostName, pServiceName,
6442 pUsrName, pPasswd ) ;
6458 INT32 connect (
const CHAR **pConnAddrs,
6460 const CHAR *pUsrName,
6461 const CHAR *pPasswd )
6465 return SDB_NOT_CONNECTED ;
6467 return pSDB->connect ( pConnAddrs, arrSize,
6468 pUsrName, pPasswd ) ;
6486 INT32 connect (
const CHAR **pConnAddrs,
6488 const CHAR *pUsrName,
6490 const CHAR *pCipherFile )
6494 return SDB_NOT_CONNECTED ;
6496 return pSDB->connect ( pConnAddrs, arrSize,
6497 pUsrName, pToken, pCipherFile ) ;
6504 UINT64 getDbStartTime ()
6510 return pSDB->getDbStartTime() ;
6517 const CHAR *getAddress ()
6523 return pSDB->getAddress () ;
6536 void getVersion ( UINT8 &version, UINT8 &subVersion, UINT8 &fixVersion )
6542 pSDB->getVersion( version, subVersion, fixVersion ) ;
6573 INT32 createUsr(
const CHAR *pUsrName,
6574 const CHAR *pPasswd,
6575 const bson::BSONObj &options = _sdbStaticObject )
6579 return SDB_NOT_CONNECTED ;
6581 return pSDB->createUsr( pUsrName, pPasswd, options ) ;
6592 INT32 removeUsr(
const CHAR *pUsrName,
6593 const CHAR *pPasswd )
6597 return SDB_NOT_CONNECTED ;
6599 return pSDB->removeUsr( pUsrName, pPasswd ) ;
6614 INT32 alterUsr(
const CHAR *pUsrName,
6615 const CHAR *pAction,
6616 const bson::BSONObj &options )
6620 return SDB_NOT_CONNECTED ;
6622 return pSDB->alterUsr( pUsrName, pAction, options ) ;
6635 INT32 changeUsrPasswd(
const CHAR *pUsrName,
6636 const CHAR *pOldPasswd,
6637 const CHAR *pNewPasswd )
6641 return SDB_NOT_CONNECTED ;
6643 return pSDB->changeUsrPasswd( pUsrName, pOldPasswd, pNewPasswd ) ;
6655 pSDB->disconnect () ;
6701 const bson::BSONObj &condition = _sdbStaticObject,
6702 const bson::BSONObj &selector = _sdbStaticObject,
6703 const bson::BSONObj &orderBy = _sdbStaticObject,
6704 const bson::BSONObj &hint = _sdbStaticObject,
6705 INT64 numToSkip = 0,
6706 INT64 numToReturn = -1 )
6710 return SDB_NOT_CONNECTED ;
6713 return pSDB->getSnapshot ( cursor, snapType, condition,
6714 selector, orderBy, hint,
6715 numToSkip, numToReturn ) ;
6760 INT32 getSnapshot ( _sdbCursor **cursor,
6762 const bson::BSONObj &condition = _sdbStaticObject,
6763 const bson::BSONObj &selector = _sdbStaticObject,
6764 const bson::BSONObj &orderBy = _sdbStaticObject,
6765 const bson::BSONObj &hint = _sdbStaticObject,
6766 INT64 numToSkip = 0,
6767 INT64 numToReturn = -1 )
6771 return SDB_NOT_CONNECTED ;
6773 return pSDB->getSnapshot ( cursor, snapType, condition,
6774 selector, orderBy, hint,
6775 numToSkip, numToReturn ) ;
6800 INT32 resetSnapshot (
const bson::BSONObj &options = _sdbStaticObject )
6804 return SDB_NOT_CONNECTED ;
6806 return pSDB->resetSnapshot ( options ) ;
6809 INT32 getList ( _sdbCursor **cursor,
6811 const bson::BSONObj &condition = _sdbStaticObject,
6812 const bson::BSONObj &selector = _sdbStaticObject,
6813 const bson::BSONObj &orderBy = _sdbStaticObject,
6814 const bson::BSONObj &hint = _sdbStaticObject,
6815 INT64 numToSkip = 0,
6816 INT64 numToReturn = -1
6821 return SDB_NOT_CONNECTED ;
6823 return pSDB->getList ( cursor, listType,
6824 condition, selector, orderBy, hint,
6825 numToSkip, numToReturn ) ;
6872 const bson::BSONObj &condition = _sdbStaticObject,
6873 const bson::BSONObj &selector = _sdbStaticObject,
6874 const bson::BSONObj &orderBy = _sdbStaticObject,
6875 const bson::BSONObj &hint = _sdbStaticObject,
6876 INT64 numToSkip = 0,
6877 INT64 numToReturn = -1
6882 return SDB_NOT_CONNECTED ;
6885 return pSDB->getList ( cursor, listType,
6886 condition, selector, orderBy, hint,
6887 numToSkip, numToReturn ) ;
6890 INT32 getCollection (
const CHAR *pCollectionFullName,
6891 _sdbCollection **collection,
6892 BOOLEAN checkExist = TRUE
6897 return SDB_NOT_CONNECTED ;
6899 return pSDB->getCollection ( pCollectionFullName,
6900 collection, checkExist ) ;
6913 INT32 getCollection (
const CHAR *pCollectionFullName,
6915 BOOLEAN checkExist = TRUE
6920 return SDB_NOT_CONNECTED ;
6923 return pSDB->getCollection ( pCollectionFullName,
6928 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
6929 _sdbCollectionSpace **cs,
6930 BOOLEAN checkExist = TRUE
6935 return SDB_NOT_CONNECTED ;
6937 return pSDB->getCollectionSpace ( pCollectionSpaceName,
6951 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
6953 BOOLEAN checkExist = TRUE
6958 return SDB_NOT_CONNECTED ;
6961 return pSDB->getCollectionSpace ( pCollectionSpaceName,
6965 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
6967 _sdbCollectionSpace **cs
6972 return SDB_NOT_CONNECTED ;
6974 return pSDB->createCollectionSpace ( pCollectionSpaceName,
6997 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
7004 return SDB_NOT_CONNECTED ;
7007 return pSDB->createCollectionSpace ( pCollectionSpaceName,
7011 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
7012 const bson::BSONObj &options,
7013 _sdbCollectionSpace **cs
7018 return SDB_NOT_CONNECTED ;
7020 return pSDB->createCollectionSpace ( pCollectionSpaceName,
7041 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
7042 const bson::BSONObj &options,
7048 return SDB_NOT_CONNECTED ;
7051 return pSDB->createCollectionSpace ( pCollectionSpaceName,
7063 INT32 dropCollectionSpace (
7064 const CHAR *pCollectionSpaceName,
7065 const bson::BSONObj &options = _sdbStaticObject )
7069 return SDB_NOT_CONNECTED ;
7072 return pSDB->dropCollectionSpace ( pCollectionSpaceName, options ) ;
7075 INT32 listCollectionSpaces ( _sdbCursor **result )
7079 return SDB_NOT_CONNECTED ;
7081 return pSDB->listCollectionSpaces ( result ) ;
7094 return SDB_NOT_CONNECTED ;
7097 return pSDB->listCollectionSpaces ( cursor ) ;
7106 INT32 listCollections ( _sdbCursor **result )
7110 return SDB_NOT_CONNECTED ;
7112 return pSDB->listCollections ( result ) ;
7125 return SDB_NOT_CONNECTED ;
7128 return pSDB->listCollections ( cursor ) ;
7137 INT32 listReplicaGroups ( _sdbCursor **result )
7141 return SDB_NOT_CONNECTED ;
7143 return pSDB->listReplicaGroups ( result ) ;
7157 return SDB_NOT_CONNECTED ;
7160 return pSDB->listReplicaGroups ( cursor ) ;
7170 INT32 getReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **result )
7174 return SDB_NOT_CONNECTED ;
7176 return pSDB->getReplicaGroup ( pName, result ) ;
7191 return SDB_NOT_CONNECTED ;
7194 return pSDB->getReplicaGroup ( pName, group ) ;
7204 INT32 getReplicaGroup ( INT32
id, _sdbReplicaGroup **result )
7208 return SDB_NOT_CONNECTED ;
7210 return pSDB->getReplicaGroup (
id, result ) ;
7224 return SDB_NOT_CONNECTED ;
7227 return pSDB->getReplicaGroup (
id, group ) ;
7237 INT32 createReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **replicaGroup )
7241 return SDB_NOT_CONNECTED ;
7243 return pSDB->createReplicaGroup ( pName, replicaGroup ) ;
7257 return SDB_NOT_CONNECTED ;
7260 return pSDB->createReplicaGroup ( pName, group ) ;
7269 INT32 removeReplicaGroup (
const CHAR *pName )
7273 return SDB_NOT_CONNECTED ;
7275 return pSDB->removeReplicaGroup ( pName ) ;
7290 INT32 createReplicaCataGroup (
const CHAR *pHostName,
7291 const CHAR *pServiceName,
7292 const CHAR *pDatabasePath,
7293 const bson::BSONObj &configure )
7297 return SDB_NOT_CONNECTED ;
7299 return pSDB->createReplicaCataGroup ( pHostName, pServiceName,
7300 pDatabasePath, configure ) ;
7303 INT32 activateReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **replicaGroup )
7307 return SDB_NOT_CONNECTED ;
7309 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
7323 return SDB_NOT_CONNECTED ;
7326 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
7336 INT32 execUpdate(
const CHAR *sql, bson::BSONObj *pResult = NULL )
7340 return SDB_NOT_CONNECTED ;
7342 return pSDB->execUpdate( sql, pResult ) ;
7353 INT32 exec(
const CHAR *sql,
7354 _sdbCursor **result )
7358 return SDB_NOT_CONNECTED ;
7360 return pSDB->exec( sql, result ) ;
7371 INT32 exec(
const CHAR *sql,
7376 return SDB_NOT_CONNECTED ;
7379 return pSDB->exec( sql, cursor ) ;
7387 INT32 transactionBegin()
7391 return SDB_NOT_CONNECTED ;
7393 return pSDB->transactionBegin() ;
7403 INT32 transactionCommit(
const bson::BSONObj &hint = _sdbStaticObject )
7407 return SDB_NOT_CONNECTED ;
7409 return pSDB->transactionCommit( hint ) ;
7417 INT32 transactionRollback()
7421 return SDB_NOT_CONNECTED ;
7423 return pSDB->transactionRollback() ;
7434 INT32 flushConfigure(
const bson::BSONObj &options )
7438 return SDB_NOT_CONNECTED ;
7440 return pSDB->flushConfigure( options ) ;
7449 INT32 crtJSProcedure (
const CHAR *code )
7453 return SDB_NOT_CONNECTED ;
7455 return pSDB->crtJSProcedure( code ) ;
7464 INT32 rmProcedure(
const CHAR *spName )
7468 return SDB_NOT_CONNECTED ;
7470 return pSDB->rmProcedure( spName ) ;
7473 INT32 listProcedures( _sdbCursor **cursor,
const bson::BSONObj &condition )
7477 return SDB_NOT_CONNECTED ;
7479 return pSDB->listProcedures( cursor, condition ) ;
7489 INT32 listProcedures(
sdbCursor &cursor,
const bson::BSONObj &condition )
7493 return SDB_NOT_CONNECTED ;
7496 return pSDB->listProcedures( cursor, condition ) ;
7499 INT32 evalJS(
const CHAR *code,
7501 _sdbCursor **cursor,
7502 bson::BSONObj &errmsg )
7506 return SDB_NOT_CONNECTED ;
7508 return pSDB->evalJS( code, type, cursor, errmsg ) ;
7525 bson::BSONObj &errmsg )
7529 return SDB_NOT_CONNECTED ;
7532 return pSDB->evalJS( code, type, cursor, errmsg ) ;
7554 INT32 backupOffline (
const bson::BSONObj &options)
7556 return backup( options ) ;
7577 INT32 backup (
const bson::BSONObj &options)
7581 return SDB_NOT_CONNECTED ;
7583 return pSDB->backup( options ) ;
7587 INT32 listBackup ( _sdbCursor **cursor,
7588 const bson::BSONObj &options,
7589 const bson::BSONObj &condition = _sdbStaticObject,
7590 const bson::BSONObj &selector = _sdbStaticObject,
7591 const bson::BSONObj &orderBy = _sdbStaticObject)
7595 return SDB_NOT_CONNECTED ;
7597 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
7623 const bson::BSONObj &options,
7624 const bson::BSONObj &condition = _sdbStaticObject,
7625 const bson::BSONObj &selector = _sdbStaticObject,
7626 const bson::BSONObj &orderBy = _sdbStaticObject)
7630 return SDB_NOT_CONNECTED ;
7633 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
7650 INT32 removeBackup (
const bson::BSONObj &options)
7654 return SDB_NOT_CONNECTED ;
7656 return pSDB->removeBackup( options ) ;
7659 INT32 listTasks ( _sdbCursor **cursor,
7660 const bson::BSONObj &condition = _sdbStaticObject,
7661 const bson::BSONObj &selector = _sdbStaticObject,
7662 const bson::BSONObj &orderBy = _sdbStaticObject,
7663 const bson::BSONObj &hint = _sdbStaticObject)
7667 return SDB_NOT_CONNECTED ;
7669 return pSDB->listTasks ( cursor,
7693 const bson::BSONObj &condition = _sdbStaticObject,
7694 const bson::BSONObj &selector = _sdbStaticObject,
7695 const bson::BSONObj &orderBy = _sdbStaticObject,
7696 const bson::BSONObj &hint = _sdbStaticObject)
7700 return SDB_NOT_CONNECTED ;
7703 return pSDB->listTasks ( cursor,
7718 INT32 waitTasks (
const SINT64 *taskIDs,
7723 return SDB_NOT_CONNECTED ;
7725 return pSDB->waitTasks ( taskIDs,
7738 INT32 cancelTask ( SINT64 taskID,
7743 return SDB_NOT_CONNECTED ;
7745 return pSDB->cancelTask ( taskID,
7759 INT32 setSessionAttr (
const bson::BSONObj &options = _sdbStaticObject )
7763 return SDB_NOT_CONNECTED ;
7765 return pSDB->setSessionAttr ( options ) ;
7776 INT32 getSessionAttr ( bson::BSONObj & result,
7777 BOOLEAN useCache = TRUE )
7781 return SDB_NOT_CONNECTED ;
7783 return pSDB->getSessionAttr( result, useCache ) ;
7792 INT32 closeAllCursors ()
7794 return interrupt() ;
7807 return SDB_NOT_CONNECTED ;
7809 return pSDB->interrupt () ;
7820 INT32 interruptOperation()
7824 return SDB_NOT_CONNECTED ;
7826 return pSDB->interruptOperation () ;
7836 INT32 isValid ( BOOLEAN *result )
7840 return SDB_NOT_CONNECTED ;
7842 return pSDB->isValid ( result ) ;
7855 return pSDB->isValid () ;
7868 return pSDB->isClosed() ;
7889 INT32 createDomain (
const CHAR *pDomainName,
7890 const bson::BSONObj &options,
7895 return SDB_NOT_CONNECTED ;
7898 return pSDB->createDomain ( pDomainName, options, domain ) ;
7901 INT32 createDomain (
const CHAR *pDomainName,
7902 const bson::BSONObj &options,
7903 _sdbDomain **domain )
7907 return SDB_NOT_CONNECTED ;
7909 return pSDB->createDomain ( pDomainName, options, domain ) ;
7918 INT32 dropDomain (
const CHAR *pDomainName )
7922 return SDB_NOT_CONNECTED ;
7924 return pSDB->dropDomain ( pDomainName ) ;
7927 INT32 getDomain (
const CHAR *pDomainName,
7928 _sdbDomain **domain )
7932 return SDB_NOT_CONNECTED ;
7934 return pSDB->getDomain ( pDomainName, domain ) ;
7945 INT32 getDomain (
const CHAR *pDomainName,
7950 return SDB_NOT_CONNECTED ;
7953 return pSDB->getDomain ( pDomainName, domain ) ;
7956 INT32 listDomains ( _sdbCursor **cursor,
7957 const bson::BSONObj &condition = _sdbStaticObject,
7958 const bson::BSONObj &selector = _sdbStaticObject,
7959 const bson::BSONObj &orderBy = _sdbStaticObject,
7960 const bson::BSONObj &hint = _sdbStaticObject )
7964 return SDB_NOT_CONNECTED ;
7966 return pSDB->listDomains ( cursor, condition, selector, orderBy, hint ) ;
7987 const bson::BSONObj &condition = _sdbStaticObject,
7988 const bson::BSONObj &selector = _sdbStaticObject,
7989 const bson::BSONObj &orderBy = _sdbStaticObject,
7990 const bson::BSONObj &hint = _sdbStaticObject )
7994 return SDB_NOT_CONNECTED ;
7997 return pSDB->listDomains ( cursor, condition, selector, orderBy, hint ) ;
8005 INT32 getDC( sdbDataCenter &dc )
8009 return SDB_NOT_CONNECTED ;
8012 return pSDB->getDC ( dc ) ;
8020 INT32 getDC( _sdbDataCenter **dc )
8024 return SDB_NOT_CONNECTED ;
8026 return pSDB->getDC ( dc ) ;
8034 INT32 getRecycleBin( sdbRecycleBin &recycleBin )
8038 return SDB_NOT_CONNECTED ;
8041 return pSDB->getRecycleBin( recycleBin ) ;
8049 INT32 getRecycleBin( _sdbRecycleBin **recycleBin )
8053 return SDB_NOT_CONNECTED ;
8055 return pSDB->getRecycleBin( recycleBin ) ;
8087 INT32 syncDB(
const bson::BSONObj &options = _sdbStaticObject )
8091 return SDB_NOT_CONNECTED ;
8093 return pSDB->syncDB ( options ) ;
8122 INT32 analyze (
const bson::BSONObj &options = _sdbStaticObject )
8126 return SDB_NOT_CONNECTED ;
8128 return pSDB->analyze ( options ) ;
8146 INT32 forceSession( SINT64 sessionID,
8147 const bson::BSONObj &options = _sdbStaticObject )
8151 return SDB_NOT_CONNECTED ;
8153 return pSDB->forceSession( sessionID, options ) ;
8170 INT32 forceStepUp(
const bson::BSONObj &options = _sdbStaticObject )
8174 return SDB_NOT_CONNECTED ;
8176 return pSDB->forceStepUp( options ) ;
8191 INT32 invalidateCache(
const bson::BSONObj &options = _sdbStaticObject )
8195 return SDB_NOT_CONNECTED ;
8197 return pSDB->invalidateCache( options ) ;
8213 INT32 reloadConfig(
const bson::BSONObj &options = _sdbStaticObject )
8217 return SDB_NOT_CONNECTED ;
8219 return pSDB->reloadConfig( options ) ;
8238 INT32 updateConfig(
const bson::BSONObj &configs = _sdbStaticObject,
8239 const bson::BSONObj &options = _sdbStaticObject )
8243 return SDB_NOT_CONNECTED ;
8245 return pSDB->updateConfig( configs, options ) ;
8264 INT32 deleteConfig(
const bson::BSONObj &configs = _sdbStaticObject,
8265 const bson::BSONObj &options = _sdbStaticObject )
8269 return SDB_NOT_CONNECTED ;
8271 return pSDB->deleteConfig( configs, options ) ;
8296 INT32 setPDLevel( INT32 level,
8297 const bson::BSONObj &options = _sdbStaticObject )
8301 return SDB_NOT_CONNECTED ;
8303 return pSDB->setPDLevel( level, options ) ;
8321 INT32 memTrim(
const CHAR *maskStr =
"",
8322 const bson::BSONObj &options = _sdbStaticObject )
8326 return SDB_NOT_CONNECTED ;
8328 return pSDB->memTrim( maskStr, options ) ;
8331 INT32 msg(
const CHAR* msg )
8335 return SDB_NOT_CONNECTED ;
8337 return pSDB->msg( msg ) ;
8355 INT32 loadCS(
const CHAR* csName,
8356 const bson::BSONObj &options = _sdbStaticObject )
8360 return SDB_NOT_CONNECTED ;
8362 return pSDB->loadCS( csName, options ) ;
8380 INT32 unloadCS(
const CHAR* csName,
8381 const bson::BSONObj &options = _sdbStaticObject )
8385 return SDB_NOT_CONNECTED ;
8387 return pSDB->unloadCS( csName, options ) ;
8402 INT32 traceStart( UINT32 traceBufferSize,
8403 const CHAR* component = NULL,
8404 const CHAR* breakpoint = NULL,
8405 const vector<UINT32> &tidVec = _sdbStaticUINT32Vec )
8409 return SDB_NOT_CONNECTED ;
8411 return pSDB->traceStart( traceBufferSize, component,
8412 breakpoint, tidVec ) ;
8434 INT32 traceStart( UINT32 traceBufferSize,
8435 const bson::BSONObj &options )
8439 return SDB_NOT_CONNECTED ;
8441 return pSDB->traceStart( traceBufferSize, options ) ;
8452 INT32 traceStop(
const CHAR* dumpFileName )
8456 return SDB_NOT_CONNECTED ;
8458 return pSDB->traceStop( dumpFileName ) ;
8470 return SDB_NOT_CONNECTED ;
8472 return pSDB->traceResume() ;
8485 return SDB_NOT_CONNECTED ;
8488 return pSDB->traceStatus( cursor ) ;
8491 INT32 traceStatus( _sdbCursor** cursor )
8495 return SDB_NOT_CONNECTED ;
8497 return pSDB->traceStatus( cursor ) ;
8510 INT32 renameCollectionSpace(
const CHAR* oldName,
8511 const CHAR* newName,
8512 const bson::BSONObj &options = _sdbStaticObject )
8516 return SDB_NOT_CONNECTED ;
8518 return pSDB->renameCollectionSpace( oldName, newName, options ) ;
8532 INT32 getLastErrorObj( bson::BSONObj &errObj )
8536 return SDB_NOT_CONNECTED ;
8538 return pSDB->getLastErrorObj( errObj ) ;
8544 void cleanLastErrorObj()
8550 return pSDB->cleanLastErrorObj() ;
8563 INT32 getLastResultObj( bson::BSONObj &result,
8564 BOOLEAN getOwned = FALSE )
const
8568 return SDB_NOT_CONNECTED ;
8570 return pSDB->getLastResultObj( result, getOwned ) ;
8592 INT32 createSequence(
const CHAR *pSequenceName,
8593 const bson::BSONObj &options,
8594 _sdbSequence **sequence )
8598 return SDB_NOT_CONNECTED ;
8600 return pSDB->createSequence( pSequenceName, options, sequence ) ;
8622 INT32 createSequence(
const CHAR *pSequenceName,
8623 const bson::BSONObj &options,
8628 return SDB_NOT_CONNECTED ;
8630 return pSDB->createSequence( pSequenceName, options, sequence ) ;
8641 INT32 createSequence(
const CHAR *pSequenceName,
8646 return SDB_NOT_CONNECTED ;
8648 return pSDB->createSequence( pSequenceName, sequence ) ;
8659 INT32 getSequence(
const CHAR *pSequenceName,
8660 _sdbSequence **sequence )
8664 return SDB_NOT_CONNECTED ;
8666 return pSDB->getSequence( pSequenceName, sequence ) ;
8677 INT32 getSequence(
const CHAR *pSequenceName,
8682 return SDB_NOT_CONNECTED ;
8684 return pSDB->getSequence( pSequenceName, sequence ) ;
8694 INT32 renameSequence(
const CHAR *pOldName,
const CHAR *pNewName )
8698 return SDB_NOT_CONNECTED ;
8700 return pSDB->renameSequence( pOldName, pNewName ) ;
8709 INT32 dropSequence(
const CHAR *pSequenceName )
8713 return SDB_NOT_CONNECTED ;
8715 return pSDB->dropSequence( pSequenceName ) ;
8767 const CHAR *pDataSourceName,
8768 const CHAR *addresses,
8769 const CHAR *user = NULL,
8770 const CHAR *password = NULL,
8771 const CHAR *type = NULL,
8772 const bson::BSONObj *options = NULL )
8776 return SDB_NOT_CONNECTED ;
8779 return pSDB->createDataSource( &dataSource.pDataSource, pDataSourceName, addresses,
8780 user, password, type, options ) ;
8789 INT32 dropDataSource(
const CHAR *pDataSourceName )
8793 return SDB_NOT_CONNECTED ;
8795 return pSDB->dropDataSource( pDataSourceName ) ;
8806 INT32 getDataSource(
const CHAR *pDataSourceName,
8811 return SDB_NOT_CONNECTED ;
8814 return pSDB->getDataSource( pDataSourceName, &dataSource.pDataSource ) ;
8832 const bson::BSONObj &condition = _sdbStaticObject,
8833 const bson::BSONObj &selector = _sdbStaticObject,
8834 const bson::BSONObj &orderBy = _sdbStaticObject,
8835 const bson::BSONObj &hint = _sdbStaticObject )
8839 return SDB_NOT_CONNECTED ;
8842 return pSDB->listDataSources( &cursor.
pCursor, condition, selector, orderBy, hint ) ;
8851 INT32 createRole(
const bson::BSONObj &role )
8855 return SDB_NOT_CONNECTED ;
8857 return pSDB->createRole( role ) ;
8866 INT32 dropRole(
const CHAR *pRoleName )
8870 return SDB_NOT_CONNECTED ;
8872 return pSDB->dropRole( pRoleName ) ;
8888 INT32 getRole(
const CHAR *pRoleName,
8889 const bson::BSONObj &options,
8890 bson::BSONObj &role )
8894 return SDB_NOT_CONNECTED ;
8896 return pSDB->getRole( pRoleName, options, role ) ;
8911 INT32 listRoles(
sdbCursor &cursor,
const bson::BSONObj &options )
8915 return SDB_NOT_CONNECTED ;
8918 return pSDB->listRoles( &cursor.
pCursor, options ) ;
8929 INT32 updateRole(
const CHAR *pRoleName,
8930 const bson::BSONObj &role )
8934 return SDB_NOT_CONNECTED ;
8936 return pSDB->updateRole( pRoleName, role ) ;
8947 INT32 grantPrivilegesToRole(
const CHAR *pRoleName,
8948 const bson::BSONObj &privileges )
8952 return SDB_NOT_CONNECTED ;
8954 return pSDB->grantPrivilegesToRole( pRoleName, privileges ) ;
8965 INT32 revokePrivilegesFromRole(
const CHAR *pRoleName,
8966 const bson::BSONObj &privileges )
8970 return SDB_NOT_CONNECTED ;
8972 return pSDB->revokePrivilegesFromRole( pRoleName, privileges ) ;
8983 INT32 grantRolesToRole(
const CHAR *pRoleName,
8984 const bson::BSONObj &roles )
8988 return SDB_NOT_CONNECTED ;
8990 return pSDB->grantRolesToRole( pRoleName, roles ) ;
9001 INT32 revokeRolesFromRole(
const CHAR *pRoleName,
9002 const bson::BSONObj &roles )
9006 return SDB_NOT_CONNECTED ;
9008 return pSDB->revokeRolesFromRole( pRoleName, roles ) ;
9019 INT32 grantRolesToUser(
const CHAR *pUserName,
9020 const bson::BSONObj &privileges )
9024 return SDB_NOT_CONNECTED ;
9026 return pSDB->grantRolesToUser( pUserName, privileges ) ;
9037 INT32 revokeRolesFromUser(
const CHAR *pUserName,
9038 const bson::BSONObj &privileges )
9042 return SDB_NOT_CONNECTED ;
9044 return pSDB->revokeRolesFromUser( pUserName, privileges ) ;
9058 INT32 getUser(
const CHAR *pRoleName,
9059 const bson::BSONObj &options,
9060 bson::BSONObj &role )
9064 return SDB_NOT_CONNECTED ;
9066 return pSDB->getUser( pRoleName, options, role ) ;
9084 INT32 invalidateUserCache(
const CHAR *pUserName = NULL,
9085 const bson::BSONObj &options = _sdbStaticObject )
9089 return SDB_NOT_CONNECTED ;
9091 return pSDB->invalidateUserCache( pUserName, options ) ;