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 1000
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,
584 const bson::OID *oid = NULL,
585 const bson::BSONObj &userObj = _sdbStaticObject ) = 0 ;
587 virtual INT32 removeLob(
const bson::OID &oid ) = 0 ;
589 virtual INT32 truncateLob(
const bson::OID &oid, INT64 length ) = 0 ;
591 virtual INT32 openLob( sdbLob &lob,
const bson::OID &oid,
594 virtual INT32 openLob( sdbLob &lob,
const bson::OID &oid,
597 virtual INT32 listLobs( sdbCursor &cursor,
598 const bson::BSONObj &condition = _sdbStaticObject,
599 const bson::BSONObj &selected = _sdbStaticObject,
600 const bson::BSONObj &orderBy = _sdbStaticObject,
601 const bson::BSONObj &hint = _sdbStaticObject,
603 INT64 numToReturn = -1 ) = 0 ;
605 virtual INT32 listLobs( _sdbCursor **cursor,
606 const bson::BSONObj &condition = _sdbStaticObject,
607 const bson::BSONObj &selected = _sdbStaticObject,
608 const bson::BSONObj &orderBy = _sdbStaticObject,
609 const bson::BSONObj &hint = _sdbStaticObject,
611 INT64 numToReturn = -1 ) = 0 ;
613 virtual INT32 createLobID( bson::OID &oid,
const CHAR *pTimeStamp = NULL ) = 0 ;
615 virtual INT32 lobExplain(
const bson::OID &oid,
616 bson::BSONObj &result,
617 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
619 virtual INT32 listLobPieces(
621 const bson::BSONObj &condition = _sdbStaticObject,
622 const bson::BSONObj &selected = _sdbStaticObject,
623 const bson::BSONObj &orderBy = _sdbStaticObject,
624 const bson::BSONObj &hint = _sdbStaticObject,
626 INT64 numToReturn = -1 ) = 0 ;
628 virtual INT32 listLobPieces(
630 const bson::BSONObj &condition = _sdbStaticObject,
631 const bson::BSONObj &selected = _sdbStaticObject,
632 const bson::BSONObj &orderBy = _sdbStaticObject,
633 const bson::BSONObj &hint = _sdbStaticObject,
635 INT64 numToReturn = -1 ) = 0 ;
638 virtual INT32 truncate(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
641 virtual INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
643 virtual INT32 dropIdIndex() = 0 ;
645 virtual INT32 createAutoIncrement(
const bson::BSONObj &options ) = 0;
647 virtual INT32 createAutoIncrement(
const std::vector<bson::BSONObj> &options ) = 0;
649 virtual INT32 dropAutoIncrement(
const CHAR *fieldName ) = 0;
651 virtual INT32 dropAutoIncrement(
const std::vector<const CHAR*> &fieldNames ) = 0;
653 virtual INT32 pop (
const bson::BSONObj &option = _sdbStaticObject ) = 0 ;
655 virtual INT32 enableSharding (
const bson::BSONObj &options ) = 0 ;
657 virtual INT32 disableSharding () = 0 ;
659 virtual INT32 enableCompression (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
661 virtual INT32 disableCompression () = 0 ;
663 virtual INT32 setAttributes (
const bson::BSONObj &options ) = 0 ;
665 virtual INT32 getDetail ( _sdbCursor **cursor,
666 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
668 virtual INT32 getDetail ( sdbCursor &cursor,
669 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
671 virtual INT32 getCollectionStat ( bson::BSONObj &result ) = 0 ;
673 virtual INT32 getIndexStat (
const CHAR *pIndexName,
674 bson::BSONObj &result,
675 BOOLEAN detail = FALSE ) = 0 ;
677 virtual void setVersion( INT32 clVersion ) = 0;
678 virtual INT32 getVersion() = 0;
679 virtual INT32 setConsistencyStrategy( INT32 value ) = 0 ;
741 INT32 getCount ( SINT64 &count,
742 const bson::BSONObj &condition = _sdbStaticObject,
743 const bson::BSONObj &hint = _sdbStaticObject )
747 return SDB_NOT_CONNECTED ;
749 return pCollection->
getCount ( count, condition, hint ) ;
769 INT32 split (
const CHAR *pSourceGroupName,
770 const CHAR *pTargetGroupName,
771 const bson::BSONObj &splitCondition,
772 const bson::BSONObj &splitEndCondition = _sdbStaticObject)
776 return SDB_NOT_CONNECTED ;
778 return pCollection->split ( pSourceGroupName,
795 INT32 split (
const CHAR *pSourceGroupName,
796 const CHAR *pTargetGroupName,
801 return SDB_NOT_CONNECTED ;
803 return pCollection->split ( pSourceGroupName,
827 INT32 splitAsync ( SINT64 &taskID,
828 const CHAR *pSourceGroupName,
829 const CHAR *pTargetGroupName,
830 const bson::BSONObj &splitCondition,
831 const bson::BSONObj &splitEndCondition = _sdbStaticObject )
835 return SDB_NOT_CONNECTED ;
837 return pCollection->splitAsync ( taskID,
841 splitEndCondition ) ;
857 INT32 splitAsync (
const CHAR *pSourceGroupName,
858 const CHAR *pTargetGroupName,
864 return SDB_NOT_CONNECTED ;
866 return pCollection->splitAsync ( pSourceGroupName,
898 INT32 alterCollection (
const bson::BSONObj &options )
902 return SDB_NOT_CONNECTED ;
904 return pCollection->alterCollection ( options ) ;
929 INT32 insert (
const bson::BSONObj &obj, bson::OID *pId = NULL )
933 return SDB_NOT_CONNECTED ;
935 return pCollection->insert ( obj, pId ) ;
984 INT32 insert (
const bson::BSONObj &obj,
986 bson::BSONObj *pResult = NULL )
990 return SDB_NOT_CONNECTED ;
992 return pCollection->insert ( obj, flags, pResult ) ;
1051 INT32 insert (
const bson::BSONObj &obj,
1052 const bson::BSONObj &hint,
1054 bson::BSONObj *pResult = NULL )
1058 return SDB_NOT_CONNECTED ;
1060 return pCollection->insert ( obj, hint, flags, pResult ) ;
1112 INT32 insert ( std::vector<bson::BSONObj> &objs,
1114 bson::BSONObj *pResult = NULL )
1118 return SDB_NOT_CONNECTED ;
1120 return pCollection->insert( objs, flags, pResult ) ;
1177 INT32 insert ( std::vector<bson::BSONObj> &objs,
1178 const bson::BSONObj &hint,
1180 bson::BSONObj *pResult = NULL )
1184 return SDB_NOT_CONNECTED ;
1186 return pCollection->insert( objs, hint, flags, pResult ) ;
1240 INT32 insert (
const bson::BSONObj objs[],
1243 bson::BSONObj *pResult = NULL )
1247 return SDB_NOT_CONNECTED ;
1249 return pCollection->insert ( objs, size, flags, pResult ) ;
1279 INT32 bulkInsert ( SINT32 flags,
1280 std::vector<bson::BSONObj> &objs )
1284 return SDB_NOT_CONNECTED ;
1286 return pCollection->bulkInsert ( flags, objs ) ;
1321 INT32 update (
const bson::BSONObj &rule,
1322 const bson::BSONObj &condition = _sdbStaticObject,
1323 const bson::BSONObj &hint = _sdbStaticObject,
1325 bson::BSONObj *pResult = NULL
1330 return SDB_NOT_CONNECTED ;
1332 return pCollection->update ( rule, condition, hint, flag, pResult ) ;
1368 INT32 upsert (
const bson::BSONObj &rule,
1369 const bson::BSONObj &condition = _sdbStaticObject,
1370 const bson::BSONObj &hint = _sdbStaticObject,
1371 const bson::BSONObj &setOnInsert = _sdbStaticObject,
1373 bson::BSONObj *pResult = NULL
1378 return SDB_NOT_CONNECTED ;
1380 return pCollection->upsert ( rule, condition, hint, setOnInsert,
1405 INT32 del (
const bson::BSONObj &condition = _sdbStaticObject,
1406 const bson::BSONObj &hint = _sdbStaticObject,
1408 bson::BSONObj *pResult = NULL
1413 return SDB_NOT_CONNECTED ;
1415 return pCollection->del ( condition, hint, flag, pResult ) ;
1448 INT32 query ( _sdbCursor **cursor,
1449 const bson::BSONObj &condition = _sdbStaticObject,
1450 const bson::BSONObj &selected = _sdbStaticObject,
1451 const bson::BSONObj &orderBy = _sdbStaticObject,
1452 const bson::BSONObj &hint = _sdbStaticObject,
1453 INT64 numToSkip = 0,
1454 INT64 numToReturn = -1,
1460 return SDB_NOT_CONNECTED ;
1462 return pCollection->query ( cursor, condition, selected, orderBy,
1463 hint, numToSkip, numToReturn, flags ) ;
1497 const bson::BSONObj &condition = _sdbStaticObject,
1498 const bson::BSONObj &selected = _sdbStaticObject,
1499 const bson::BSONObj &orderBy = _sdbStaticObject,
1500 const bson::BSONObj &hint = _sdbStaticObject,
1501 INT64 numToSkip = 0,
1502 INT64 numToReturn = -1,
1508 return SDB_NOT_CONNECTED ;
1511 return pCollection->query ( cursor, condition, selected, orderBy,
1512 hint, numToSkip, numToReturn, flags ) ;
1543 INT32 queryOne( bson::BSONObj &obj,
1544 const bson::BSONObj &condition = _sdbStaticObject,
1545 const bson::BSONObj &selected = _sdbStaticObject,
1546 const bson::BSONObj &orderBy = _sdbStaticObject,
1547 const bson::BSONObj &hint = _sdbStaticObject,
1548 INT64 numToSkip = 0,
1553 return SDB_NOT_CONNECTED ;
1555 return pCollection->queryOne( obj, condition, selected, orderBy,
1556 hint, numToSkip, flag ) ;
1595 const bson::BSONObj &update,
1596 const bson::BSONObj &condition = _sdbStaticObject,
1597 const bson::BSONObj &selected = _sdbStaticObject,
1598 const bson::BSONObj &orderBy = _sdbStaticObject,
1599 const bson::BSONObj &hint = _sdbStaticObject,
1600 INT64 numToSkip = 0,
1601 INT64 numToReturn = -1,
1603 BOOLEAN returnNew = FALSE
1608 return SDB_NOT_CONNECTED ;
1611 return pCollection->queryAndUpdate( &cursor.
pCursor , update, condition,
1612 selected, orderBy, hint,
1613 numToSkip, numToReturn, flag, returnNew ) ;
1647 const bson::BSONObj &condition = _sdbStaticObject,
1648 const bson::BSONObj &selected = _sdbStaticObject,
1649 const bson::BSONObj &orderBy = _sdbStaticObject,
1650 const bson::BSONObj &hint = _sdbStaticObject,
1651 INT64 numToSkip = 0,
1652 INT64 numToReturn = -1,
1658 return SDB_NOT_CONNECTED ;
1661 return pCollection->queryAndRemove( &cursor.
pCursor , condition,
1662 selected, orderBy, hint,
1663 numToSkip, numToReturn, flag ) ;
1682 INT32 createIndex (
const bson::BSONObj &indexDef,
1683 const CHAR *pIndexName,
1686 INT32 sortBufferSize =
1687 SDB_INDEX_SORT_BUFFER_DEFAULT_SIZE )
1691 return SDB_NOT_CONNECTED ;
1693 return pCollection->createIndex ( indexDef, pIndexName, isUnique,
1694 isEnforced, sortBufferSize ) ;
1723 INT32 createIndex (
const bson::BSONObj &indexDef,
1724 const CHAR *pIndexName,
1725 const bson::BSONObj &indexAttr = _sdbStaticObject,
1726 const bson::BSONObj &option = _sdbStaticObject )
1729 return SDB_NOT_CONNECTED ;
1730 return pCollection->createIndex ( indexDef, pIndexName,
1731 indexAttr, option ) ;
1757 INT32 createIndexAsync ( SINT64 &taskID,
1758 const bson::BSONObj &indexDef,
1759 const CHAR *pIndexName,
1760 const bson::BSONObj &indexAttr = _sdbStaticObject,
1761 const bson::BSONObj &option = _sdbStaticObject )
1765 return SDB_NOT_CONNECTED ;
1767 return pCollection->createIndexAsync ( taskID, indexDef, pIndexName,
1768 indexAttr, option ) ;
1789 INT32 snapshotIndexes ( _sdbCursor **cursor,
1790 const bson::BSONObj &condition = _sdbStaticObject,
1791 const bson::BSONObj &selector = _sdbStaticObject,
1792 const bson::BSONObj &orderby = _sdbStaticObject,
1793 const bson::BSONObj &hint = _sdbStaticObject,
1794 INT64 numToSkip = 0,
1795 INT64 numToReturn = -1 )
1799 return SDB_NOT_CONNECTED ;
1801 return pCollection->snapshotIndexes ( cursor, condition,
1802 selector, orderby, hint,
1803 numToSkip, numToReturn ) ;
1814 INT32 getIndexes ( _sdbCursor **cursor,
1815 const CHAR *pIndexName )
1819 return SDB_NOT_CONNECTED ;
1821 return pCollection->getIndexes ( cursor, pIndexName ) ;
1834 const CHAR *pIndexName )
1838 return SDB_NOT_CONNECTED ;
1841 return pCollection->getIndexes ( cursor, pIndexName ) ;
1850 INT32 getIndexes ( std::vector<bson::BSONObj> &infos )
1854 return SDB_NOT_CONNECTED ;
1856 return pCollection->getIndexes ( infos ) ;
1866 INT32 getIndex (
const CHAR *pIndexName, bson::BSONObj &info )
1870 return SDB_NOT_CONNECTED ;
1872 return pCollection->getIndex ( pIndexName, info ) ;
1881 INT32 dropIndex (
const CHAR *pIndexName )
1885 return SDB_NOT_CONNECTED ;
1887 return pCollection->dropIndex ( pIndexName ) ;
1898 INT32 dropIndexAsync ( SINT64 &taskID,
const CHAR *pIndexName )
1901 return SDB_NOT_CONNECTED ;
1902 return pCollection->dropIndexAsync ( taskID, pIndexName ) ;
1913 INT32 copyIndex (
const CHAR *subClFullName,
const CHAR *pIndexName )
1916 return SDB_NOT_CONNECTED ;
1917 return pCollection->copyIndex ( subClFullName, pIndexName ) ;
1930 INT32 copyIndexAsync ( SINT64 &taskID,
const CHAR *subClFullName,
1931 const CHAR *pIndexName )
1934 return SDB_NOT_CONNECTED ;
1935 return pCollection->copyIndexAsync ( taskID, subClFullName,
1949 return SDB_NOT_CONNECTED ;
1951 return pCollection->create () ;
1964 return SDB_NOT_CONNECTED ;
1966 return pCollection->drop () ;
1973 const CHAR *getCollectionName ()
1979 return pCollection->getCollectionName () ;
1986 const CHAR *getCSName ()
1992 return pCollection->getCSName () ;
1999 const CHAR *getFullName ()
2005 return pCollection->getFullName () ;
2017 INT32 aggregate ( _sdbCursor **cursor,
2018 std::vector<bson::BSONObj> &obj
2023 return SDB_NOT_CONNECTED ;
2025 return pCollection->aggregate ( cursor, obj ) ;
2038 std::vector<bson::BSONObj> &obj
2043 return SDB_NOT_CONNECTED ;
2046 return pCollection->aggregate ( cursor, obj ) ;
2068 INT32 getQueryMeta ( _sdbCursor **cursor,
2069 const bson::BSONObj &condition = _sdbStaticObject,
2070 const bson::BSONObj &orderBy = _sdbStaticObject,
2071 const bson::BSONObj &hint = _sdbStaticObject,
2072 INT64 numToSkip = 0,
2073 INT64 numToReturn = -1 )
2077 return SDB_NOT_CONNECTED ;
2079 return pCollection->getQueryMeta ( cursor, condition, orderBy,
2080 hint, numToSkip, numToReturn ) ;
2104 const bson::BSONObj &condition = _sdbStaticObject,
2105 const bson::BSONObj &orderBy = _sdbStaticObject,
2106 const bson::BSONObj &hint = _sdbStaticObject,
2107 INT64 numToSkip = 0,
2108 INT64 numToReturn = -1 )
2112 return SDB_NOT_CONNECTED ;
2115 return pCollection->getQueryMeta ( cursor, condition, orderBy,
2116 hint, numToSkip, numToReturn ) ;
2132 INT32 attachCollection (
const CHAR *subClFullName,
2133 const bson::BSONObj &options )
2137 return SDB_NOT_CONNECTED ;
2139 return pCollection->attachCollection ( subClFullName, options ) ;
2148 INT32 detachCollection (
const CHAR *subClFullName )
2152 return SDB_NOT_CONNECTED ;
2154 return pCollection->detachCollection ( subClFullName ) ;
2193 const bson::BSONObj &condition = _sdbStaticObject,
2194 const bson::BSONObj &select = _sdbStaticObject,
2195 const bson::BSONObj &orderBy = _sdbStaticObject,
2196 const bson::BSONObj &hint = _sdbStaticObject,
2197 INT64 numToSkip = 0,
2198 INT64 numToReturn = -1,
2200 const bson::BSONObj &options = _sdbStaticObject )
2204 return SDB_NOT_CONNECTED ;
2207 return pCollection->explain( cursor, condition, select, orderBy, hint,
2208 numToSkip, numToReturn, flag, options ) ;
2211 INT32 explain ( _sdbCursor **cursor,
2212 const bson::BSONObj &condition = _sdbStaticObject,
2213 const bson::BSONObj &select = _sdbStaticObject,
2214 const bson::BSONObj &orderBy = _sdbStaticObject,
2215 const bson::BSONObj &hint = _sdbStaticObject,
2216 INT64 numToSkip = 0,
2217 INT64 numToReturn = -1,
2219 const bson::BSONObj &options = _sdbStaticObject )
2223 return SDB_NOT_CONNECTED ;
2225 return pCollection->explain( cursor, condition, select, orderBy, hint,
2226 numToSkip, numToReturn, flag, options ) ;
2239 const bson::OID *oid = NULL,
2240 const bson::BSONObj &userObj = _sdbStaticObject )
2244 return SDB_NOT_CONNECTED ;
2246 return pCollection->createLob( lob, oid, userObj ) ;
2255 INT32 removeLob(
const bson::OID &oid )
2259 return SDB_NOT_CONNECTED ;
2261 return pCollection->removeLob( oid ) ;
2271 INT32 truncateLob(
const bson::OID &oid, INT64 length )
2275 return SDB_NOT_CONNECTED ;
2277 return pCollection->truncateLob( oid, length ) ;
2289 INT32 openLob(
sdbLob &lob,
const bson::OID &oid,
2294 return SDB_NOT_CONNECTED ;
2296 return pCollection->openLob( lob, oid, mode ) ;
2308 INT32 openLob(
sdbLob &lob,
const bson::OID &oid, INT32 mode )
2312 return SDB_NOT_CONNECTED ;
2314 return pCollection->openLob( lob, oid, mode ) ;
2335 const bson::BSONObj &condition = _sdbStaticObject,
2336 const bson::BSONObj &selected = _sdbStaticObject,
2337 const bson::BSONObj &orderBy = _sdbStaticObject,
2338 const bson::BSONObj &hint = _sdbStaticObject,
2339 INT64 numToSkip = 0,
2340 INT64 numToReturn = -1 )
2344 return SDB_NOT_CONNECTED ;
2347 return pCollection->listLobs( cursor, condition, selected, orderBy,
2348 hint, numToSkip, numToReturn ) ;
2351 INT32 listLobs( _sdbCursor **cursor,
2352 const bson::BSONObj &condition = _sdbStaticObject,
2353 const bson::BSONObj &selected = _sdbStaticObject,
2354 const bson::BSONObj &orderBy = _sdbStaticObject,
2355 const bson::BSONObj &hint = _sdbStaticObject,
2356 INT64 numToSkip = 0,
2357 INT64 numToReturn = -1 )
2361 return SDB_NOT_CONNECTED ;
2363 return pCollection->listLobs( cursor, condition, selected, orderBy,
2364 hint, numToSkip, numToReturn ) ;
2375 INT32 createLobID( bson::OID &oid,
const CHAR *pTimeStamp = NULL )
2379 return SDB_NOT_CONNECTED ;
2381 return pCollection->createLobID( oid, pTimeStamp ) ;
2393 INT32 lobExplain(
const bson::OID &oid,
2394 bson::BSONObj &result,
2395 const bson::BSONObj &options = _sdbStaticObject )
2399 return SDB_NOT_CONNECTED ;
2401 return pCollection->lobExplain( oid, result, options ) ;
2411 INT32 truncate(
const bson::BSONObj &options = _sdbStaticObject )
2415 return SDB_NOT_CONNECTED ;
2417 return pCollection->truncate( options ) ;
2429 INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject )
2433 return SDB_NOT_CONNECTED ;
2435 return pCollection->createIdIndex( options ) ;
2448 return SDB_NOT_CONNECTED ;
2450 return pCollection->dropIdIndex() ;
2470 INT32 createAutoIncrement (
const bson::BSONObj &options )
2474 return SDB_NOT_CONNECTED ;
2476 return pCollection->createAutoIncrement( options ) ;
2485 INT32 createAutoIncrement (
const std::vector<bson::BSONObj> &options )
2489 return SDB_NOT_CONNECTED ;
2491 return pCollection->createAutoIncrement( options ) ;
2500 INT32 dropAutoIncrement (
const CHAR * fieldName )
2504 return SDB_NOT_CONNECTED ;
2506 return pCollection->dropAutoIncrement( fieldName ) ;
2515 INT32 dropAutoIncrement (
const std::vector<const CHAR*> &fieldNames )
2519 return SDB_NOT_CONNECTED ;
2521 return pCollection->dropAutoIncrement( fieldNames ) ;
2537 INT32 enableSharding (
const bson::BSONObj & options = _sdbStaticObject )
2541 return SDB_NOT_CONNECTED ;
2543 return pCollection->enableSharding( options ) ;
2551 INT32 disableSharding ()
2555 return SDB_NOT_CONNECTED ;
2557 return pCollection->disableSharding() ;
2568 INT32 enableCompression (
const bson::BSONObj & options = _sdbStaticObject )
2572 return SDB_NOT_CONNECTED ;
2574 return pCollection->enableCompression( options ) ;
2582 INT32 disableCompression ()
2586 return SDB_NOT_CONNECTED ;
2588 return pCollection->disableCompression() ;
2611 INT32 setAttributes (
const bson::BSONObj &options )
2615 return SDB_NOT_CONNECTED ;
2617 return pCollection->setAttributes( options ) ;
2629 INT32 pop (
const bson::BSONObj &option = _sdbStaticObject )
2633 return SDB_NOT_CONNECTED ;
2635 return pCollection->pop( option ) ;
2638 INT32 listLobPieces( _sdbCursor **cursor,
2639 const bson::BSONObj &condition = _sdbStaticObject,
2640 const bson::BSONObj &selected = _sdbStaticObject,
2641 const bson::BSONObj &orderBy = _sdbStaticObject,
2642 const bson::BSONObj &hint = _sdbStaticObject,
2643 INT64 numToSkip = 0,
2644 INT64 numToReturn = -1 )
2648 return SDB_NOT_CONNECTED ;
2650 return pCollection->listLobPieces( cursor, condition, selected,
2651 orderBy, hint, numToSkip,
2668 INT32 listLobPieces( sdbCursor &cursor,
2669 const bson::BSONObj &condition = _sdbStaticObject,
2670 const bson::BSONObj &selected = _sdbStaticObject,
2671 const bson::BSONObj &orderBy = _sdbStaticObject,
2672 const bson::BSONObj &hint = _sdbStaticObject,
2673 INT64 numToSkip = 0,
2674 INT64 numToReturn = -1 )
2678 return SDB_NOT_CONNECTED ;
2681 return pCollection->listLobPieces( cursor, condition, selected,
2682 orderBy, hint, numToSkip,
2693 INT32 getDetail ( _sdbCursor **cursor,
const bson::BSONObj &options = _sdbStaticObject )
2697 return SDB_NOT_CONNECTED ;
2699 return pCollection->getDetail ( cursor, options ) ;
2709 INT32 getDetail(
sdbCursor &cursor,
const bson::BSONObj &options = _sdbStaticObject )
2713 return SDB_NOT_CONNECTED ;
2715 return pCollection->getDetail( cursor, options ) ;
2724 INT32 getCollectionStat( bson::BSONObj &result )
2728 return SDB_NOT_CONNECTED ;
2730 return pCollection->getCollectionStat( result ) ;
2742 INT32 getIndexStat(
const CHAR *pIndexName, bson::BSONObj &result,
2743 BOOLEAN detail = FALSE )
2747 return SDB_NOT_CONNECTED ;
2749 return pCollection->getIndexStat( pIndexName, result, detail ) ;
2756 void setVersion( INT32 clVersion )
2758 pCollection->setVersion( clVersion ) ;
2766 return pCollection->getVersion() ;
2774 INT32 setConsistencyStrategy( INT32 value )
2776 return pCollection->setConsistencyStrategy( value ) ;
2796 class DLLEXPORT _sdbNode
2799 _sdbNode (
const _sdbNode& other ) ;
2800 _sdbNode& operator=(
const _sdbNode& ) ;
2803 virtual ~_sdbNode () {}
2805 virtual INT32 connect ( _sdb **dbConn ) = 0 ;
2806 virtual INT32 connect (
sdb &dbConn ) = 0 ;
2812 virtual const CHAR *getHostName () = 0 ;
2815 virtual const CHAR *getServiceName () = 0 ;
2818 virtual const CHAR *getNodeName () = 0 ;
2821 virtual INT32 getNodeID( INT32 &nodeID )
const = 0 ;
2824 virtual INT32 stop () = 0 ;
2827 virtual INT32 start () = 0 ;
2829 virtual INT32 setLocation (
const CHAR *pLocation ) = 0 ;
2831 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
2887 INT32 connect ( _sdb **dbConn )
2891 return SDB_NOT_CONNECTED ;
2893 return pNode->connect ( dbConn ) ;
2907 return SDB_NOT_CONNECTED ;
2912 return pNode->connect ( dbConn ) ;
2925 return SDB_NODE_UNKNOWN ;
2927 return pNode->getStatus () ;
2934 const CHAR *getHostName ()
2940 return pNode->getHostName () ;
2947 const CHAR *getServiceName ()
2953 return pNode->getServiceName () ;
2960 const CHAR *getNodeName ()
2966 return pNode->getNodeName () ;
2973 INT32 getNodeID( INT32 &nodeID )
const
2977 return SDB_NOT_CONNECTED ;
2979 return pNode->getNodeID( nodeID ) ;
2991 return SDB_NOT_CONNECTED ;
2993 return pNode->stop () ;
3005 return SDB_NOT_CONNECTED ;
3007 return pNode->start () ;
3020 INT32 setLocation (
const CHAR *pLocation )
3024 return SDB_NOT_CONNECTED ;
3026 return pNode->setLocation( pLocation ) ;
3038 INT32 setAttributes (
const bson::BSONObj & options )
3042 return SDB_NOT_CONNECTED ;
3044 return pNode->setAttributes( options ) ;
3057 class DLLEXPORT _sdbReplicaGroup
3060 _sdbReplicaGroup (
const _sdbReplicaGroup& other ) ;
3061 _sdbReplicaGroup& operator=(
const _sdbReplicaGroup& ) ;
3063 _sdbReplicaGroup () {}
3064 virtual ~_sdbReplicaGroup () {}
3066 virtual INT32 getNodeNum (
sdbNodeStatus status, INT32 *num ) = 0 ;
3069 virtual INT32 getDetail ( bson::BSONObj &result ) = 0 ;
3072 virtual INT32 getMaster ( _sdbNode **node ) = 0 ;
3073 virtual INT32 getMaster ( sdbNode &node ) = 0 ;
3076 virtual INT32 getSlave ( _sdbNode **node,
3077 const vector<INT32>& positions = _sdbStaticVec ) = 0 ;
3078 virtual INT32 getSlave ( sdbNode &node,
3079 const vector<INT32>& positions = _sdbStaticVec ) = 0 ;
3082 virtual INT32 getNode (
const CHAR *pNodeName,
3083 _sdbNode **node ) = 0 ;
3084 virtual INT32 getNode (
const CHAR *pNodeName,
3085 sdbNode &node ) = 0 ;
3088 virtual INT32 getNode (
const CHAR *pHostName,
3089 const CHAR *pServiceName,
3090 _sdbNode **node ) = 0 ;
3091 virtual INT32 getNode (
const CHAR *pHostName,
3092 const CHAR *pServiceName,
3093 sdbNode &node ) = 0 ;
3096 virtual INT32 createNode (
const CHAR *pHostName,
3097 const CHAR *pServiceName,
3098 const CHAR *pDatabasePath,
3099 std::map<std::string,std::string> &config,
3100 _sdbNode **ppNode = NULL ) = 0 ;
3102 virtual INT32 createNode (
const CHAR *pHostName,
3103 const CHAR *pServiceName,
3104 const CHAR *pDatabasePath,
3105 const bson::BSONObj &options = _sdbStaticObject,
3106 _sdbNode **ppNode = NULL ) = 0 ;
3109 virtual INT32 removeNode (
const CHAR *pHostName,
3110 const CHAR *pServiceName,
3111 const bson::BSONObj &configure = _sdbStaticObject ) = 0 ;
3113 virtual INT32 stop () = 0 ;
3116 virtual INT32 start () = 0 ;
3119 virtual const CHAR *getName () = 0 ;
3122 virtual BOOLEAN isCatalog () = 0 ;
3125 virtual INT32 attachNode(
const CHAR *pHostName,
3126 const CHAR *pSvcName,
3127 const bson::BSONObj &options ) = 0 ;
3130 virtual INT32 detachNode(
const CHAR *pHostName,
3131 const CHAR *pSvcName,
3132 const bson::BSONObj &options ) = 0 ;
3135 virtual INT32 reelect(
const bson::BSONObj &options = _sdbStaticObject,
3136 bson::BSONObj *pResult = NULL ) = 0 ;
3139 virtual INT32 reelectLocation(
const CHAR* pLocation,
3140 const bson::BSONObj &options = _sdbStaticObject,
3141 bson::BSONObj *pResult = NULL ) = 0 ;
3144 virtual INT32 setActiveLocation (
const CHAR *pActiveLocation ) = 0 ;
3146 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
3149 virtual INT32 startCriticalMode(
const bson::BSONObj &options ) = 0 ;
3152 virtual INT32 stopCriticalMode() = 0 ;
3155 virtual INT32 startMaintenanceMode(
const bson::BSONObj &options ) = 0 ;
3158 virtual INT32 stopMaintenanceMode(
const bson::BSONObj &options ) = 0 ;
3183 pReplicaGroup = NULL ;
3191 if ( pReplicaGroup )
3193 delete pReplicaGroup ;
3213 if ( !pReplicaGroup )
3215 return SDB_NOT_CONNECTED ;
3217 return pReplicaGroup->
getNodeNum ( status, num ) ;
3226 INT32 getDetail ( bson::BSONObj &result )
3228 if ( !pReplicaGroup )
3230 return SDB_NOT_CONNECTED ;
3232 return pReplicaGroup->getDetail ( result ) ;
3241 INT32 getMaster ( _sdbNode **node )
3243 if ( !pReplicaGroup )
3245 return SDB_NOT_CONNECTED ;
3247 return pReplicaGroup->getMaster ( node ) ;
3258 if ( !pReplicaGroup )
3260 return SDB_NOT_CONNECTED ;
3263 return pReplicaGroup->getMaster ( node ) ;
3274 INT32 getSlave ( _sdbNode **node,
3275 const vector<INT32>& positions = _sdbStaticVec )
3277 if ( !pReplicaGroup )
3279 return SDB_NOT_CONNECTED ;
3281 return pReplicaGroup->getSlave ( node, positions ) ;
3293 const vector<INT32>& positions = _sdbStaticVec )
3295 if ( !pReplicaGroup )
3297 return SDB_NOT_CONNECTED ;
3300 return pReplicaGroup->getSlave ( node, positions ) ;
3311 INT32 getNode (
const CHAR *pNodeName,
3314 if ( !pReplicaGroup )
3316 return SDB_NOT_CONNECTED ;
3318 return pReplicaGroup->getNode ( pNodeName, node ) ;
3329 INT32 getNode (
const CHAR *pNodeName,
3332 if ( !pReplicaGroup )
3334 return SDB_NOT_CONNECTED ;
3337 return pReplicaGroup->getNode ( pNodeName, node ) ;
3340 INT32 getNode (
const CHAR *pHostName,
3341 const CHAR *pServiceName,
3344 if ( !pReplicaGroup )
3346 return SDB_NOT_CONNECTED ;
3348 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
3361 INT32 getNode (
const CHAR *pHostName,
3362 const CHAR *pServiceName,
3365 if ( !pReplicaGroup )
3367 return SDB_NOT_CONNECTED ;
3370 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
3386 INT32 createNode (
const CHAR *pHostName,
3387 const CHAR *pServiceName,
3388 const CHAR *pDatabasePath,
3389 std::map<std::string,std::string> &config,
3390 _sdbNode **pNode = NULL )
3392 if ( !pReplicaGroup )
3394 return SDB_NOT_CONNECTED ;
3396 return pReplicaGroup->createNode ( pHostName, pServiceName,
3397 pDatabasePath, config, pNode ) ;
3412 INT32 createNode (
const CHAR *pHostName,
3413 const CHAR *pServiceName,
3414 const CHAR *pDatabasePath,
3415 const bson::BSONObj &options = _sdbStaticObject,
3416 _sdbNode **pNode = NULL )
3418 if ( !pReplicaGroup )
3420 return SDB_NOT_CONNECTED ;
3422 return pReplicaGroup->createNode ( pHostName, pServiceName,
3423 pDatabasePath, options, pNode ) ;
3436 INT32 removeNode (
const CHAR *pHostName,
3437 const CHAR *pServiceName,
3438 const bson::BSONObj &configure = _sdbStaticObject )
3440 if ( !pReplicaGroup )
3442 return SDB_NOT_CONNECTED ;
3444 return pReplicaGroup->removeNode ( pHostName, pServiceName,
3454 if ( !pReplicaGroup )
3456 return SDB_NOT_CONNECTED ;
3458 return pReplicaGroup->stop () ;
3468 if ( !pReplicaGroup )
3470 return SDB_NOT_CONNECTED ;
3472 return pReplicaGroup->start () ;
3479 const CHAR *getName ()
3481 if ( !pReplicaGroup )
3485 return pReplicaGroup->getName() ;
3493 BOOLEAN isCatalog ()
3495 if ( !pReplicaGroup )
3499 return pReplicaGroup->isCatalog() ;
3516 INT32 attachNode(
const CHAR *pHostName,
3517 const CHAR *pSvcName,
3518 const bson::BSONObj &options )
3520 if ( !pReplicaGroup )
3522 return SDB_NOT_CONNECTED ;
3524 return pReplicaGroup->attachNode( pHostName, pSvcName, options ) ;
3542 INT32 detachNode(
const CHAR *pHostName,
3543 const CHAR *pSvcName,
3544 const bson::BSONObj &options )
3546 if ( !pReplicaGroup )
3548 return SDB_NOT_CONNECTED ;
3550 return pReplicaGroup->detachNode( pHostName, pSvcName, options ) ;
3562 INT32 reelect(
const bson::BSONObj &options = _sdbStaticObject,
3563 bson::BSONObj *pResult = NULL )
3565 if( !pReplicaGroup )
3567 return SDB_NOT_CONNECTED ;
3569 return pReplicaGroup->reelect( options, pResult ) ;
3580 INT32 reelectLocation(
const CHAR* pLocation,
3581 const bson::BSONObj &options = _sdbStaticObject,
3582 bson::BSONObj *pResult = NULL )
3584 if( !pReplicaGroup )
3586 return SDB_NOT_CONNECTED ;
3588 return pReplicaGroup->reelectLocation( pLocation, options, pResult ) ;
3602 INT32 setActiveLocation (
const CHAR *pActiveLocation )
3604 if ( !pReplicaGroup )
3606 return SDB_NOT_CONNECTED ;
3608 return pReplicaGroup->setActiveLocation( pActiveLocation ) ;
3621 INT32 setAttributes (
const bson::BSONObj & options )
3623 if ( !pReplicaGroup )
3625 return SDB_NOT_CONNECTED ;
3627 return pReplicaGroup->setAttributes( options ) ;
3643 INT32 startCriticalMode(
const bson::BSONObj &options )
3645 if ( !pReplicaGroup )
3647 return SDB_NOT_CONNECTED ;
3649 return pReplicaGroup->startCriticalMode( options ) ;
3657 INT32 stopCriticalMode()
3659 if ( !pReplicaGroup )
3661 return SDB_NOT_CONNECTED ;
3663 return pReplicaGroup->stopCriticalMode () ;
3678 INT32 startMaintenanceMode(
const bson::BSONObj &options )
3680 if ( !pReplicaGroup )
3682 return SDB_NOT_CONNECTED ;
3684 return pReplicaGroup->startMaintenanceMode( options ) ;
3697 INT32 stopMaintenanceMode(
const bson::BSONObj &options )
3699 if ( !pReplicaGroup )
3701 return SDB_NOT_CONNECTED ;
3703 return pReplicaGroup->stopMaintenanceMode ( options ) ;
3707 class DLLEXPORT _sdbCollectionSpace
3710 _sdbCollectionSpace (
const _sdbCollectionSpace& other ) ;
3711 _sdbCollectionSpace& operator=(
const _sdbCollectionSpace& ) ;
3713 _sdbCollectionSpace () {}
3714 virtual ~_sdbCollectionSpace () {}
3716 virtual INT32 getCollection (
const CHAR *pCollectionName,
3717 _sdbCollection **collection,
3718 BOOLEAN checkExist = TRUE ) = 0 ;
3720 virtual INT32 getCollection (
const CHAR *pCollectionName,
3721 sdbCollection &collection,
3722 BOOLEAN checkExist = TRUE ) = 0 ;
3725 virtual INT32 createCollection (
const CHAR *pCollection,
3726 const bson::BSONObj &options,
3727 _sdbCollection **collection ) = 0 ;
3729 virtual INT32 createCollection (
const CHAR *pCollection,
3730 const bson::BSONObj &options,
3731 sdbCollection &collection ) = 0 ;
3734 virtual INT32 createCollection (
const CHAR *pCollection,
3735 _sdbCollection **collection ) = 0 ;
3737 virtual INT32 createCollection (
const CHAR *pCollection,
3738 sdbCollection &collection ) = 0 ;
3741 virtual INT32 dropCollection(
const CHAR *pCollection,
3742 const bson::BSONObj &options ) = 0 ;
3744 virtual INT32 listCollections ( _sdbCursor **cursor ) = 0 ;
3746 virtual INT32 listCollections ( sdbCursor &cursor ) = 0 ;
3749 virtual INT32 create () = 0 ;
3751 virtual INT32 drop () = 0 ;
3754 virtual const CHAR *getCSName () = 0 ;
3757 virtual INT32 renameCollection(
const CHAR* oldName,
const CHAR* newName,
3758 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
3760 virtual INT32 alterCollectionSpace (
const bson::BSONObj & options ) = 0 ;
3762 virtual INT32 setDomain (
const bson::BSONObj & options ) = 0 ;
3764 virtual INT32 getDomainName ( CHAR *result, INT32 resultLen ) = 0 ;
3766 virtual INT32 removeDomain () = 0 ;
3768 virtual INT32 enableCapped () = 0 ;
3770 virtual INT32 disableCapped () = 0 ;
3772 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
3806 pCollectionSpace = NULL ;
3814 if ( pCollectionSpace )
3816 delete pCollectionSpace ;
3820 INT32 getCollection (
const CHAR *pCollectionName,
3821 _sdbCollection **collection,
3822 BOOLEAN checkExist = TRUE )
3824 if ( !pCollectionSpace )
3826 return SDB_NOT_CONNECTED ;
3828 return pCollectionSpace->getCollection ( pCollectionName,
3829 collection, checkExist ) ;
3842 INT32 getCollection (
const CHAR *pCollectionName,
3844 BOOLEAN checkExist = TRUE )
3846 if ( !pCollectionSpace )
3848 return SDB_NOT_CONNECTED ;
3851 return pCollectionSpace->getCollection ( pCollectionName,
3856 INT32 createCollection (
const CHAR *pCollection,
3857 const bson::BSONObj &options,
3858 _sdbCollection **collection )
3860 if ( !pCollectionSpace )
3862 return SDB_NOT_CONNECTED ;
3864 return pCollectionSpace->createCollection ( pCollection,
3906 INT32 createCollection (
const CHAR *pCollection,
3907 const bson::BSONObj &options,
3910 if ( !pCollectionSpace )
3912 return SDB_NOT_CONNECTED ;
3915 return pCollectionSpace->createCollection ( pCollection,
3920 INT32 createCollection (
const CHAR *pCollection,
3921 _sdbCollection **collection )
3923 if ( !pCollectionSpace )
3925 return SDB_NOT_CONNECTED ;
3927 return pCollectionSpace->createCollection ( pCollection,
3940 INT32 createCollection (
const CHAR *pCollection,
3943 if ( !pCollectionSpace )
3945 return SDB_NOT_CONNECTED ;
3948 return pCollectionSpace->createCollection ( pCollection,
3961 INT32 dropCollection(
const CHAR *pCollection,
3962 const bson::BSONObj &options = _sdbStaticObject )
3964 if ( !pCollectionSpace )
3966 return SDB_NOT_CONNECTED ;
3968 return pCollectionSpace->dropCollection( pCollection, options ) ;
3977 INT32 listCollections ( _sdbCursor **cursor )
3979 if ( !pCollectionSpace )
3981 return SDB_NOT_CONNECTED ;
3983 return pCollectionSpace->listCollections( cursor ) ;
3994 if ( !pCollectionSpace )
3996 return SDB_NOT_CONNECTED ;
3999 return pCollectionSpace->listCollections( cursor ) ;
4010 if ( !pCollectionSpace )
4012 return SDB_NOT_CONNECTED ;
4014 return pCollectionSpace->create () ;
4025 if ( !pCollectionSpace )
4027 return SDB_NOT_CONNECTED ;
4029 return pCollectionSpace->drop () ;
4036 const CHAR *getCSName ()
4038 if ( !pCollectionSpace )
4042 return pCollectionSpace->getCSName () ;
4055 INT32 renameCollection(
const CHAR* oldName,
const CHAR* newName,
4056 const bson::BSONObj &options = _sdbStaticObject )
4058 if( !pCollectionSpace )
4060 return SDB_NOT_CONNECTED ;
4062 return pCollectionSpace->renameCollection( oldName, newName, options ) ;
4076 INT32 alterCollectionSpace (
const bson::BSONObj & options )
4078 if ( NULL == pCollectionSpace )
4080 return SDB_NOT_CONNECTED ;
4082 return pCollectionSpace->alterCollectionSpace( options ) ;
4094 INT32 setDomain (
const bson::BSONObj & options )
4096 if ( NULL == pCollectionSpace )
4098 return SDB_NOT_CONNECTED ;
4100 return pCollectionSpace->setDomain( options ) ;
4110 INT32 getDomainName ( CHAR *result, INT32 resultLen )
4112 if ( !pCollectionSpace )
4114 return SDB_NOT_CONNECTED ;
4116 return pCollectionSpace->getDomainName( result, resultLen ) ;
4124 INT32 removeDomain ()
4126 if ( NULL == pCollectionSpace )
4128 return SDB_NOT_CONNECTED ;
4130 return pCollectionSpace->removeDomain() ;
4138 INT32 enableCapped ()
4140 if ( NULL == pCollectionSpace )
4142 return SDB_NOT_CONNECTED ;
4144 return pCollectionSpace->enableCapped() ;
4152 INT32 disableCapped ()
4154 if ( NULL == pCollectionSpace )
4156 return SDB_NOT_CONNECTED ;
4158 return pCollectionSpace->disableCapped() ;
4172 INT32 setAttributes (
const bson::BSONObj & options )
4174 if ( NULL == pCollectionSpace )
4176 return SDB_NOT_CONNECTED ;
4178 return pCollectionSpace->setAttributes( options ) ;
4182 class DLLEXPORT _sdbDomain
4185 _sdbDomain (
const _sdbDomain& other ) ;
4186 _sdbDomain& operator= (
const _sdbDomain& ) ;
4189 virtual ~_sdbDomain () {}
4191 virtual const CHAR* getName () = 0 ;
4193 virtual INT32 alterDomain (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4195 virtual INT32 listCollectionSpacesInDomain ( _sdbCursor **cursor ) = 0 ;
4197 virtual INT32 listCollectionSpacesInDomain ( sdbCursor &cursor ) = 0 ;
4199 virtual INT32 listCollectionsInDomain ( _sdbCursor **cursor ) = 0 ;
4201 virtual INT32 listCollectionsInDomain ( sdbCursor &cursor ) = 0 ;
4203 virtual INT32 listReplicaGroupInDomain( _sdbCursor **cursor ) = 0 ;
4205 virtual INT32 listReplicaGroupInDomain( sdbCursor &cursor ) = 0 ;
4207 virtual INT32 addGroups (
const bson::BSONObj & options ) = 0 ;
4209 virtual INT32 setGroups (
const bson::BSONObj & options ) = 0 ;
4211 virtual INT32 setActiveLocation (
const CHAR *pActiveLocation ) = 0 ;
4213 virtual INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation ) = 0 ;
4215 virtual INT32 removeGroups (
const bson::BSONObj & options ) = 0 ;
4217 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
4258 const CHAR *getName ()
4284 INT32 alterDomain (
const bson::BSONObj &options )
4288 return SDB_NOT_CONNECTED ;
4290 return pDomain->alterDomain ( options ) ;
4303 INT32 addGroups (
const bson::BSONObj & options )
4305 if ( NULL == pDomain )
4307 return SDB_NOT_CONNECTED ;
4309 return pDomain->addGroups( options ) ;
4324 INT32 setGroups (
const bson::BSONObj & options )
4326 if ( NULL == pDomain )
4328 return SDB_NOT_CONNECTED ;
4330 return pDomain->setGroups( options ) ;
4343 INT32 setActiveLocation (
const CHAR *pActiveLocation )
4345 if ( NULL == pDomain )
4347 return SDB_NOT_CONNECTED ;
4349 return pDomain->setActiveLocation( pActiveLocation ) ;
4364 INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation )
4366 if ( NULL == pDomain )
4368 return SDB_NOT_CONNECTED ;
4370 return pDomain->setLocation( pHostName, pLocation ) ;
4385 INT32 removeGroups (
const bson::BSONObj & options )
4387 if ( NULL == pDomain )
4389 return SDB_NOT_CONNECTED ;
4391 return pDomain->removeGroups( options ) ;
4411 INT32 setAttributes (
const bson::BSONObj &options )
4415 return SDB_NOT_CONNECTED ;
4417 return pDomain->setAttributes( options ) ;
4431 return SDB_NOT_CONNECTED ;
4434 return pDomain->listCollectionSpacesInDomain ( cursor ) ;
4437 INT32 listCollectionSpacesInDomain ( _sdbCursor **cursor )
4441 return SDB_NOT_CONNECTED ;
4443 return pDomain->listCollectionSpacesInDomain ( cursor ) ;
4457 return SDB_NOT_CONNECTED ;
4460 return pDomain->listCollectionsInDomain ( cursor ) ;
4470 INT32 listCollectionsInDomain ( _sdbCursor **cursor )
4474 return SDB_NOT_CONNECTED ;
4476 return pDomain->listCollectionsInDomain ( cursor ) ;
4479 INT32 listReplicaGroupInDomain( _sdbCursor **cursor )
4483 return SDB_NOT_CONNECTED ;
4485 return pDomain->listReplicaGroupInDomain( cursor ) ;
4498 return SDB_NOT_CONNECTED ;
4501 return pDomain->listReplicaGroupInDomain( cursor ) ;
4505 class DLLEXPORT _sdbDataCenter
4508 _sdbDataCenter (
const _sdbDataCenter& other ) ;
4509 _sdbDataCenter& operator= (
const _sdbDataCenter& ) ;
4512 _sdbDataCenter () {}
4513 virtual ~_sdbDataCenter () {}
4516 virtual const CHAR *getName () = 0 ;
4517 virtual INT32 getDetail( bson::BSONObj &retInfo ) = 0 ;
4518 virtual INT32 activateDC() = 0 ;
4519 virtual INT32 deactivateDC() = 0 ;
4520 virtual INT32 enableReadOnly( BOOLEAN isReadOnly ) = 0 ;
4522 virtual INT32 setActiveLocation (
const CHAR *pActiveLocation,
4523 bson::BSONObj &result,
4524 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4525 virtual INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation,
4526 bson::BSONObj &result,
4527 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4528 virtual INT32 startMaintenanceMode(
const bson::BSONObj &options, bson::BSONObj &result ) = 0 ;
4529 virtual INT32 stopMaintenanceMode(
const bson::BSONObj &options, bson::BSONObj &result ) = 0 ;
4530 virtual INT32 startCriticalMode(
const bson::BSONObj &options, bson::BSONObj &result ) = 0 ;
4531 virtual INT32 stopCriticalMode(
const bson::BSONObj &options, bson::BSONObj &result ) = 0 ;
4537 class DLLEXPORT sdbDataCenter
4540 sdbDataCenter (
const sdbDataCenter& ) ;
4541 sdbDataCenter& operator= (
const sdbDataCenter& ) ;
4551 _sdbDataCenter *pDC ;
4556 sdbDataCenter() { pDC = NULL ; }
4576 const CHAR *getName ()
4582 return pDC->getName() ;
4591 INT32 getDetail( bson::BSONObj &retInfo )
4595 return SDB_NOT_CONNECTED ;
4597 return pDC->getDetail( retInfo ) ;
4609 return SDB_NOT_CONNECTED ;
4611 return pDC->activateDC() ;
4619 INT32 deactivateDC()
4623 return SDB_NOT_CONNECTED ;
4625 return pDC->deactivateDC() ;
4634 INT32 enableReadOnly( BOOLEAN isReadOnly )
4638 return SDB_NOT_CONNECTED ;
4640 return pDC->enableReadOnly( isReadOnly ) ;
4658 INT32 setActiveLocation (
const CHAR *pActiveLocation, bson::BSONObj &result,
4659 const bson::BSONObj &options = _sdbStaticObject )
4663 return SDB_NOT_CONNECTED ;
4665 return pDC->setActiveLocation( pActiveLocation, result, options ) ;
4686 INT32 setLocation (
const CHAR * pHostName,
const CHAR * pLocation,
4687 bson::BSONObj &result,
4688 const bson::BSONObj &options = _sdbStaticObject )
4692 return SDB_NOT_CONNECTED ;
4694 return pDC->setLocation( pHostName, pLocation, result, options ) ;
4710 INT32 startMaintenanceMode(
const bson::BSONObj &options, bson::BSONObj &result )
4714 return SDB_NOT_CONNECTED ;
4716 return pDC->startMaintenanceMode( options, result ) ;
4730 INT32 stopMaintenanceMode(
const bson::BSONObj &options, bson::BSONObj &result )
4734 return SDB_NOT_CONNECTED ;
4736 return pDC->stopMaintenanceMode ( options, result ) ;
4752 INT32 startCriticalMode(
const bson::BSONObj &options, bson::BSONObj &result )
4756 return SDB_NOT_CONNECTED ;
4758 return pDC->startCriticalMode( options, result ) ;
4768 INT32 stopCriticalMode(
const bson::BSONObj &options, bson::BSONObj &result )
4772 return SDB_NOT_CONNECTED ;
4774 return pDC->stopCriticalMode ( options, result ) ;
4779 class DLLEXPORT _sdbRecycleBin
4782 _sdbRecycleBin (
const _sdbRecycleBin& other ) ;
4783 _sdbRecycleBin& operator= (
const _sdbRecycleBin& ) ;
4786 _sdbRecycleBin () {}
4787 virtual ~_sdbRecycleBin () {}
4790 virtual INT32 getDetail( bson::BSONObj &retInfo ) = 0 ;
4791 virtual INT32 enable() = 0 ;
4792 virtual INT32 disable() = 0 ;
4793 virtual INT32 setAttributes(
const bson::BSONObj &options ) = 0 ;
4794 virtual INT32 alter(
const bson::BSONObj &options ) = 0 ;
4795 virtual INT32 returnItem(
const CHAR *recycleName,
4796 const bson::BSONObj &options = _sdbStaticObject,
4797 bson::BSONObj *result = NULL ) = 0 ;
4798 virtual INT32 returnItemToName(
const CHAR *recycleName,
4799 const CHAR *returnName,
4800 const bson::BSONObj &options = _sdbStaticObject,
4801 bson::BSONObj *result = NULL ) = 0 ;
4802 virtual INT32 dropItem(
const CHAR *recycleName,
4803 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4804 virtual INT32 dropAll(
const bson::BSONObj &options = _sdbStaticObject ) = 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 list( 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 snapshot( sdbCursor &cursor,
4827 const bson::BSONObj &condition = _sdbStaticObject,
4828 const bson::BSONObj &selector = _sdbStaticObject,
4829 const bson::BSONObj &orderBy = _sdbStaticObject,
4830 const bson::BSONObj &hint = _sdbStaticObject,
4831 INT64 numToSkip = 0,
4832 INT64 numToReturn = -1 ) = 0 ;
4833 virtual INT32 getCount( INT64 &count,
4834 const bson::BSONObj &condition = _sdbStaticObject ) = 0 ;
4840 class DLLEXPORT sdbRecycleBin
4843 sdbRecycleBin(
const sdbRecycleBin & ) ;
4844 sdbRecycleBin &operator =(
const sdbRecycleBin & ) ;
4854 _sdbRecycleBin *pRecycleBin ;
4859 sdbRecycleBin() { pRecycleBin = NULL ; }
4868 delete pRecycleBin ;
4880 INT32 getDetail( bson::BSONObj &retInfo )
4882 if ( NULL == pRecycleBin )
4884 return SDB_NOT_CONNECTED ;
4886 return pRecycleBin->getDetail( retInfo ) ;
4896 if ( NULL == pRecycleBin )
4898 return SDB_NOT_CONNECTED ;
4900 return pRecycleBin->enable() ;
4910 if ( NULL == pRecycleBin )
4912 return SDB_NOT_CONNECTED ;
4914 return pRecycleBin->disable() ;
4930 INT32 setAttributes(
const bson::BSONObj &options )
4932 if ( NULL == pRecycleBin )
4934 return SDB_NOT_CONNECTED ;
4936 return pRecycleBin->setAttributes( options ) ;
4952 INT32 alter(
const bson::BSONObj &options )
4954 if ( NULL == pRecycleBin )
4956 return SDB_NOT_CONNECTED ;
4958 return pRecycleBin->alter( options ) ;
4971 INT32 returnItem(
const CHAR *recycleName,
4972 const bson::BSONObj &options = _sdbStaticObject,
4973 bson::BSONObj *result = NULL )
4975 if ( NULL == pRecycleBin )
4977 return SDB_NOT_CONNECTED ;
4979 return pRecycleBin->returnItem( recycleName, options, result ) ;
4994 INT32 returnItemToName(
const CHAR *recycleName,
4995 const CHAR *returnName,
4996 const bson::BSONObj &options = _sdbStaticObject,
4997 bson::BSONObj *result = NULL )
4999 if ( NULL == pRecycleBin )
5001 return SDB_NOT_CONNECTED ;
5003 return pRecycleBin->returnItemToName( recycleName,
5016 INT32 dropItem(
const CHAR *recycleName,
5017 const bson::BSONObj &options = _sdbStaticObject )
5019 if ( NULL == pRecycleBin )
5021 return SDB_NOT_CONNECTED ;
5023 return pRecycleBin->dropItem( recycleName, options ) ;
5032 INT32 dropAll(
const bson::BSONObj &options = _sdbStaticObject )
5034 if ( NULL == pRecycleBin )
5036 return SDB_NOT_CONNECTED ;
5038 return pRecycleBin->dropAll( options ) ;
5060 INT32 list( _sdbCursor **cursor,
5061 const bson::BSONObj &condition = _sdbStaticObject,
5062 const bson::BSONObj &selector = _sdbStaticObject,
5063 const bson::BSONObj &orderBy = _sdbStaticObject,
5064 const bson::BSONObj &hint = _sdbStaticObject,
5065 INT64 numToSkip = 0,
5066 INT64 numToReturn = -1 )
5068 if ( NULL == pRecycleBin )
5070 return SDB_NOT_CONNECTED ;
5072 return pRecycleBin->list( cursor,
5100 INT32 list( sdbCursor &cursor,
5101 const bson::BSONObj &condition = _sdbStaticObject,
5102 const bson::BSONObj &selector = _sdbStaticObject,
5103 const bson::BSONObj &orderBy = _sdbStaticObject,
5104 const bson::BSONObj &hint = _sdbStaticObject,
5105 INT64 numToSkip = 0,
5106 INT64 numToReturn = -1 )
5108 if ( NULL == pRecycleBin )
5110 return SDB_NOT_CONNECTED ;
5112 return pRecycleBin->list( cursor,
5140 INT32 snapshot( _sdbCursor **cursor,
5141 const bson::BSONObj &condition = _sdbStaticObject,
5142 const bson::BSONObj &selector = _sdbStaticObject,
5143 const bson::BSONObj &orderBy = _sdbStaticObject,
5144 const bson::BSONObj &hint = _sdbStaticObject,
5145 INT64 numToSkip = 0,
5146 INT64 numToReturn = -1 )
5148 if ( NULL == pRecycleBin )
5150 return SDB_NOT_CONNECTED ;
5152 return pRecycleBin->snapshot( cursor,
5180 INT32 snapshot( sdbCursor &cursor,
5181 const bson::BSONObj &condition = _sdbStaticObject,
5182 const bson::BSONObj &selector = _sdbStaticObject,
5183 const bson::BSONObj &orderBy = _sdbStaticObject,
5184 const bson::BSONObj &hint = _sdbStaticObject,
5185 INT64 numToSkip = 0,
5186 INT64 numToReturn = -1 )
5188 if ( NULL == pRecycleBin )
5190 return SDB_NOT_CONNECTED ;
5192 return pRecycleBin->snapshot( cursor,
5209 INT32 getCount( INT64 &count,
5210 const bson::BSONObj &condition = _sdbStaticObject )
5212 if ( NULL == pRecycleBin )
5214 return SDB_NOT_CONNECTED ;
5216 return pRecycleBin->getCount( count, condition ) ;
5220 class DLLEXPORT _sdbLob
5223 _sdbLob (
const _sdbLob& other ) ;
5224 _sdbLob& operator= (
const _sdbLob& ) ;
5229 virtual ~_sdbLob () {}
5231 virtual INT32 close () = 0 ;
5233 virtual INT32 read ( UINT32 len, CHAR *buf, UINT32 *read ) = 0 ;
5235 virtual INT32 write (
const CHAR *buf, UINT32 len ) = 0 ;
5237 virtual INT32 seek ( SINT64 size,
SDB_LOB_SEEK whence ) = 0 ;
5239 virtual INT32 lock( INT64 offset, INT64 length ) = 0 ;
5241 virtual INT32 lockAndSeek( INT64 offset, INT64 length ) = 0 ;
5243 virtual INT32 isClosed( BOOLEAN &flag ) = 0 ;
5245 virtual INT32 getOid( bson::OID &oid ) = 0 ;
5247 virtual INT32 getSize( SINT64 *size ) = 0 ;
5249 virtual INT32 getCreateTime ( UINT64 *millis ) = 0 ;
5251 virtual BOOLEAN isClosed() = 0 ;
5253 virtual bson::OID getOid() = 0 ;
5255 virtual SINT64 getSize() = 0 ;
5257 virtual UINT64 getCreateTime () = 0 ;
5259 virtual UINT64 getModificationTime() = 0 ;
5261 virtual INT32 getPiecesInfoNum() = 0 ;
5263 virtual bson::BSONArray getPiecesInfo() = 0 ;
5265 virtual BOOLEAN isEof() = 0 ;
5267 virtual INT32 getRunTimeDetail( bson::BSONObj &detail,
5268 const bson::BSONObj &option = _sdbStaticObject ) = 0 ;
5317 return pLob->
close() ;
5328 INT32 read ( UINT32 len, CHAR *buf, UINT32 *read )
5332 return SDB_NOT_CONNECTED ;
5334 return pLob->read( len, buf, read ) ;
5344 INT32 write (
const CHAR *buf, UINT32 len )
5348 return SDB_NOT_CONNECTED ;
5350 return pLob->write( buf, len ) ;
5364 return SDB_NOT_CONNECTED ;
5366 return pLob->seek( size, whence ) ;
5376 INT32 lock ( INT64 offset, INT64 length )
5380 return SDB_NOT_CONNECTED ;
5382 return pLob->lock( offset, length ) ;
5392 INT32 lockAndSeek ( INT64 offset, INT64 length )
5396 return SDB_NOT_CONNECTED ;
5398 return pLob->lockAndSeek( offset, length ) ;
5408 INT32 isClosed( BOOLEAN &flag )
5412 return SDB_NOT_CONNECTED ;
5414 return pLob->isClosed ( flag ) ;
5427 return pLob->isClosed () ;
5437 INT32 getOid ( bson::OID &oid )
5441 return SDB_NOT_CONNECTED ;
5443 return pLob->getOid( oid ) ;
5456 return pLob->getOid() ;
5466 INT32 getSize ( SINT64 *size )
5470 return SDB_NOT_CONNECTED ;
5472 return pLob->getSize( size ) ;
5485 return pLob->getSize();
5495 INT32 getCreateTime ( UINT64 *millis )
5499 return SDB_NOT_CONNECTED ;
5501 return pLob->getCreateTime( millis ) ;
5508 UINT64 getCreateTime ()
5514 return pLob->getCreateTime() ;
5521 UINT64 getModificationTime ()
5527 return pLob->getModificationTime() ;
5534 INT32 getPiecesInfoNum()
5540 return pLob->getPiecesInfoNum() ;
5547 bson::BSONArray getPiecesInfo()
5551 return bson::BSONArray() ;
5553 return pLob->getPiecesInfo() ;
5566 return pLob->isEof() ;
5574 INT32 getRunTimeDetail( bson::BSONObj &detail,
5575 const bson::BSONObj &option = _sdbStaticObject )
5581 return pLob->getRunTimeDetail( detail, option ) ;
5586 class DLLEXPORT _sdbSequence
5589 _sdbSequence (
const _sdbSequence& other ) ;
5590 _sdbSequence& operator=(
const _sdbSequence& ) ;
5593 virtual ~_sdbSequence () {}
5595 virtual INT32 setAttributes (
const bson::BSONObj &options ) = 0 ;
5597 virtual INT32 getNextValue ( INT64 &value ) = 0 ;
5599 virtual INT32 getCurrentValue ( INT64 &value ) = 0 ;
5601 virtual INT32 setCurrentValue (
const INT64 value ) = 0 ;
5603 virtual INT32 fetch(
const INT32 fetchNum,
5606 INT32 &Increment ) = 0 ;
5608 virtual INT32 restart(
const INT64 startValue ) = 0 ;
5673 INT32 setAttributes (
const bson::BSONObj & options )
5675 if ( NULL == pSequence )
5677 return SDB_NOT_CONNECTED ;
5688 INT32 getNextValue( INT64 &value )
5690 if ( NULL == pSequence )
5692 return SDB_NOT_CONNECTED ;
5694 return pSequence->getNextValue( value ) ;
5703 INT32 getCurrentValue( INT64 &value )
5705 if ( NULL == pSequence )
5707 return SDB_NOT_CONNECTED ;
5709 return pSequence->getCurrentValue( value ) ;
5718 INT32 setCurrentValue(
const INT64 value )
5720 if ( NULL == pSequence )
5722 return SDB_NOT_CONNECTED ;
5724 return pSequence->setCurrentValue( value ) ;
5737 INT32 fetch(
const INT32 fetchNum, INT64 &nextValue,
5738 INT32 &returnNum, INT32 &increment )
5740 if ( NULL == pSequence )
5742 return SDB_NOT_CONNECTED ;
5744 return pSequence->fetch( fetchNum, nextValue, returnNum, increment ) ;
5753 INT32 restart(
const INT64 startValue )
5755 if ( NULL == pSequence )
5757 return SDB_NOT_CONNECTED ;
5759 return pSequence->restart( startValue ) ;
5763 class DLLEXPORT _sdbDataSource
5766 _sdbDataSource(
const _sdbDataSource& other ) ;
5767 _sdbDataSource& operator=(
const _sdbDataSource& ) ;
5770 virtual ~_sdbDataSource() {}
5772 virtual INT32 alterDataSource(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5773 virtual const CHAR *getName() = 0 ;
5785 _sdbDataSource *pDataSource ;
5789 pDataSource = NULL ;
5796 delete pDataSource ;
5840 INT32 alterDataSource(
const bson::BSONObj &options )
5844 return SDB_NOT_CONNECTED ;
5853 const CHAR *getName()
5859 return pDataSource->getName() ;
5863 class DLLEXPORT _sdb
5866 _sdb (
const _sdb& other ) ;
5867 _sdb& operator=(
const _sdb& ) ;
5871 virtual INT32 connect (
const CHAR *pHostName,
5874 virtual INT32 connect (
const CHAR *pHostName,
5876 const CHAR *pUsrName,
5877 const CHAR *pPasswd ) = 0 ;
5878 virtual INT32 connect (
const CHAR *pHostName,
5879 const CHAR *pServiceName ) = 0 ;
5880 virtual INT32 connect (
const CHAR *pHostName,
5881 const CHAR *pServiceName,
5882 const CHAR *pUsrName,
5883 const CHAR *pPasswd ) = 0 ;
5884 virtual INT32 connect (
const CHAR **pConnAddrs,
5886 const CHAR *pUsrName,
5887 const CHAR *pPasswd ) = 0 ;
5888 virtual INT32 connect (
const CHAR **pConnAddrs,
5890 const CHAR *pUsrName,
5892 const CHAR *pCipherFile ) = 0 ;
5894 virtual void disconnect () = 0 ;
5896 virtual UINT64 getDbStartTime() = 0 ;
5898 virtual const CHAR *getAddress() = 0 ;
5900 virtual void getVersion( UINT8 &version, UINT8 &subVersion,
5901 UINT8 &fixVersion ) = 0 ;
5903 virtual INT32 createUsr(
const CHAR *pUsrName,
5904 const CHAR *pPasswd,
5905 const bson::BSONObj &options = _sdbStaticObject
5908 virtual INT32 removeUsr(
const CHAR *pUsrName,
5909 const CHAR *pPasswd ) = 0 ;
5911 virtual INT32 alterUsr(
const CHAR *pUsrName,
5912 const CHAR *pAction,
5913 const bson::BSONObj &options ) = 0 ;
5915 virtual INT32 changeUsrPasswd(
const CHAR *pUsrName,
5916 const CHAR *pOldPasswd,
5917 const CHAR *pNewPasswd ) = 0 ;
5919 virtual INT32 getSnapshot ( _sdbCursor **cursor,
5921 const bson::BSONObj &condition = _sdbStaticObject,
5922 const bson::BSONObj &selector = _sdbStaticObject,
5923 const bson::BSONObj &orderBy = _sdbStaticObject,
5924 const bson::BSONObj &hint = _sdbStaticObject,
5925 INT64 numToSkip = 0,
5926 INT64 numToReturn = -1
5929 virtual INT32 getSnapshot ( sdbCursor &cursor,
5931 const bson::BSONObj &condition = _sdbStaticObject,
5932 const bson::BSONObj &selector = _sdbStaticObject,
5933 const bson::BSONObj &orderBy = _sdbStaticObject,
5934 const bson::BSONObj &hint = _sdbStaticObject,
5935 INT64 numToSkip = 0,
5936 INT64 numToReturn = -1
5939 virtual INT32 resetSnapshot (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
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
5950 virtual INT32 getList ( sdbCursor &cursor,
5952 const bson::BSONObj &condition = _sdbStaticObject,
5953 const bson::BSONObj &selector = _sdbStaticObject,
5954 const bson::BSONObj &orderBy = _sdbStaticObject,
5955 const bson::BSONObj &hint = _sdbStaticObject,
5956 INT64 numToSkip = 0,
5957 INT64 numToReturn = -1
5960 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
5961 _sdbCollection **collection,
5962 BOOLEAN checkExist = TRUE
5965 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
5966 sdbCollection &collection,
5967 BOOLEAN checkExist = TRUE
5970 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5971 _sdbCollectionSpace **cs,
5972 BOOLEAN checkExist = TRUE
5975 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5976 sdbCollectionSpace &cs,
5977 BOOLEAN checkExist = TRUE
5980 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5982 _sdbCollectionSpace **cs
5985 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5987 sdbCollectionSpace &cs
5990 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5991 const bson::BSONObj &options,
5992 _sdbCollectionSpace **cs
5995 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5996 const bson::BSONObj &options,
5997 sdbCollectionSpace &cs
6000 virtual INT32 dropCollectionSpace (
6001 const CHAR *pCollectionSpaceName,
6002 const bson::BSONObj &options = _sdbStaticObject
6005 virtual INT32 listCollectionSpaces ( _sdbCursor **result ) = 0 ;
6007 virtual INT32 listCollectionSpaces ( sdbCursor &result ) = 0 ;
6010 virtual INT32 listCollections ( _sdbCursor **result ) = 0 ;
6012 virtual INT32 listCollections ( sdbCursor &result ) = 0 ;
6015 virtual INT32 listReplicaGroups ( _sdbCursor **result ) = 0 ;
6017 virtual INT32 listReplicaGroups ( sdbCursor &result ) = 0 ;
6019 virtual INT32 getReplicaGroup (
const CHAR *pName,
6020 _sdbReplicaGroup **result ) = 0 ;
6022 virtual INT32 getReplicaGroup (
const CHAR *pName,
6023 sdbReplicaGroup &result ) = 0 ;
6025 virtual INT32 getReplicaGroup ( INT32
id,
6026 _sdbReplicaGroup **result ) = 0 ;
6028 virtual INT32 getReplicaGroup ( INT32
id,
6029 sdbReplicaGroup &result ) = 0 ;
6031 virtual INT32 createReplicaGroup (
const CHAR *pName,
6032 _sdbReplicaGroup **replicaGroup ) = 0 ;
6034 virtual INT32 createReplicaGroup (
const CHAR *pName,
6035 sdbReplicaGroup &replicaGroup ) = 0 ;
6037 virtual INT32 removeReplicaGroup (
const CHAR *pName ) = 0 ;
6039 virtual INT32 createReplicaCataGroup (
const CHAR *pHostName,
6040 const CHAR *pServiceName,
6041 const CHAR *pDatabasePath,
6042 const bson::BSONObj &configure ) =0 ;
6044 virtual INT32 activateReplicaGroup (
const CHAR *pName,
6045 _sdbReplicaGroup **replicaGroup ) = 0 ;
6046 virtual INT32 activateReplicaGroup (
const CHAR *pName,
6047 sdbReplicaGroup &replicaGroup ) = 0 ;
6049 virtual INT32 execUpdate(
const CHAR *sql,
6050 bson::BSONObj *pResult = NULL ) = 0 ;
6052 virtual INT32 exec(
const CHAR *sql,
6053 _sdbCursor **result ) = 0 ;
6055 virtual INT32 exec(
const CHAR *sql,
6056 sdbCursor &result ) = 0 ;
6058 virtual INT32 transactionBegin() = 0 ;
6060 virtual INT32 transactionCommit(
const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
6062 virtual INT32 transactionRollback() = 0 ;
6064 virtual INT32 flushConfigure(
const bson::BSONObj &options ) = 0 ;
6066 virtual INT32 crtJSProcedure (
const CHAR *code ) = 0 ;
6067 virtual INT32 rmProcedure(
const CHAR *spName ) = 0 ;
6068 virtual INT32 listProcedures( _sdbCursor **cursor,
const bson::BSONObj &condition ) = 0 ;
6069 virtual INT32 listProcedures( sdbCursor &cursor,
const bson::BSONObj &condition ) = 0 ;
6070 virtual INT32 evalJS(
const CHAR *code,
6072 _sdbCursor **cursor,
6073 bson::BSONObj &errmsg ) = 0 ;
6074 virtual INT32 evalJS(
const CHAR *code,
6077 bson::BSONObj &errmsg ) = 0 ;
6080 virtual INT32 backup (
const bson::BSONObj &options) = 0 ;
6081 virtual INT32 listBackup ( _sdbCursor **cursor,
6082 const bson::BSONObj &options,
6083 const bson::BSONObj &condition = _sdbStaticObject,
6084 const bson::BSONObj &selector = _sdbStaticObject,
6085 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
6086 virtual INT32 listBackup ( sdbCursor &cursor,
6087 const bson::BSONObj &options,
6088 const bson::BSONObj &condition = _sdbStaticObject,
6089 const bson::BSONObj &selector = _sdbStaticObject,
6090 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
6091 virtual INT32 removeBackup (
const bson::BSONObj &options ) = 0 ;
6094 virtual INT32 listTasks ( _sdbCursor **cursor,
6095 const bson::BSONObj &condition = _sdbStaticObject,
6096 const bson::BSONObj &selector = _sdbStaticObject,
6097 const bson::BSONObj &orderBy = _sdbStaticObject,
6098 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
6101 virtual INT32 listTasks ( sdbCursor &cursor,
6102 const bson::BSONObj &condition = _sdbStaticObject,
6103 const bson::BSONObj &selector = _sdbStaticObject,
6104 const bson::BSONObj &orderBy = _sdbStaticObject,
6105 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
6107 virtual INT32 waitTasks (
const SINT64 *taskIDs,
6110 virtual INT32 cancelTask ( SINT64 taskID,
6111 BOOLEAN isAsync ) = 0 ;
6113 virtual INT32 setSessionAttr (
const bson::BSONObj &options =
6114 _sdbStaticObject ) = 0 ;
6116 virtual INT32 getSessionAttr ( bson::BSONObj &result,
6117 BOOLEAN useCache = TRUE ) = 0 ;
6120 virtual INT32 closeAllCursors () = 0 ;
6123 virtual INT32 interrupt() = 0 ;
6124 virtual INT32 interruptOperation() = 0 ;
6127 virtual INT32 isValid( BOOLEAN *result ) = 0 ;
6128 virtual BOOLEAN isValid() = 0 ;
6130 virtual BOOLEAN isClosed() = 0 ;
6133 virtual INT32 createDomain (
const CHAR *pDomainName,
6134 const bson::BSONObj &options,
6135 _sdbDomain **domain ) = 0 ;
6137 virtual INT32 createDomain (
const CHAR *pDomainName,
6138 const bson::BSONObj &options,
6139 sdbDomain &domain ) = 0 ;
6141 virtual INT32 dropDomain (
const CHAR *pDomainName ) = 0 ;
6143 virtual INT32 getDomain (
const CHAR *pDomainName,
6144 _sdbDomain **domain ) = 0 ;
6146 virtual INT32 getDomain (
const CHAR *pDomainName,
6147 sdbDomain &domain ) = 0 ;
6149 virtual INT32 listDomains ( _sdbCursor **cursor,
6150 const bson::BSONObj &condition = _sdbStaticObject,
6151 const bson::BSONObj &selector = _sdbStaticObject,
6152 const bson::BSONObj &orderBy = _sdbStaticObject,
6153 const bson::BSONObj &hint = _sdbStaticObject
6156 virtual INT32 listDomains ( sdbCursor &cursor,
6157 const bson::BSONObj &condition = _sdbStaticObject,
6158 const bson::BSONObj &selector = _sdbStaticObject,
6159 const bson::BSONObj &orderBy = _sdbStaticObject,
6160 const bson::BSONObj &hint = _sdbStaticObject
6162 virtual INT32 getDC( _sdbDataCenter **dc ) = 0 ;
6163 virtual INT32 getDC( sdbDataCenter &dc ) = 0 ;
6165 virtual INT32 getRecycleBin( _sdbRecycleBin **recycleBin ) = 0 ;
6166 virtual INT32 getRecycleBin( sdbRecycleBin &recycleBin ) = 0 ;
6168 static _sdb *getObj ( BOOLEAN useSSL = FALSE ) ;
6171 virtual UINT64 getLastAliveTime()
const = 0 ;
6173 virtual INT32 syncDB(
6174 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6176 virtual INT32 analyze(
6177 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6179 virtual INT32 forceSession(
6181 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6183 virtual INT32 forceStepUp(
6184 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6186 virtual INT32 invalidateCache(
6187 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6189 virtual INT32 reloadConfig(
6190 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6192 virtual INT32 updateConfig (
const bson::BSONObj &configs = _sdbStaticObject,
6193 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6195 virtual INT32 deleteConfig (
const bson::BSONObj &configs = _sdbStaticObject,
6196 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6198 virtual INT32 setPDLevel( INT32 level,
6199 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6201 virtual INT32 memTrim(
const CHAR *maskStr =
"",
6202 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6204 virtual INT32 msg(
const CHAR* msg ) = 0 ;
6206 virtual INT32 loadCS(
const CHAR* csName,
6207 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6209 virtual INT32 unloadCS(
const CHAR* csName,
6210 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6212 virtual INT32 traceStart( UINT32 traceBufferSize,
6213 const CHAR* component = NULL,
6214 const CHAR* breakpoint = NULL,
6215 const vector<UINT32> &tidVec = _sdbStaticUINT32Vec ) = 0 ;
6217 virtual INT32 traceStart( UINT32 traceBufferSize,
6218 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6220 virtual INT32 traceStop(
const CHAR* dumpFileName ) = 0 ;
6222 virtual INT32 traceResume() = 0 ;
6224 virtual INT32 traceStatus( _sdbCursor** cursor ) = 0 ;
6226 virtual INT32 traceStatus( sdbCursor& cursor ) = 0 ;
6229 virtual INT32 renameCollectionSpace(
const CHAR* oldName,
6230 const CHAR* newName,
6231 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
6233 virtual INT32 getLastErrorObj( bson::BSONObj &result ) = 0 ;
6234 virtual void cleanLastErrorObj() = 0 ;
6236 virtual INT32 getLastResultObj( bson::BSONObj &result,
6237 BOOLEAN getOwned = FALSE )
const = 0 ;
6240 virtual INT32 createSequence(
const CHAR *pSequenceName,
6241 const bson::BSONObj &options,
6242 _sdbSequence **sequence ) = 0 ;
6244 virtual INT32 createSequence(
const CHAR *pSequenceName,
6245 const bson::BSONObj &options,
6246 sdbSequence &sequence ) = 0 ;
6248 virtual INT32 createSequence(
const CHAR *pSequenceName,
6249 sdbSequence &sequence ) = 0 ;
6252 virtual INT32 getSequence(
const CHAR *pSequenceName,
6253 _sdbSequence **sequence ) = 0 ;
6255 virtual INT32 getSequence(
const CHAR *pSequenceName,
6256 sdbSequence &sequence ) = 0 ;
6258 virtual INT32 renameSequence(
const CHAR *pOldName,
6259 const CHAR *pNewName ) = 0 ;
6261 virtual INT32 dropSequence(
const CHAR *pSequenceName ) = 0 ;
6263 virtual INT32 createDataSource( _sdbDataSource **dataSource,
6264 const CHAR *pDataSourceName,
6265 const CHAR *addresses,
6266 const CHAR *user = NULL,
6267 const CHAR *password = NULL,
6268 const CHAR *type = NULL,
6269 const bson::BSONObj *options = NULL
6272 virtual INT32 dropDataSource(
const CHAR *pDataSourceName ) = 0 ;
6274 virtual INT32 getDataSource(
const CHAR *pDataSourceName,
6275 _sdbDataSource **dataSource ) = 0 ;
6277 virtual INT32 listDataSources( _sdbCursor** cursor,
6278 const bson::BSONObj &condition = _sdbStaticObject,
6279 const bson::BSONObj &selector = _sdbStaticObject,
6280 const bson::BSONObj &orderBy = _sdbStaticObject,
6281 const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
6283 virtual INT32 createRole(
const bson::BSONObj &role) = 0;
6285 virtual INT32 dropRole(
const CHAR *pRoleName ) = 0;
6287 virtual INT32 getRole(
const CHAR *pRoleName,
6288 const bson::BSONObj &options,
6289 bson::BSONObj &role ) = 0;
6291 virtual INT32 listRoles( _sdbCursor **result,
const bson::BSONObj &options ) = 0;
6293 virtual INT32 updateRole(
const CHAR *pRoleName,
6294 const bson::BSONObj &role ) = 0;
6296 virtual INT32 grantPrivilegesToRole(
const CHAR *pRoleName,
6297 const bson::BSONObj &privileges ) = 0;
6299 virtual INT32 revokePrivilegesFromRole(
const CHAR *pRoleName,
6300 const bson::BSONObj &privileges ) = 0;
6302 virtual INT32 grantRolesToRole(
const CHAR *pRoleName,
6303 const bson::BSONObj &roles ) = 0;
6305 virtual INT32 revokeRolesFromRole(
const CHAR *pRoleName,
6306 const bson::BSONObj &roles ) = 0;
6308 virtual INT32 grantRolesToUser(
const CHAR *pUsrName,
6309 const bson::BSONObj &roles ) = 0;
6311 virtual INT32 revokeRolesFromUser(
const CHAR *pUsrName,
6312 const bson::BSONObj &roles ) = 0;
6314 virtual INT32 getUser(
const CHAR *pUserName,
6315 const bson::BSONObj &options,
6316 bson::BSONObj &user ) = 0;
6318 virtual INT32 invalidateUserCache(
const CHAR *pUserName = NULL,
6319 const bson::BSONObj &options = _sdbStaticObject ) = 0;
6321 virtual INT32 invalidateFsCache(
const bson::BSONObj &options = _sdbStaticObject,
6322 const CHAR *pExpiredTime = NULL ) = 0;
6324 virtual void enableClientQueryID() = 0 ;
6326 virtual void incQueryID() = 0 ;
6328 virtual UINT32 getQueryIDStr( CHAR *pStr, UINT32 strlen ) = 0 ;
6332 typedef class _sdb _sdb ;
6339 sdb (
const sdb& other ) ;
6340 sdb& operator=(
const sdb& ) ;
6354 sdb ( BOOLEAN useSSL = FALSE ) :
6355 pSDB ( _sdb::getObj( useSSL ) )
6379 INT32 connect (
const CHAR *pHostName,
6385 return SDB_NOT_CONNECTED ;
6387 return pSDB->
connect ( pHostName, port ) ;
6403 INT32 connect (
const CHAR *pHostName,
6405 const CHAR *pUsrName,
6411 return SDB_NOT_CONNECTED ;
6413 return pSDB->connect ( pHostName, port,
6414 pUsrName, pPasswd ) ;
6426 INT32 connect (
const CHAR *pHostName,
6427 const CHAR *pServiceName
6432 return SDB_NOT_CONNECTED ;
6434 return pSDB->connect ( pHostName, pServiceName ) ;
6450 INT32 connect (
const CHAR *pHostName,
6451 const CHAR *pServiceName,
6452 const CHAR *pUsrName,
6453 const CHAR *pPasswd )
6457 return SDB_NOT_CONNECTED ;
6459 return pSDB->connect ( pHostName, pServiceName,
6460 pUsrName, pPasswd ) ;
6476 INT32 connect (
const CHAR **pConnAddrs,
6478 const CHAR *pUsrName,
6479 const CHAR *pPasswd )
6483 return SDB_NOT_CONNECTED ;
6485 return pSDB->connect ( pConnAddrs, arrSize,
6486 pUsrName, pPasswd ) ;
6504 INT32 connect (
const CHAR **pConnAddrs,
6506 const CHAR *pUsrName,
6508 const CHAR *pCipherFile )
6512 return SDB_NOT_CONNECTED ;
6514 return pSDB->connect ( pConnAddrs, arrSize,
6515 pUsrName, pToken, pCipherFile ) ;
6522 UINT64 getDbStartTime ()
6528 return pSDB->getDbStartTime() ;
6535 const CHAR *getAddress ()
6541 return pSDB->getAddress () ;
6554 void getVersion ( UINT8 &version, UINT8 &subVersion, UINT8 &fixVersion )
6560 pSDB->getVersion( version, subVersion, fixVersion ) ;
6591 INT32 createUsr(
const CHAR *pUsrName,
6592 const CHAR *pPasswd,
6593 const bson::BSONObj &options = _sdbStaticObject )
6597 return SDB_NOT_CONNECTED ;
6599 return pSDB->createUsr( pUsrName, pPasswd, options ) ;
6610 INT32 removeUsr(
const CHAR *pUsrName,
6611 const CHAR *pPasswd )
6615 return SDB_NOT_CONNECTED ;
6617 return pSDB->removeUsr( pUsrName, pPasswd ) ;
6632 INT32 alterUsr(
const CHAR *pUsrName,
6633 const CHAR *pAction,
6634 const bson::BSONObj &options )
6638 return SDB_NOT_CONNECTED ;
6640 return pSDB->alterUsr( pUsrName, pAction, options ) ;
6653 INT32 changeUsrPasswd(
const CHAR *pUsrName,
6654 const CHAR *pOldPasswd,
6655 const CHAR *pNewPasswd )
6659 return SDB_NOT_CONNECTED ;
6661 return pSDB->changeUsrPasswd( pUsrName, pOldPasswd, pNewPasswd ) ;
6673 pSDB->disconnect () ;
6719 const bson::BSONObj &condition = _sdbStaticObject,
6720 const bson::BSONObj &selector = _sdbStaticObject,
6721 const bson::BSONObj &orderBy = _sdbStaticObject,
6722 const bson::BSONObj &hint = _sdbStaticObject,
6723 INT64 numToSkip = 0,
6724 INT64 numToReturn = -1 )
6728 return SDB_NOT_CONNECTED ;
6731 return pSDB->getSnapshot ( cursor, snapType, condition,
6732 selector, orderBy, hint,
6733 numToSkip, numToReturn ) ;
6778 INT32 getSnapshot ( _sdbCursor **cursor,
6780 const bson::BSONObj &condition = _sdbStaticObject,
6781 const bson::BSONObj &selector = _sdbStaticObject,
6782 const bson::BSONObj &orderBy = _sdbStaticObject,
6783 const bson::BSONObj &hint = _sdbStaticObject,
6784 INT64 numToSkip = 0,
6785 INT64 numToReturn = -1 )
6789 return SDB_NOT_CONNECTED ;
6791 return pSDB->getSnapshot ( cursor, snapType, condition,
6792 selector, orderBy, hint,
6793 numToSkip, numToReturn ) ;
6818 INT32 resetSnapshot (
const bson::BSONObj &options = _sdbStaticObject )
6822 return SDB_NOT_CONNECTED ;
6824 return pSDB->resetSnapshot ( options ) ;
6827 INT32 getList ( _sdbCursor **cursor,
6829 const bson::BSONObj &condition = _sdbStaticObject,
6830 const bson::BSONObj &selector = _sdbStaticObject,
6831 const bson::BSONObj &orderBy = _sdbStaticObject,
6832 const bson::BSONObj &hint = _sdbStaticObject,
6833 INT64 numToSkip = 0,
6834 INT64 numToReturn = -1
6839 return SDB_NOT_CONNECTED ;
6841 return pSDB->getList ( cursor, listType,
6842 condition, selector, orderBy, hint,
6843 numToSkip, numToReturn ) ;
6890 const bson::BSONObj &condition = _sdbStaticObject,
6891 const bson::BSONObj &selector = _sdbStaticObject,
6892 const bson::BSONObj &orderBy = _sdbStaticObject,
6893 const bson::BSONObj &hint = _sdbStaticObject,
6894 INT64 numToSkip = 0,
6895 INT64 numToReturn = -1
6900 return SDB_NOT_CONNECTED ;
6903 return pSDB->getList ( cursor, listType,
6904 condition, selector, orderBy, hint,
6905 numToSkip, numToReturn ) ;
6908 INT32 getCollection (
const CHAR *pCollectionFullName,
6909 _sdbCollection **collection,
6910 BOOLEAN checkExist = TRUE
6915 return SDB_NOT_CONNECTED ;
6917 return pSDB->getCollection ( pCollectionFullName,
6918 collection, checkExist ) ;
6931 INT32 getCollection (
const CHAR *pCollectionFullName,
6933 BOOLEAN checkExist = TRUE
6938 return SDB_NOT_CONNECTED ;
6941 return pSDB->getCollection ( pCollectionFullName,
6946 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
6947 _sdbCollectionSpace **cs,
6948 BOOLEAN checkExist = TRUE
6953 return SDB_NOT_CONNECTED ;
6955 return pSDB->getCollectionSpace ( pCollectionSpaceName,
6969 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
6971 BOOLEAN checkExist = TRUE
6976 return SDB_NOT_CONNECTED ;
6979 return pSDB->getCollectionSpace ( pCollectionSpaceName,
6983 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
6985 _sdbCollectionSpace **cs
6990 return SDB_NOT_CONNECTED ;
6992 return pSDB->createCollectionSpace ( pCollectionSpaceName,
7015 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
7022 return SDB_NOT_CONNECTED ;
7025 return pSDB->createCollectionSpace ( pCollectionSpaceName,
7029 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
7030 const bson::BSONObj &options,
7031 _sdbCollectionSpace **cs
7036 return SDB_NOT_CONNECTED ;
7038 return pSDB->createCollectionSpace ( pCollectionSpaceName,
7059 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
7060 const bson::BSONObj &options,
7066 return SDB_NOT_CONNECTED ;
7069 return pSDB->createCollectionSpace ( pCollectionSpaceName,
7081 INT32 dropCollectionSpace (
7082 const CHAR *pCollectionSpaceName,
7083 const bson::BSONObj &options = _sdbStaticObject )
7087 return SDB_NOT_CONNECTED ;
7090 return pSDB->dropCollectionSpace ( pCollectionSpaceName, options ) ;
7093 INT32 listCollectionSpaces ( _sdbCursor **result )
7097 return SDB_NOT_CONNECTED ;
7099 return pSDB->listCollectionSpaces ( result ) ;
7112 return SDB_NOT_CONNECTED ;
7115 return pSDB->listCollectionSpaces ( cursor ) ;
7124 INT32 listCollections ( _sdbCursor **result )
7128 return SDB_NOT_CONNECTED ;
7130 return pSDB->listCollections ( result ) ;
7143 return SDB_NOT_CONNECTED ;
7146 return pSDB->listCollections ( cursor ) ;
7155 INT32 listReplicaGroups ( _sdbCursor **result )
7159 return SDB_NOT_CONNECTED ;
7161 return pSDB->listReplicaGroups ( result ) ;
7175 return SDB_NOT_CONNECTED ;
7178 return pSDB->listReplicaGroups ( cursor ) ;
7188 INT32 getReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **result )
7192 return SDB_NOT_CONNECTED ;
7194 return pSDB->getReplicaGroup ( pName, result ) ;
7209 return SDB_NOT_CONNECTED ;
7212 return pSDB->getReplicaGroup ( pName, group ) ;
7222 INT32 getReplicaGroup ( INT32
id, _sdbReplicaGroup **result )
7226 return SDB_NOT_CONNECTED ;
7228 return pSDB->getReplicaGroup (
id, result ) ;
7242 return SDB_NOT_CONNECTED ;
7245 return pSDB->getReplicaGroup (
id, group ) ;
7255 INT32 createReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **replicaGroup )
7259 return SDB_NOT_CONNECTED ;
7261 return pSDB->createReplicaGroup ( pName, replicaGroup ) ;
7275 return SDB_NOT_CONNECTED ;
7278 return pSDB->createReplicaGroup ( pName, group ) ;
7287 INT32 removeReplicaGroup (
const CHAR *pName )
7291 return SDB_NOT_CONNECTED ;
7293 return pSDB->removeReplicaGroup ( pName ) ;
7308 INT32 createReplicaCataGroup (
const CHAR *pHostName,
7309 const CHAR *pServiceName,
7310 const CHAR *pDatabasePath,
7311 const bson::BSONObj &configure )
7315 return SDB_NOT_CONNECTED ;
7317 return pSDB->createReplicaCataGroup ( pHostName, pServiceName,
7318 pDatabasePath, configure ) ;
7321 INT32 activateReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **replicaGroup )
7325 return SDB_NOT_CONNECTED ;
7327 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
7341 return SDB_NOT_CONNECTED ;
7344 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
7354 INT32 execUpdate(
const CHAR *sql, bson::BSONObj *pResult = NULL )
7358 return SDB_NOT_CONNECTED ;
7360 return pSDB->execUpdate( sql, pResult ) ;
7371 INT32 exec(
const CHAR *sql,
7372 _sdbCursor **result )
7376 return SDB_NOT_CONNECTED ;
7378 return pSDB->exec( sql, result ) ;
7389 INT32 exec(
const CHAR *sql,
7394 return SDB_NOT_CONNECTED ;
7397 return pSDB->exec( sql, cursor ) ;
7405 INT32 transactionBegin()
7409 return SDB_NOT_CONNECTED ;
7411 return pSDB->transactionBegin() ;
7421 INT32 transactionCommit(
const bson::BSONObj &hint = _sdbStaticObject )
7425 return SDB_NOT_CONNECTED ;
7427 return pSDB->transactionCommit( hint ) ;
7435 INT32 transactionRollback()
7439 return SDB_NOT_CONNECTED ;
7441 return pSDB->transactionRollback() ;
7452 INT32 flushConfigure(
const bson::BSONObj &options )
7456 return SDB_NOT_CONNECTED ;
7458 return pSDB->flushConfigure( options ) ;
7467 INT32 crtJSProcedure (
const CHAR *code )
7471 return SDB_NOT_CONNECTED ;
7473 return pSDB->crtJSProcedure( code ) ;
7482 INT32 rmProcedure(
const CHAR *spName )
7486 return SDB_NOT_CONNECTED ;
7488 return pSDB->rmProcedure( spName ) ;
7491 INT32 listProcedures( _sdbCursor **cursor,
const bson::BSONObj &condition )
7495 return SDB_NOT_CONNECTED ;
7497 return pSDB->listProcedures( cursor, condition ) ;
7507 INT32 listProcedures(
sdbCursor &cursor,
const bson::BSONObj &condition )
7511 return SDB_NOT_CONNECTED ;
7514 return pSDB->listProcedures( cursor, condition ) ;
7517 INT32 evalJS(
const CHAR *code,
7519 _sdbCursor **cursor,
7520 bson::BSONObj &errmsg )
7524 return SDB_NOT_CONNECTED ;
7526 return pSDB->evalJS( code, type, cursor, errmsg ) ;
7543 bson::BSONObj &errmsg )
7547 return SDB_NOT_CONNECTED ;
7550 return pSDB->evalJS( code, type, cursor, errmsg ) ;
7572 INT32 backupOffline (
const bson::BSONObj &options)
7574 return backup( options ) ;
7595 INT32 backup (
const bson::BSONObj &options)
7599 return SDB_NOT_CONNECTED ;
7601 return pSDB->backup( options ) ;
7605 INT32 listBackup ( _sdbCursor **cursor,
7606 const bson::BSONObj &options,
7607 const bson::BSONObj &condition = _sdbStaticObject,
7608 const bson::BSONObj &selector = _sdbStaticObject,
7609 const bson::BSONObj &orderBy = _sdbStaticObject)
7613 return SDB_NOT_CONNECTED ;
7615 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
7641 const bson::BSONObj &options,
7642 const bson::BSONObj &condition = _sdbStaticObject,
7643 const bson::BSONObj &selector = _sdbStaticObject,
7644 const bson::BSONObj &orderBy = _sdbStaticObject)
7648 return SDB_NOT_CONNECTED ;
7651 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
7668 INT32 removeBackup (
const bson::BSONObj &options)
7672 return SDB_NOT_CONNECTED ;
7674 return pSDB->removeBackup( options ) ;
7677 INT32 listTasks ( _sdbCursor **cursor,
7678 const bson::BSONObj &condition = _sdbStaticObject,
7679 const bson::BSONObj &selector = _sdbStaticObject,
7680 const bson::BSONObj &orderBy = _sdbStaticObject,
7681 const bson::BSONObj &hint = _sdbStaticObject)
7685 return SDB_NOT_CONNECTED ;
7687 return pSDB->listTasks ( cursor,
7711 const bson::BSONObj &condition = _sdbStaticObject,
7712 const bson::BSONObj &selector = _sdbStaticObject,
7713 const bson::BSONObj &orderBy = _sdbStaticObject,
7714 const bson::BSONObj &hint = _sdbStaticObject)
7718 return SDB_NOT_CONNECTED ;
7721 return pSDB->listTasks ( cursor,
7736 INT32 waitTasks (
const SINT64 *taskIDs,
7741 return SDB_NOT_CONNECTED ;
7743 return pSDB->waitTasks ( taskIDs,
7756 INT32 cancelTask ( SINT64 taskID,
7761 return SDB_NOT_CONNECTED ;
7763 return pSDB->cancelTask ( taskID,
7777 INT32 setSessionAttr (
const bson::BSONObj &options = _sdbStaticObject )
7781 return SDB_NOT_CONNECTED ;
7783 return pSDB->setSessionAttr ( options ) ;
7794 INT32 getSessionAttr ( bson::BSONObj & result,
7795 BOOLEAN useCache = TRUE )
7799 return SDB_NOT_CONNECTED ;
7801 return pSDB->getSessionAttr( result, useCache ) ;
7810 INT32 closeAllCursors ()
7812 return interrupt() ;
7825 return SDB_NOT_CONNECTED ;
7827 return pSDB->interrupt () ;
7838 INT32 interruptOperation()
7842 return SDB_NOT_CONNECTED ;
7844 return pSDB->interruptOperation () ;
7854 INT32 isValid ( BOOLEAN *result )
7858 return SDB_NOT_CONNECTED ;
7860 return pSDB->isValid ( result ) ;
7873 return pSDB->isValid () ;
7886 return pSDB->isClosed() ;
7907 INT32 createDomain (
const CHAR *pDomainName,
7908 const bson::BSONObj &options,
7913 return SDB_NOT_CONNECTED ;
7916 return pSDB->createDomain ( pDomainName, options, domain ) ;
7919 INT32 createDomain (
const CHAR *pDomainName,
7920 const bson::BSONObj &options,
7921 _sdbDomain **domain )
7925 return SDB_NOT_CONNECTED ;
7927 return pSDB->createDomain ( pDomainName, options, domain ) ;
7936 INT32 dropDomain (
const CHAR *pDomainName )
7940 return SDB_NOT_CONNECTED ;
7942 return pSDB->dropDomain ( pDomainName ) ;
7945 INT32 getDomain (
const CHAR *pDomainName,
7946 _sdbDomain **domain )
7950 return SDB_NOT_CONNECTED ;
7952 return pSDB->getDomain ( pDomainName, domain ) ;
7963 INT32 getDomain (
const CHAR *pDomainName,
7968 return SDB_NOT_CONNECTED ;
7971 return pSDB->getDomain ( pDomainName, domain ) ;
7974 INT32 listDomains ( _sdbCursor **cursor,
7975 const bson::BSONObj &condition = _sdbStaticObject,
7976 const bson::BSONObj &selector = _sdbStaticObject,
7977 const bson::BSONObj &orderBy = _sdbStaticObject,
7978 const bson::BSONObj &hint = _sdbStaticObject )
7982 return SDB_NOT_CONNECTED ;
7984 return pSDB->listDomains ( cursor, condition, selector, orderBy, hint ) ;
8005 const bson::BSONObj &condition = _sdbStaticObject,
8006 const bson::BSONObj &selector = _sdbStaticObject,
8007 const bson::BSONObj &orderBy = _sdbStaticObject,
8008 const bson::BSONObj &hint = _sdbStaticObject )
8012 return SDB_NOT_CONNECTED ;
8015 return pSDB->listDomains ( cursor, condition, selector, orderBy, hint ) ;
8023 INT32 getDC( sdbDataCenter &dc )
8027 return SDB_NOT_CONNECTED ;
8030 return pSDB->getDC ( dc ) ;
8038 INT32 getDC( _sdbDataCenter **dc )
8042 return SDB_NOT_CONNECTED ;
8044 return pSDB->getDC ( dc ) ;
8052 INT32 getRecycleBin( sdbRecycleBin &recycleBin )
8056 return SDB_NOT_CONNECTED ;
8059 return pSDB->getRecycleBin( recycleBin ) ;
8067 INT32 getRecycleBin( _sdbRecycleBin **recycleBin )
8071 return SDB_NOT_CONNECTED ;
8073 return pSDB->getRecycleBin( recycleBin ) ;
8105 INT32 syncDB(
const bson::BSONObj &options = _sdbStaticObject )
8109 return SDB_NOT_CONNECTED ;
8111 return pSDB->syncDB ( options ) ;
8140 INT32 analyze (
const bson::BSONObj &options = _sdbStaticObject )
8144 return SDB_NOT_CONNECTED ;
8146 return pSDB->analyze ( options ) ;
8164 INT32 forceSession( SINT64 sessionID,
8165 const bson::BSONObj &options = _sdbStaticObject )
8169 return SDB_NOT_CONNECTED ;
8171 return pSDB->forceSession( sessionID, options ) ;
8188 INT32 forceStepUp(
const bson::BSONObj &options = _sdbStaticObject )
8192 return SDB_NOT_CONNECTED ;
8194 return pSDB->forceStepUp( options ) ;
8209 INT32 invalidateCache(
const bson::BSONObj &options = _sdbStaticObject )
8213 return SDB_NOT_CONNECTED ;
8215 return pSDB->invalidateCache( options ) ;
8231 INT32 reloadConfig(
const bson::BSONObj &options = _sdbStaticObject )
8235 return SDB_NOT_CONNECTED ;
8237 return pSDB->reloadConfig( options ) ;
8256 INT32 updateConfig(
const bson::BSONObj &configs = _sdbStaticObject,
8257 const bson::BSONObj &options = _sdbStaticObject )
8261 return SDB_NOT_CONNECTED ;
8263 return pSDB->updateConfig( configs, options ) ;
8282 INT32 deleteConfig(
const bson::BSONObj &configs = _sdbStaticObject,
8283 const bson::BSONObj &options = _sdbStaticObject )
8287 return SDB_NOT_CONNECTED ;
8289 return pSDB->deleteConfig( configs, options ) ;
8314 INT32 setPDLevel( INT32 level,
8315 const bson::BSONObj &options = _sdbStaticObject )
8319 return SDB_NOT_CONNECTED ;
8321 return pSDB->setPDLevel( level, options ) ;
8339 INT32 memTrim(
const CHAR *maskStr =
"",
8340 const bson::BSONObj &options = _sdbStaticObject )
8344 return SDB_NOT_CONNECTED ;
8346 return pSDB->memTrim( maskStr, options ) ;
8349 INT32 msg(
const CHAR* msg )
8353 return SDB_NOT_CONNECTED ;
8355 return pSDB->msg( msg ) ;
8373 INT32 loadCS(
const CHAR* csName,
8374 const bson::BSONObj &options = _sdbStaticObject )
8378 return SDB_NOT_CONNECTED ;
8380 return pSDB->loadCS( csName, options ) ;
8398 INT32 unloadCS(
const CHAR* csName,
8399 const bson::BSONObj &options = _sdbStaticObject )
8403 return SDB_NOT_CONNECTED ;
8405 return pSDB->unloadCS( csName, options ) ;
8420 INT32 traceStart( UINT32 traceBufferSize,
8421 const CHAR* component = NULL,
8422 const CHAR* breakpoint = NULL,
8423 const vector<UINT32> &tidVec = _sdbStaticUINT32Vec )
8427 return SDB_NOT_CONNECTED ;
8429 return pSDB->traceStart( traceBufferSize, component,
8430 breakpoint, tidVec ) ;
8452 INT32 traceStart( UINT32 traceBufferSize,
8453 const bson::BSONObj &options )
8457 return SDB_NOT_CONNECTED ;
8459 return pSDB->traceStart( traceBufferSize, options ) ;
8470 INT32 traceStop(
const CHAR* dumpFileName )
8474 return SDB_NOT_CONNECTED ;
8476 return pSDB->traceStop( dumpFileName ) ;
8488 return SDB_NOT_CONNECTED ;
8490 return pSDB->traceResume() ;
8503 return SDB_NOT_CONNECTED ;
8506 return pSDB->traceStatus( cursor ) ;
8509 INT32 traceStatus( _sdbCursor** cursor )
8513 return SDB_NOT_CONNECTED ;
8515 return pSDB->traceStatus( cursor ) ;
8528 INT32 renameCollectionSpace(
const CHAR* oldName,
8529 const CHAR* newName,
8530 const bson::BSONObj &options = _sdbStaticObject )
8534 return SDB_NOT_CONNECTED ;
8536 return pSDB->renameCollectionSpace( oldName, newName, options ) ;
8550 INT32 getLastErrorObj( bson::BSONObj &errObj )
8554 return SDB_NOT_CONNECTED ;
8556 return pSDB->getLastErrorObj( errObj ) ;
8562 void cleanLastErrorObj()
8568 return pSDB->cleanLastErrorObj() ;
8581 INT32 getLastResultObj( bson::BSONObj &result,
8582 BOOLEAN getOwned = FALSE )
const
8586 return SDB_NOT_CONNECTED ;
8588 return pSDB->getLastResultObj( result, getOwned ) ;
8610 INT32 createSequence(
const CHAR *pSequenceName,
8611 const bson::BSONObj &options,
8612 _sdbSequence **sequence )
8616 return SDB_NOT_CONNECTED ;
8618 return pSDB->createSequence( pSequenceName, options, sequence ) ;
8640 INT32 createSequence(
const CHAR *pSequenceName,
8641 const bson::BSONObj &options,
8646 return SDB_NOT_CONNECTED ;
8648 return pSDB->createSequence( pSequenceName, options, sequence ) ;
8659 INT32 createSequence(
const CHAR *pSequenceName,
8664 return SDB_NOT_CONNECTED ;
8666 return pSDB->createSequence( pSequenceName, sequence ) ;
8677 INT32 getSequence(
const CHAR *pSequenceName,
8678 _sdbSequence **sequence )
8682 return SDB_NOT_CONNECTED ;
8684 return pSDB->getSequence( pSequenceName, sequence ) ;
8695 INT32 getSequence(
const CHAR *pSequenceName,
8700 return SDB_NOT_CONNECTED ;
8702 return pSDB->getSequence( pSequenceName, sequence ) ;
8712 INT32 renameSequence(
const CHAR *pOldName,
const CHAR *pNewName )
8716 return SDB_NOT_CONNECTED ;
8718 return pSDB->renameSequence( pOldName, pNewName ) ;
8727 INT32 dropSequence(
const CHAR *pSequenceName )
8731 return SDB_NOT_CONNECTED ;
8733 return pSDB->dropSequence( pSequenceName ) ;
8785 const CHAR *pDataSourceName,
8786 const CHAR *addresses,
8787 const CHAR *user = NULL,
8788 const CHAR *password = NULL,
8789 const CHAR *type = NULL,
8790 const bson::BSONObj *options = NULL )
8794 return SDB_NOT_CONNECTED ;
8797 return pSDB->createDataSource( &dataSource.pDataSource, pDataSourceName, addresses,
8798 user, password, type, options ) ;
8807 INT32 dropDataSource(
const CHAR *pDataSourceName )
8811 return SDB_NOT_CONNECTED ;
8813 return pSDB->dropDataSource( pDataSourceName ) ;
8824 INT32 getDataSource(
const CHAR *pDataSourceName,
8829 return SDB_NOT_CONNECTED ;
8832 return pSDB->getDataSource( pDataSourceName, &dataSource.pDataSource ) ;
8850 const bson::BSONObj &condition = _sdbStaticObject,
8851 const bson::BSONObj &selector = _sdbStaticObject,
8852 const bson::BSONObj &orderBy = _sdbStaticObject,
8853 const bson::BSONObj &hint = _sdbStaticObject )
8857 return SDB_NOT_CONNECTED ;
8860 return pSDB->listDataSources( &cursor.
pCursor, condition, selector, orderBy, hint ) ;
8869 INT32 createRole(
const bson::BSONObj &role )
8873 return SDB_NOT_CONNECTED ;
8875 return pSDB->createRole( role ) ;
8884 INT32 dropRole(
const CHAR *pRoleName )
8888 return SDB_NOT_CONNECTED ;
8890 return pSDB->dropRole( pRoleName ) ;
8906 INT32 getRole(
const CHAR *pRoleName,
8907 const bson::BSONObj &options,
8908 bson::BSONObj &role )
8912 return SDB_NOT_CONNECTED ;
8914 return pSDB->getRole( pRoleName, options, role ) ;
8929 INT32 listRoles(
sdbCursor &cursor,
const bson::BSONObj &options )
8933 return SDB_NOT_CONNECTED ;
8936 return pSDB->listRoles( &cursor.
pCursor, options ) ;
8947 INT32 updateRole(
const CHAR *pRoleName,
8948 const bson::BSONObj &role )
8952 return SDB_NOT_CONNECTED ;
8954 return pSDB->updateRole( pRoleName, role ) ;
8965 INT32 grantPrivilegesToRole(
const CHAR *pRoleName,
8966 const bson::BSONObj &privileges )
8970 return SDB_NOT_CONNECTED ;
8972 return pSDB->grantPrivilegesToRole( pRoleName, privileges ) ;
8983 INT32 revokePrivilegesFromRole(
const CHAR *pRoleName,
8984 const bson::BSONObj &privileges )
8988 return SDB_NOT_CONNECTED ;
8990 return pSDB->revokePrivilegesFromRole( pRoleName, privileges ) ;
9001 INT32 grantRolesToRole(
const CHAR *pRoleName,
9002 const bson::BSONObj &roles )
9006 return SDB_NOT_CONNECTED ;
9008 return pSDB->grantRolesToRole( pRoleName, roles ) ;
9019 INT32 revokeRolesFromRole(
const CHAR *pRoleName,
9020 const bson::BSONObj &roles )
9024 return SDB_NOT_CONNECTED ;
9026 return pSDB->revokeRolesFromRole( pRoleName, roles ) ;
9037 INT32 grantRolesToUser(
const CHAR *pUserName,
9038 const bson::BSONObj &privileges )
9042 return SDB_NOT_CONNECTED ;
9044 return pSDB->grantRolesToUser( pUserName, privileges ) ;
9055 INT32 revokeRolesFromUser(
const CHAR *pUserName,
9056 const bson::BSONObj &privileges )
9060 return SDB_NOT_CONNECTED ;
9062 return pSDB->revokeRolesFromUser( pUserName, privileges ) ;
9076 INT32 getUser(
const CHAR *pRoleName,
9077 const bson::BSONObj &options,
9078 bson::BSONObj &role )
9082 return SDB_NOT_CONNECTED ;
9084 return pSDB->getUser( pRoleName, options, role ) ;
9102 INT32 invalidateUserCache(
const CHAR *pUserName = NULL,
9103 const bson::BSONObj &options = _sdbStaticObject )
9107 return SDB_NOT_CONNECTED ;
9109 return pSDB->invalidateUserCache( pUserName, options ) ;
9130 INT32 invalidateFsCache(
const bson::BSONObj &options = _sdbStaticObject,
9131 const CHAR *pExpiredTime = NULL )
9135 return SDB_NOT_CONNECTED ;
9137 return pSDB->invalidateFsCache( options, pExpiredTime ) ;
9143 void enableClientQueryID()
9147 pSDB->enableClientQueryID() ;
9158 pSDB->incQueryID() ;
9166 UINT32 getQueryIDStr( CHAR *pStr, UINT32 strlen )
9170 return pSDB->getQueryIDStr( pStr, strlen ) ;