28 #if defined (SDB_ENGINE) || defined (SDB_CLIENT)
29 #include "../bson/bson.h"
30 #include "../util/fromjson.hpp"
32 #include "bson/bson.hpp"
33 #include "fromjson.hpp"
41 #define RELEASE_INNER_HANDLE( handle ) \
51 #define DLLEXPORT SDB_EXPORT
54 #define SDB_PAGESIZE_4K 4096
56 #define SDB_PAGESIZE_8K 8192
58 #define SDB_PAGESIZE_16K 16384
60 #define SDB_PAGESIZE_32K 32768
62 #define SDB_PAGESIZE_64K 65536
64 #define SDB_PAGESIZE_DEFAULT 0
68 #define FLG_INSERT_CONTONDUP 0x00000001
70 #define FLG_INSERT_RETURNNUM 0x00000002
72 #define FLG_INSERT_REPLACEONDUP 0x00000004
74 #define FLG_INSERT_UPDATEONDUP 0x00000008
78 #define FLG_INSERT_CONTONDUP_ID 0x00000020
81 #define FLG_INSERT_REPLACEONDUP_ID 0x00000040
83 #define FLG_INSERT_RETURN_OID 0x10000000
90 #define SDB_CLIENT_SOCKET_TIMEOUT_DFT 10000
93 #define sdbReplicaNode sdbNode
96 #define QUERY_FORCE_HINT 0x00000080
98 #define QUERY_PARALLED 0x00000100
100 #define QUERY_WITH_RETURNDATA 0x00000200
102 #define QUERY_PREPARE_MORE 0x00004000
104 #define QUERY_KEEP_SHARDINGKEY_IN_UPDATE 0x00008000
110 #define QUERY_FOR_UPDATE 0x00010000
113 #define UPDATE_KEEP_SHARDINGKEY QUERY_KEEP_SHARDINGKEY_IN_UPDATE
115 #define UPDATE_ONE 0x00000002
117 #define UPDATE_RETURNNUM 0x00000004
120 #define FLG_DELETE_ONE 0x00000002
122 #define FLG_DELETE_RETURNNUM 0x00000004
124 #define SDB_INDEX_SORT_BUFFER_DEFAULT_SIZE 64
154 const static bson::BSONObj _sdbStaticObject ;
155 const static bson::OID _sdbStaticOid ;
156 const static std::vector<INT32> _sdbStaticVec ;
157 const static std::vector<UINT32> _sdbStaticUINT32Vec ;
159 class _sdbCollection ;
170 const CHAR *pDescription,
171 const CHAR *pDetail ) ;
179 class DLLEXPORT _sdbCursor
182 _sdbCursor (
const _sdbCursor& other ) ;
183 _sdbCursor& operator=(
const _sdbCursor& ) ;
186 virtual ~_sdbCursor () {}
187 virtual INT32 next ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE ) = 0 ;
188 virtual INT32 current ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE ) = 0 ;
189 virtual INT32 close () = 0 ;
190 virtual INT32 advance (
const bson::BSONObj &option,
191 bson::BSONObj *pResult = NULL ) = 0 ;
246 INT32 next ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE )
250 return SDB_NOT_CONNECTED ;
252 return pCursor->
next ( obj, getOwned ) ;
271 INT32 current ( bson::BSONObj &obj, BOOLEAN getOwned = TRUE )
275 return SDB_NOT_CONNECTED ;
277 return pCursor->current ( obj, getOwned ) ;
287 INT32 advance (
const bson::BSONObj &option, bson::BSONObj *pResult = NULL )
291 return SDB_NOT_CONNECTED ;
293 return pCursor->advance( option, pResult ) ;
307 return pCursor->close () ;
311 class DLLEXPORT _sdbCollection
314 _sdbCollection (
const _sdbCollection& other ) ;
315 _sdbCollection& operator=(
const _sdbCollection& ) ;
318 virtual ~_sdbCollection () {}
321 virtual INT32 getCount ( SINT64 &count,
322 const bson::BSONObj &condition = _sdbStaticObject,
323 const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
328 virtual INT32 insert (
const bson::BSONObj &obj, bson::OID *
id = NULL ) = 0 ;
329 virtual INT32 insert (
const bson::BSONObj &obj,
331 bson::BSONObj *pResult = NULL ) = 0 ;
332 virtual INT32 insert (
const bson::BSONObj &obj,
333 const bson::BSONObj &hint,
335 bson::BSONObj *pResult = NULL ) = 0 ;
336 virtual INT32 insert ( std::vector<bson::BSONObj> &objs,
338 bson::BSONObj *pResult = NULL ) = 0 ;
339 virtual INT32 insert ( std::vector<bson::BSONObj> &objs,
340 const bson::BSONObj &hint,
342 bson::BSONObj *pResult = NULL ) = 0 ;
343 virtual INT32 insert (
const bson::BSONObj objs[],
346 bson::BSONObj *pResult = NULL ) = 0 ;
347 virtual INT32 bulkInsert ( SINT32 flags,
348 std::vector<bson::BSONObj> &obj
357 virtual INT32 update (
const bson::BSONObj &rule,
358 const bson::BSONObj &condition = _sdbStaticObject,
359 const bson::BSONObj &hint = _sdbStaticObject,
361 bson::BSONObj *pResult = NULL
373 virtual INT32 upsert (
const bson::BSONObj &rule,
374 const bson::BSONObj &condition = _sdbStaticObject,
375 const bson::BSONObj &hint = _sdbStaticObject,
376 const bson::BSONObj &setOnInsert = _sdbStaticObject,
378 bson::BSONObj *pResult = NULL
387 virtual INT32 del (
const bson::BSONObj &condition = _sdbStaticObject,
388 const bson::BSONObj &hint = _sdbStaticObject,
390 bson::BSONObj *pResult = NULL
400 virtual INT32 query ( _sdbCursor **cursor,
401 const bson::BSONObj &condition = _sdbStaticObject,
402 const bson::BSONObj &selected = _sdbStaticObject,
403 const bson::BSONObj &orderBy = _sdbStaticObject,
404 const bson::BSONObj &hint = _sdbStaticObject,
406 INT64 numToReturn = -1,
410 virtual INT32 query ( sdbCursor &cursor,
411 const bson::BSONObj &condition = _sdbStaticObject,
412 const bson::BSONObj &selected = _sdbStaticObject,
413 const bson::BSONObj &orderBy = _sdbStaticObject,
414 const bson::BSONObj &hint = _sdbStaticObject,
416 INT64 numToReturn = -1,
420 virtual INT32 queryOne( bson::BSONObj &obj,
421 const bson::BSONObj &condition = _sdbStaticObject,
422 const bson::BSONObj &selected = _sdbStaticObject,
423 const bson::BSONObj &orderBy = _sdbStaticObject,
424 const bson::BSONObj &hint = _sdbStaticObject,
426 INT32 flags = 0 ) = 0 ;
438 virtual INT32 queryAndUpdate ( _sdbCursor **cursor,
439 const bson::BSONObj &update,
440 const bson::BSONObj &condition = _sdbStaticObject,
441 const bson::BSONObj &selected = _sdbStaticObject,
442 const bson::BSONObj &orderBy = _sdbStaticObject,
443 const bson::BSONObj &hint = _sdbStaticObject,
445 INT64 numToReturn = -1,
447 BOOLEAN returnNew = FALSE
458 virtual INT32 queryAndRemove ( _sdbCursor **cursor,
459 const bson::BSONObj &condition = _sdbStaticObject,
460 const bson::BSONObj &selected = _sdbStaticObject,
461 const bson::BSONObj &orderBy = _sdbStaticObject,
462 const bson::BSONObj &hint = _sdbStaticObject,
464 INT64 numToReturn = -1,
475 virtual INT32 createIndex (
const bson::BSONObj &indexDef,
479 INT32 sortBufferSize ) = 0 ;
480 virtual INT32 createIndex (
const bson::BSONObj &indexDef,
482 const bson::BSONObj &options ) = 0 ;
483 virtual INT32 getIndexes ( _sdbCursor **cursor,
484 const CHAR *pName ) = 0 ;
485 virtual INT32 getIndexes ( sdbCursor &cursor,
486 const CHAR *pIndexName ) = 0 ;
487 virtual INT32 getIndexes ( std::vector<bson::BSONObj> &infos ) = 0 ;
488 virtual INT32 getIndex (
const CHAR *pIndexName, bson::BSONObj &info ) = 0 ;
489 virtual INT32 dropIndex (
const CHAR *pIndexName ) = 0 ;
490 virtual INT32 create () = 0 ;
491 virtual INT32 drop () = 0 ;
492 virtual const CHAR *getCollectionName () = 0 ;
493 virtual const CHAR *getCSName () = 0 ;
494 virtual const CHAR *getFullName () = 0 ;
495 virtual INT32 split (
const CHAR *pSourceGroupName,
496 const CHAR *pTargetGroupName,
497 const bson::BSONObj &splitConditon,
498 const bson::BSONObj &splitEndCondition = _sdbStaticObject) = 0 ;
499 virtual INT32 split (
const CHAR *pSourceGroupName,
500 const CHAR *pTargetGroupName,
501 FLOAT64 percent ) = 0 ;
502 virtual INT32 splitAsync ( SINT64 &taskID,
503 const CHAR *pSourceGroupName,
504 const CHAR *pTargetGroupName,
505 const bson::BSONObj &splitCondition,
506 const bson::BSONObj &splitEndCondition = _sdbStaticObject) = 0 ;
507 virtual INT32 splitAsync (
const CHAR *pSourceGroupName,
508 const CHAR *pTargetGroupName,
510 SINT64 &taskID ) = 0 ;
511 virtual INT32 aggregate ( _sdbCursor **cursor,
512 std::vector<bson::BSONObj> &obj
514 virtual INT32 aggregate ( sdbCursor &cursor,
515 std::vector<bson::BSONObj> &obj
517 virtual INT32 getQueryMeta ( _sdbCursor **cursor,
518 const bson::BSONObj &condition = _sdbStaticObject,
519 const bson::BSONObj &orderBy = _sdbStaticObject,
520 const bson::BSONObj &hint = _sdbStaticObject,
522 INT64 numToReturn = -1
524 virtual INT32 getQueryMeta ( sdbCursor &cursor,
525 const bson::BSONObj &condition = _sdbStaticObject,
526 const bson::BSONObj &orderBy = _sdbStaticObject,
527 const bson::BSONObj &hint = _sdbStaticObject,
529 INT64 numToReturn = -1
531 virtual INT32 attachCollection (
const CHAR *subClFullName,
532 const bson::BSONObj &options) = 0 ;
533 virtual INT32 detachCollection (
const CHAR *subClFullName) = 0 ;
535 virtual INT32 alterCollection (
const bson::BSONObj &options ) = 0 ;
537 virtual INT32 explain ( sdbCursor &cursor,
538 const bson::BSONObj &condition = _sdbStaticObject,
539 const bson::BSONObj &select = _sdbStaticObject,
540 const bson::BSONObj &orderBy = _sdbStaticObject,
541 const bson::BSONObj &hint = _sdbStaticObject,
543 INT64 numToReturn = -1,
545 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
547 virtual INT32 explain ( _sdbCursor **cursor,
548 const bson::BSONObj &condition = _sdbStaticObject,
549 const bson::BSONObj &select = _sdbStaticObject,
550 const bson::BSONObj &orderBy = _sdbStaticObject,
551 const bson::BSONObj &hint = _sdbStaticObject,
553 INT64 numToReturn = -1,
555 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
557 virtual INT32 createLob( sdbLob &lob,
const bson::OID *oid = NULL ) = 0 ;
559 virtual INT32 removeLob(
const bson::OID &oid ) = 0 ;
561 virtual INT32 truncateLob(
const bson::OID &oid, INT64 length ) = 0 ;
563 virtual INT32 openLob( sdbLob &lob,
const bson::OID &oid,
566 virtual INT32 openLob( sdbLob &lob,
const bson::OID &oid,
569 virtual INT32 listLobs( sdbCursor &cursor,
570 const bson::BSONObj &condition = _sdbStaticObject,
571 const bson::BSONObj &selected = _sdbStaticObject,
572 const bson::BSONObj &orderBy = _sdbStaticObject,
573 const bson::BSONObj &hint = _sdbStaticObject,
575 INT64 numToReturn = -1 ) = 0 ;
577 virtual INT32 listLobs( _sdbCursor **cursor,
578 const bson::BSONObj &condition = _sdbStaticObject,
579 const bson::BSONObj &selected = _sdbStaticObject,
580 const bson::BSONObj &orderBy = _sdbStaticObject,
581 const bson::BSONObj &hint = _sdbStaticObject,
583 INT64 numToReturn = -1 ) = 0 ;
585 virtual INT32 createLobID( bson::OID &oid,
const CHAR *pTimeStamp = NULL ) = 0 ;
587 virtual INT32 listLobPieces(
589 const bson::BSONObj &condition = _sdbStaticObject,
590 const bson::BSONObj &selected = _sdbStaticObject,
591 const bson::BSONObj &orderBy = _sdbStaticObject,
592 const bson::BSONObj &hint = _sdbStaticObject,
594 INT64 numToReturn = -1 ) = 0 ;
596 virtual INT32 listLobPieces(
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 ;
606 virtual INT32 truncate() = 0 ;
609 virtual INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
611 virtual INT32 dropIdIndex() = 0 ;
613 virtual INT32 createAutoIncrement(
const bson::BSONObj &options ) = 0;
615 virtual INT32 createAutoIncrement(
const std::vector<bson::BSONObj> &options ) = 0;
617 virtual INT32 dropAutoIncrement(
const CHAR *fieldName ) = 0;
619 virtual INT32 dropAutoIncrement(
const std::vector<const CHAR*> &fieldNames ) = 0;
621 virtual INT32 dropAutoIncrement(
const std::vector<string> &fieldNames ) = 0 ;
623 virtual INT32 pop (
const bson::BSONObj &option = _sdbStaticObject ) = 0 ;
625 virtual INT32 enableSharding (
const bson::BSONObj &options ) = 0 ;
627 virtual INT32 disableSharding () = 0 ;
629 virtual INT32 enableCompression (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
631 virtual INT32 disableCompression () = 0 ;
633 virtual INT32 setAttributes (
const bson::BSONObj &options ) = 0 ;
635 virtual INT32 getDetail ( _sdbCursor **cursor ) = 0 ;
637 virtual INT32 getDetail ( sdbCursor &cursor ) = 0 ;
639 virtual INT32 getIndexStat (
const CHAR *pIndexName,
640 bson::BSONObj &result,
641 BOOLEAN detail = FALSE ) = 0 ;
643 virtual void setVersion( INT32 clVersion ) = 0;
644 virtual INT32 getVersion() = 0;
706 INT32 getCount ( SINT64 &count,
707 const bson::BSONObj &condition = _sdbStaticObject,
708 const bson::BSONObj &hint = _sdbStaticObject )
712 return SDB_NOT_CONNECTED ;
714 return pCollection->
getCount ( count, condition, hint ) ;
734 INT32 split (
const CHAR *pSourceGroupName,
735 const CHAR *pTargetGroupName,
736 const bson::BSONObj &splitCondition,
737 const bson::BSONObj &splitEndCondition = _sdbStaticObject)
741 return SDB_NOT_CONNECTED ;
743 return pCollection->split ( pSourceGroupName,
760 INT32 split (
const CHAR *pSourceGroupName,
761 const CHAR *pTargetGroupName,
766 return SDB_NOT_CONNECTED ;
768 return pCollection->split ( pSourceGroupName,
792 INT32 splitAsync ( SINT64 &taskID,
793 const CHAR *pSourceGroupName,
794 const CHAR *pTargetGroupName,
795 const bson::BSONObj &splitCondition,
796 const bson::BSONObj &splitEndCondition = _sdbStaticObject )
800 return SDB_NOT_CONNECTED ;
802 return pCollection->splitAsync ( taskID,
806 splitEndCondition ) ;
822 INT32 splitAsync (
const CHAR *pSourceGroupName,
823 const CHAR *pTargetGroupName,
829 return SDB_NOT_CONNECTED ;
831 return pCollection->splitAsync ( pSourceGroupName,
863 INT32 alterCollection (
const bson::BSONObj &options )
867 return SDB_NOT_CONNECTED ;
869 return pCollection->alterCollection ( options ) ;
894 INT32 insert (
const bson::BSONObj &obj, bson::OID *pId = NULL )
898 return SDB_NOT_CONNECTED ;
900 return pCollection->insert ( obj, pId ) ;
949 INT32 insert (
const bson::BSONObj &obj,
951 bson::BSONObj *pResult = NULL )
955 return SDB_NOT_CONNECTED ;
957 return pCollection->insert ( obj, flags, pResult ) ;
1016 INT32 insert (
const bson::BSONObj &obj,
1017 const bson::BSONObj &hint,
1019 bson::BSONObj *pResult = NULL )
1023 return SDB_NOT_CONNECTED ;
1025 return pCollection->insert ( obj, hint, flags, pResult ) ;
1077 INT32 insert ( std::vector<bson::BSONObj> &objs,
1079 bson::BSONObj *pResult = NULL )
1083 return SDB_NOT_CONNECTED ;
1085 return pCollection->insert( objs, flags, pResult ) ;
1142 INT32 insert ( std::vector<bson::BSONObj> &objs,
1143 const bson::BSONObj &hint,
1145 bson::BSONObj *pResult = NULL )
1149 return SDB_NOT_CONNECTED ;
1151 return pCollection->insert( objs, hint, flags, pResult ) ;
1205 INT32 insert (
const bson::BSONObj objs[],
1208 bson::BSONObj *pResult = NULL )
1212 return SDB_NOT_CONNECTED ;
1214 return pCollection->insert ( objs, size, flags, pResult ) ;
1244 INT32 bulkInsert ( SINT32 flags,
1245 std::vector<bson::BSONObj> &objs )
1249 return SDB_NOT_CONNECTED ;
1251 return pCollection->bulkInsert ( flags, objs ) ;
1286 INT32 update (
const bson::BSONObj &rule,
1287 const bson::BSONObj &condition = _sdbStaticObject,
1288 const bson::BSONObj &hint = _sdbStaticObject,
1290 bson::BSONObj *pResult = NULL
1295 return SDB_NOT_CONNECTED ;
1297 return pCollection->update ( rule, condition, hint, flag, pResult ) ;
1333 INT32 upsert (
const bson::BSONObj &rule,
1334 const bson::BSONObj &condition = _sdbStaticObject,
1335 const bson::BSONObj &hint = _sdbStaticObject,
1336 const bson::BSONObj &setOnInsert = _sdbStaticObject,
1338 bson::BSONObj *pResult = NULL
1343 return SDB_NOT_CONNECTED ;
1345 return pCollection->upsert ( rule, condition, hint, setOnInsert,
1370 INT32 del (
const bson::BSONObj &condition = _sdbStaticObject,
1371 const bson::BSONObj &hint = _sdbStaticObject,
1373 bson::BSONObj *pResult = NULL
1378 return SDB_NOT_CONNECTED ;
1380 return pCollection->del ( condition, hint, flag, pResult ) ;
1413 INT32 query ( _sdbCursor **cursor,
1414 const bson::BSONObj &condition = _sdbStaticObject,
1415 const bson::BSONObj &selected = _sdbStaticObject,
1416 const bson::BSONObj &orderBy = _sdbStaticObject,
1417 const bson::BSONObj &hint = _sdbStaticObject,
1418 INT64 numToSkip = 0,
1419 INT64 numToReturn = -1,
1425 return SDB_NOT_CONNECTED ;
1427 return pCollection->query ( cursor, condition, selected, orderBy,
1428 hint, numToSkip, numToReturn, flags ) ;
1462 const bson::BSONObj &condition = _sdbStaticObject,
1463 const bson::BSONObj &selected = _sdbStaticObject,
1464 const bson::BSONObj &orderBy = _sdbStaticObject,
1465 const bson::BSONObj &hint = _sdbStaticObject,
1466 INT64 numToSkip = 0,
1467 INT64 numToReturn = -1,
1473 return SDB_NOT_CONNECTED ;
1476 return pCollection->query ( cursor, condition, selected, orderBy,
1477 hint, numToSkip, numToReturn, flags ) ;
1508 INT32 queryOne( bson::BSONObj &obj,
1509 const bson::BSONObj &condition = _sdbStaticObject,
1510 const bson::BSONObj &selected = _sdbStaticObject,
1511 const bson::BSONObj &orderBy = _sdbStaticObject,
1512 const bson::BSONObj &hint = _sdbStaticObject,
1513 INT64 numToSkip = 0,
1518 return SDB_NOT_CONNECTED ;
1520 return pCollection->queryOne( obj, condition, selected, orderBy,
1521 hint, numToSkip, flag ) ;
1560 const bson::BSONObj &update,
1561 const bson::BSONObj &condition = _sdbStaticObject,
1562 const bson::BSONObj &selected = _sdbStaticObject,
1563 const bson::BSONObj &orderBy = _sdbStaticObject,
1564 const bson::BSONObj &hint = _sdbStaticObject,
1565 INT64 numToSkip = 0,
1566 INT64 numToReturn = -1,
1568 BOOLEAN returnNew = FALSE
1573 return SDB_NOT_CONNECTED ;
1576 return pCollection->queryAndUpdate( &cursor.
pCursor , update, condition,
1577 selected, orderBy, hint,
1578 numToSkip, numToReturn, flag, returnNew ) ;
1612 const bson::BSONObj &condition = _sdbStaticObject,
1613 const bson::BSONObj &selected = _sdbStaticObject,
1614 const bson::BSONObj &orderBy = _sdbStaticObject,
1615 const bson::BSONObj &hint = _sdbStaticObject,
1616 INT64 numToSkip = 0,
1617 INT64 numToReturn = -1,
1623 return SDB_NOT_CONNECTED ;
1626 return pCollection->queryAndRemove( &cursor.
pCursor , condition,
1627 selected, orderBy, hint,
1628 numToSkip, numToReturn, flag ) ;
1647 INT32 createIndex (
const bson::BSONObj &indexDef,
1648 const CHAR *pIndexName,
1651 INT32 sortBufferSize =
1652 SDB_INDEX_SORT_BUFFER_DEFAULT_SIZE )
1656 return SDB_NOT_CONNECTED ;
1658 return pCollection->createIndex ( indexDef, pIndexName, isUnique,
1659 isEnforced, sortBufferSize ) ;
1680 INT32 createIndex (
const bson::BSONObj &indexDef,
1681 const CHAR *pIndexName,
1682 const bson::BSONObj &options )
1686 return SDB_NOT_CONNECTED ;
1688 return pCollection->createIndex ( indexDef, pIndexName, options ) ;
1699 INT32 getIndexes ( _sdbCursor **cursor,
1700 const CHAR *pIndexName )
1704 return SDB_NOT_CONNECTED ;
1706 return pCollection->getIndexes ( cursor, pIndexName ) ;
1719 const CHAR *pIndexName )
1723 return SDB_NOT_CONNECTED ;
1726 return pCollection->getIndexes ( cursor, pIndexName ) ;
1735 INT32 getIndexes ( std::vector<bson::BSONObj> &infos )
1739 return SDB_NOT_CONNECTED ;
1741 return pCollection->getIndexes ( infos ) ;
1751 INT32 getIndex (
const CHAR *pIndexName, bson::BSONObj &info )
1755 return SDB_NOT_CONNECTED ;
1757 return pCollection->getIndex ( pIndexName, info ) ;
1766 INT32 dropIndex (
const CHAR *pIndexName )
1770 return SDB_NOT_CONNECTED ;
1772 return pCollection->dropIndex ( pIndexName ) ;
1785 return SDB_NOT_CONNECTED ;
1787 return pCollection->create () ;
1800 return SDB_NOT_CONNECTED ;
1802 return pCollection->drop () ;
1809 const CHAR *getCollectionName ()
1815 return pCollection->getCollectionName () ;
1822 const CHAR *getCSName ()
1828 return pCollection->getCSName () ;
1835 const CHAR *getFullName ()
1841 return pCollection->getFullName () ;
1853 INT32 aggregate ( _sdbCursor **cursor,
1854 std::vector<bson::BSONObj> &obj
1859 return SDB_NOT_CONNECTED ;
1861 return pCollection->aggregate ( cursor, obj ) ;
1874 std::vector<bson::BSONObj> &obj
1879 return SDB_NOT_CONNECTED ;
1882 return pCollection->aggregate ( cursor, obj ) ;
1904 INT32 getQueryMeta ( _sdbCursor **cursor,
1905 const bson::BSONObj &condition = _sdbStaticObject,
1906 const bson::BSONObj &orderBy = _sdbStaticObject,
1907 const bson::BSONObj &hint = _sdbStaticObject,
1908 INT64 numToSkip = 0,
1909 INT64 numToReturn = -1 )
1913 return SDB_NOT_CONNECTED ;
1915 return pCollection->getQueryMeta ( cursor, condition, orderBy,
1916 hint, numToSkip, numToReturn ) ;
1940 const bson::BSONObj &condition = _sdbStaticObject,
1941 const bson::BSONObj &orderBy = _sdbStaticObject,
1942 const bson::BSONObj &hint = _sdbStaticObject,
1943 INT64 numToSkip = 0,
1944 INT64 numToReturn = -1 )
1948 return SDB_NOT_CONNECTED ;
1951 return pCollection->getQueryMeta ( cursor, condition, orderBy,
1952 hint, numToSkip, numToReturn ) ;
1968 INT32 attachCollection (
const CHAR *subClFullName,
1969 const bson::BSONObj &options)
1973 return SDB_NOT_CONNECTED ;
1975 return pCollection->attachCollection ( subClFullName, options ) ;
1984 INT32 detachCollection (
const CHAR *subClFullName)
1988 return SDB_NOT_CONNECTED ;
1990 return pCollection->detachCollection ( subClFullName ) ;
2029 const bson::BSONObj &condition = _sdbStaticObject,
2030 const bson::BSONObj &select = _sdbStaticObject,
2031 const bson::BSONObj &orderBy = _sdbStaticObject,
2032 const bson::BSONObj &hint = _sdbStaticObject,
2033 INT64 numToSkip = 0,
2034 INT64 numToReturn = -1,
2036 const bson::BSONObj &options = _sdbStaticObject )
2040 return SDB_NOT_CONNECTED ;
2043 return pCollection->explain( cursor, condition, select, orderBy, hint,
2044 numToSkip, numToReturn, flag, options ) ;
2047 INT32 explain ( _sdbCursor **cursor,
2048 const bson::BSONObj &condition = _sdbStaticObject,
2049 const bson::BSONObj &select = _sdbStaticObject,
2050 const bson::BSONObj &orderBy = _sdbStaticObject,
2051 const bson::BSONObj &hint = _sdbStaticObject,
2052 INT64 numToSkip = 0,
2053 INT64 numToReturn = -1,
2055 const bson::BSONObj &options = _sdbStaticObject )
2059 return SDB_NOT_CONNECTED ;
2061 return pCollection->explain( cursor, condition, select, orderBy, hint,
2062 numToSkip, numToReturn, flag, options ) ;
2073 INT32 createLob(
sdbLob &lob,
const bson::OID *oid = NULL )
2077 return SDB_NOT_CONNECTED ;
2079 return pCollection->createLob( lob, oid ) ;
2088 INT32 removeLob(
const bson::OID &oid )
2092 return SDB_NOT_CONNECTED ;
2094 return pCollection->removeLob( oid ) ;
2104 INT32 truncateLob(
const bson::OID &oid, INT64 length )
2108 return SDB_NOT_CONNECTED ;
2110 return pCollection->truncateLob( oid, length ) ;
2122 INT32 openLob(
sdbLob &lob,
const bson::OID &oid,
2127 return SDB_NOT_CONNECTED ;
2129 return pCollection->openLob( lob, oid, mode ) ;
2141 INT32 openLob(
sdbLob &lob,
const bson::OID &oid, INT32 mode )
2145 return SDB_NOT_CONNECTED ;
2147 return pCollection->openLob( lob, oid, mode ) ;
2168 const bson::BSONObj &condition = _sdbStaticObject,
2169 const bson::BSONObj &selected = _sdbStaticObject,
2170 const bson::BSONObj &orderBy = _sdbStaticObject,
2171 const bson::BSONObj &hint = _sdbStaticObject,
2172 INT64 numToSkip = 0,
2173 INT64 numToReturn = -1 )
2177 return SDB_NOT_CONNECTED ;
2180 return pCollection->listLobs( cursor, condition, selected, orderBy,
2181 hint, numToSkip, numToReturn ) ;
2184 INT32 listLobs( _sdbCursor **cursor,
2185 const bson::BSONObj &condition = _sdbStaticObject,
2186 const bson::BSONObj &selected = _sdbStaticObject,
2187 const bson::BSONObj &orderBy = _sdbStaticObject,
2188 const bson::BSONObj &hint = _sdbStaticObject,
2189 INT64 numToSkip = 0,
2190 INT64 numToReturn = -1 )
2194 return SDB_NOT_CONNECTED ;
2196 return pCollection->listLobs( cursor, condition, selected, orderBy,
2197 hint, numToSkip, numToReturn ) ;
2208 INT32 createLobID( bson::OID &oid,
const CHAR *pTimeStamp = NULL )
2212 return SDB_NOT_CONNECTED ;
2214 return pCollection->createLobID( oid, pTimeStamp ) ;
2226 return SDB_NOT_CONNECTED ;
2228 return pCollection->truncate() ;
2240 INT32 createIdIndex(
const bson::BSONObj &options = _sdbStaticObject )
2244 return SDB_NOT_CONNECTED ;
2246 return pCollection->createIdIndex( options ) ;
2259 return SDB_NOT_CONNECTED ;
2261 return pCollection->dropIdIndex() ;
2281 INT32 createAutoIncrement (
const bson::BSONObj &options )
2285 return SDB_NOT_CONNECTED ;
2287 return pCollection->createAutoIncrement( options ) ;
2296 INT32 createAutoIncrement (
const std::vector<bson::BSONObj> &options )
2300 return SDB_NOT_CONNECTED ;
2302 return pCollection->createAutoIncrement( options ) ;
2311 INT32 dropAutoIncrement (
const CHAR * fieldName )
2315 return SDB_NOT_CONNECTED ;
2317 return pCollection->dropAutoIncrement( fieldName ) ;
2326 INT32 dropAutoIncrement (
const std::vector<const CHAR*> &fieldNames )
2330 return SDB_NOT_CONNECTED ;
2332 return pCollection->dropAutoIncrement( fieldNames ) ;
2341 INT32 dropAutoIncrement(
const std::vector<string> &fieldNames )
2345 return SDB_NOT_CONNECTED ;
2347 return pCollection->dropAutoIncrement( fieldNames ) ;
2363 INT32 enableSharding (
const bson::BSONObj & options = _sdbStaticObject )
2367 return SDB_NOT_CONNECTED ;
2369 return pCollection->enableSharding( options ) ;
2377 INT32 disableSharding ()
2381 return SDB_NOT_CONNECTED ;
2383 return pCollection->disableSharding() ;
2394 INT32 enableCompression (
const bson::BSONObj & options = _sdbStaticObject )
2398 return SDB_NOT_CONNECTED ;
2400 return pCollection->enableCompression( options ) ;
2408 INT32 disableCompression ()
2412 return SDB_NOT_CONNECTED ;
2414 return pCollection->disableCompression() ;
2437 INT32 setAttributes (
const bson::BSONObj &options )
2441 return SDB_NOT_CONNECTED ;
2443 return pCollection->setAttributes( options ) ;
2455 INT32 pop (
const bson::BSONObj &option = _sdbStaticObject )
2459 return SDB_NOT_CONNECTED ;
2461 return pCollection->pop( option ) ;
2464 INT32 listLobPieces( _sdbCursor **cursor,
2465 const bson::BSONObj &condition = _sdbStaticObject,
2466 const bson::BSONObj &selected = _sdbStaticObject,
2467 const bson::BSONObj &orderBy = _sdbStaticObject,
2468 const bson::BSONObj &hint = _sdbStaticObject,
2469 INT64 numToSkip = 0,
2470 INT64 numToReturn = -1 )
2474 return SDB_NOT_CONNECTED ;
2476 return pCollection->listLobPieces( cursor, condition, selected,
2477 orderBy, hint, numToSkip,
2494 INT32 listLobPieces( sdbCursor &cursor,
2495 const bson::BSONObj &condition = _sdbStaticObject,
2496 const bson::BSONObj &selected = _sdbStaticObject,
2497 const bson::BSONObj &orderBy = _sdbStaticObject,
2498 const bson::BSONObj &hint = _sdbStaticObject,
2499 INT64 numToSkip = 0,
2500 INT64 numToReturn = -1 )
2504 return SDB_NOT_CONNECTED ;
2507 return pCollection->listLobPieces( cursor, condition, selected,
2508 orderBy, hint, numToSkip,
2518 INT32 getDetail ( _sdbCursor **cursor )
2522 return SDB_NOT_CONNECTED ;
2524 return pCollection->getDetail ( cursor ) ;
2537 return SDB_NOT_CONNECTED ;
2539 return pCollection->getDetail( cursor ) ;
2551 INT32 getIndexStat(
const CHAR *pIndexName, bson::BSONObj &result,
2552 BOOLEAN detail = FALSE )
2556 return SDB_NOT_CONNECTED ;
2558 return pCollection->getIndexStat( pIndexName, result, detail ) ;
2565 void setVersion( INT32 clVersion )
2567 pCollection->setVersion( clVersion ) ;
2575 return pCollection->getVersion() ;
2595 class DLLEXPORT _sdbNode
2598 _sdbNode (
const _sdbNode& other ) ;
2599 _sdbNode& operator=(
const _sdbNode& ) ;
2602 virtual ~_sdbNode () {}
2604 virtual INT32 connect ( _sdb **dbConn ) = 0 ;
2605 virtual INT32 connect (
sdb &dbConn ) = 0 ;
2611 virtual const CHAR *getHostName () = 0 ;
2614 virtual const CHAR *getServiceName () = 0 ;
2617 virtual const CHAR *getNodeName () = 0 ;
2620 virtual INT32 getNodeID( INT32 &nodeID )
const = 0 ;
2623 virtual INT32 stop () = 0 ;
2626 virtual INT32 start () = 0 ;
2682 INT32 connect ( _sdb **dbConn )
2686 return SDB_NOT_CONNECTED ;
2688 return pNode->connect ( dbConn ) ;
2702 return SDB_NOT_CONNECTED ;
2707 return pNode->connect ( dbConn ) ;
2720 return SDB_NODE_UNKNOWN ;
2722 return pNode->getStatus () ;
2729 const CHAR *getHostName ()
2735 return pNode->getHostName () ;
2742 const CHAR *getServiceName ()
2748 return pNode->getServiceName () ;
2755 const CHAR *getNodeName ()
2761 return pNode->getNodeName () ;
2768 INT32 getNodeID( INT32 &nodeID )
const
2772 return SDB_NOT_CONNECTED ;
2774 return pNode->getNodeID( nodeID ) ;
2786 return SDB_NOT_CONNECTED ;
2788 return pNode->stop () ;
2800 return SDB_NOT_CONNECTED ;
2802 return pNode->start () ;
2814 class DLLEXPORT _sdbReplicaGroup
2817 _sdbReplicaGroup (
const _sdbReplicaGroup& other ) ;
2818 _sdbReplicaGroup& operator=(
const _sdbReplicaGroup& ) ;
2820 _sdbReplicaGroup () {}
2821 virtual ~_sdbReplicaGroup () {}
2823 virtual INT32 getNodeNum (
sdbNodeStatus status, INT32 *num ) = 0 ;
2826 virtual INT32 getDetail ( bson::BSONObj &result ) = 0 ;
2829 virtual INT32 getMaster ( _sdbNode **node ) = 0 ;
2830 virtual INT32 getMaster ( sdbNode &node ) = 0 ;
2833 virtual INT32 getSlave ( _sdbNode **node,
2834 const vector<INT32>& positions = _sdbStaticVec ) = 0 ;
2835 virtual INT32 getSlave ( sdbNode &node,
2836 const vector<INT32>& positions = _sdbStaticVec ) = 0 ;
2839 virtual INT32 getNode (
const CHAR *pNodeName,
2840 _sdbNode **node ) = 0 ;
2841 virtual INT32 getNode (
const CHAR *pNodeName,
2842 sdbNode &node ) = 0 ;
2845 virtual INT32 getNode (
const CHAR *pHostName,
2846 const CHAR *pServiceName,
2847 _sdbNode **node ) = 0 ;
2848 virtual INT32 getNode (
const CHAR *pHostName,
2849 const CHAR *pServiceName,
2850 sdbNode &node ) = 0 ;
2853 virtual INT32 createNode (
const CHAR *pHostName,
2854 const CHAR *pServiceName,
2855 const CHAR *pDatabasePath,
2856 std::map<std::string,std::string> &config )= 0;
2858 virtual INT32 createNode (
const CHAR *pHostName,
2859 const CHAR *pServiceName,
2860 const CHAR *pDatabasePath,
2861 const bson::BSONObj &options = _sdbStaticObject )= 0;
2864 virtual INT32 removeNode (
const CHAR *pHostName,
2865 const CHAR *pServiceName,
2866 const bson::BSONObj &configure = _sdbStaticObject ) = 0 ;
2868 virtual INT32 stop () = 0 ;
2871 virtual INT32 start () = 0 ;
2874 virtual const CHAR *getName () = 0 ;
2877 virtual BOOLEAN isCatalog () = 0 ;
2880 virtual INT32 attachNode(
const CHAR *pHostName,
2881 const CHAR *pSvcName,
2882 const bson::BSONObj &options ) = 0 ;
2885 virtual INT32 detachNode(
const CHAR *pHostName,
2886 const CHAR *pSvcName,
2887 const bson::BSONObj &options ) = 0 ;
2890 virtual INT32 reelect(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
2915 pReplicaGroup = NULL ;
2923 if ( pReplicaGroup )
2925 delete pReplicaGroup ;
2945 if ( !pReplicaGroup )
2947 return SDB_NOT_CONNECTED ;
2949 return pReplicaGroup->
getNodeNum ( status, num ) ;
2958 INT32 getDetail ( bson::BSONObj &result )
2960 if ( !pReplicaGroup )
2962 return SDB_NOT_CONNECTED ;
2964 return pReplicaGroup->getDetail ( result ) ;
2973 INT32 getMaster ( _sdbNode **node )
2975 if ( !pReplicaGroup )
2977 return SDB_NOT_CONNECTED ;
2979 return pReplicaGroup->getMaster ( node ) ;
2990 if ( !pReplicaGroup )
2992 return SDB_NOT_CONNECTED ;
2995 return pReplicaGroup->getMaster ( node ) ;
3006 INT32 getSlave ( _sdbNode **node,
3007 const vector<INT32>& positions = _sdbStaticVec )
3009 if ( !pReplicaGroup )
3011 return SDB_NOT_CONNECTED ;
3013 return pReplicaGroup->getSlave ( node, positions ) ;
3025 const vector<INT32>& positions = _sdbStaticVec )
3027 if ( !pReplicaGroup )
3029 return SDB_NOT_CONNECTED ;
3032 return pReplicaGroup->getSlave ( node, positions ) ;
3043 INT32 getNode (
const CHAR *pNodeName,
3046 if ( !pReplicaGroup )
3048 return SDB_NOT_CONNECTED ;
3050 return pReplicaGroup->getNode ( pNodeName, node ) ;
3061 INT32 getNode (
const CHAR *pNodeName,
3064 if ( !pReplicaGroup )
3066 return SDB_NOT_CONNECTED ;
3069 return pReplicaGroup->getNode ( pNodeName, node ) ;
3072 INT32 getNode (
const CHAR *pHostName,
3073 const CHAR *pServiceName,
3076 if ( !pReplicaGroup )
3078 return SDB_NOT_CONNECTED ;
3080 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
3093 INT32 getNode (
const CHAR *pHostName,
3094 const CHAR *pServiceName,
3097 if ( !pReplicaGroup )
3099 return SDB_NOT_CONNECTED ;
3102 return pReplicaGroup->getNode ( pHostName, pServiceName, node ) ;
3118 INT32 createNode (
const CHAR *pHostName,
3119 const CHAR *pServiceName,
3120 const CHAR *pDatabasePath,
3121 std::map<std::string,std::string> &config )
3123 if ( !pReplicaGroup )
3125 return SDB_NOT_CONNECTED ;
3127 return pReplicaGroup->createNode ( pHostName, pServiceName,
3128 pDatabasePath, config ) ;
3143 INT32 createNode (
const CHAR *pHostName,
3144 const CHAR *pServiceName,
3145 const CHAR *pDatabasePath,
3146 const bson::BSONObj &options = _sdbStaticObject )
3148 if ( !pReplicaGroup )
3150 return SDB_NOT_CONNECTED ;
3152 return pReplicaGroup->createNode ( pHostName, pServiceName,
3153 pDatabasePath, options ) ;
3166 INT32 removeNode (
const CHAR *pHostName,
3167 const CHAR *pServiceName,
3168 const bson::BSONObj &configure = _sdbStaticObject )
3170 if ( !pReplicaGroup )
3172 return SDB_NOT_CONNECTED ;
3174 return pReplicaGroup->removeNode ( pHostName, pServiceName,
3184 if ( !pReplicaGroup )
3186 return SDB_NOT_CONNECTED ;
3188 return pReplicaGroup->stop () ;
3198 if ( !pReplicaGroup )
3200 return SDB_NOT_CONNECTED ;
3202 return pReplicaGroup->start () ;
3209 const CHAR *getName ()
3211 if ( !pReplicaGroup )
3215 return pReplicaGroup->getName() ;
3223 BOOLEAN isCatalog ()
3225 if ( !pReplicaGroup )
3229 return pReplicaGroup->isCatalog() ;
3246 INT32 attachNode(
const CHAR *pHostName,
3247 const CHAR *pSvcName,
3248 const bson::BSONObj &options )
3250 if ( !pReplicaGroup )
3252 return SDB_NOT_CONNECTED ;
3254 return pReplicaGroup->attachNode( pHostName, pSvcName, options ) ;
3272 INT32 detachNode(
const CHAR *pHostName,
3273 const CHAR *pSvcName,
3274 const bson::BSONObj &options )
3276 if ( !pReplicaGroup )
3278 return SDB_NOT_CONNECTED ;
3280 return pReplicaGroup->detachNode( pHostName, pSvcName, options ) ;
3291 INT32 reelect(
const bson::BSONObj &options = _sdbStaticObject )
3293 if( !pReplicaGroup )
3295 return SDB_NOT_CONNECTED ;
3297 return pReplicaGroup->reelect( options ) ;
3301 class DLLEXPORT _sdbCollectionSpace
3304 _sdbCollectionSpace (
const _sdbCollectionSpace& other ) ;
3305 _sdbCollectionSpace& operator=(
const _sdbCollectionSpace& ) ;
3307 _sdbCollectionSpace () {}
3308 virtual ~_sdbCollectionSpace () {}
3310 virtual INT32 getCollection (
const CHAR *pCollectionName,
3311 _sdbCollection **collection,
3312 BOOLEAN checkExist = TRUE ) = 0 ;
3314 virtual INT32 getCollection (
const CHAR *pCollectionName,
3315 sdbCollection &collection,
3316 BOOLEAN checkExist = TRUE ) = 0 ;
3319 virtual INT32 createCollection (
const CHAR *pCollection,
3320 const bson::BSONObj &options,
3321 _sdbCollection **collection ) = 0 ;
3323 virtual INT32 createCollection (
const CHAR *pCollection,
3324 const bson::BSONObj &options,
3325 sdbCollection &collection ) = 0 ;
3328 virtual INT32 createCollection (
const CHAR *pCollection,
3329 _sdbCollection **collection ) = 0 ;
3331 virtual INT32 createCollection (
const CHAR *pCollection,
3332 sdbCollection &collection ) = 0 ;
3335 virtual INT32 dropCollection (
const CHAR *pCollection ) = 0 ;
3337 virtual INT32 listCollections ( _sdbCursor **cursor ) = 0 ;
3339 virtual INT32 listCollections ( sdbCursor &cursor ) = 0 ;
3342 virtual INT32 create () = 0 ;
3344 virtual INT32 drop () = 0 ;
3347 virtual const CHAR *getCSName () = 0 ;
3350 virtual INT32 renameCollection(
const CHAR* oldName,
const CHAR* newName,
3351 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
3353 virtual INT32 alterCollectionSpace (
const bson::BSONObj & options ) = 0 ;
3355 virtual INT32 setDomain (
const bson::BSONObj & options ) = 0 ;
3357 virtual INT32 getDomainName ( CHAR *result, INT32 resultLen ) = 0 ;
3359 virtual INT32 removeDomain () = 0 ;
3361 virtual INT32 enableCapped () = 0 ;
3363 virtual INT32 disableCapped () = 0 ;
3365 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
3399 pCollectionSpace = NULL ;
3407 if ( pCollectionSpace )
3409 delete pCollectionSpace ;
3413 INT32 getCollection (
const CHAR *pCollectionName,
3414 _sdbCollection **collection,
3415 BOOLEAN checkExist = TRUE )
3417 if ( !pCollectionSpace )
3419 return SDB_NOT_CONNECTED ;
3421 return pCollectionSpace->getCollection ( pCollectionName,
3422 collection, checkExist ) ;
3435 INT32 getCollection (
const CHAR *pCollectionName,
3437 BOOLEAN checkExist = TRUE )
3439 if ( !pCollectionSpace )
3441 return SDB_NOT_CONNECTED ;
3444 return pCollectionSpace->getCollection ( pCollectionName,
3449 INT32 createCollection (
const CHAR *pCollection,
3450 const bson::BSONObj &options,
3451 _sdbCollection **collection )
3453 if ( !pCollectionSpace )
3455 return SDB_NOT_CONNECTED ;
3457 return pCollectionSpace->createCollection ( pCollection,
3499 INT32 createCollection (
const CHAR *pCollection,
3500 const bson::BSONObj &options,
3503 if ( !pCollectionSpace )
3505 return SDB_NOT_CONNECTED ;
3508 return pCollectionSpace->createCollection ( pCollection,
3513 INT32 createCollection (
const CHAR *pCollection,
3514 _sdbCollection **collection )
3516 if ( !pCollectionSpace )
3518 return SDB_NOT_CONNECTED ;
3520 return pCollectionSpace->createCollection ( pCollection,
3533 INT32 createCollection (
const CHAR *pCollection,
3536 if ( !pCollectionSpace )
3538 return SDB_NOT_CONNECTED ;
3541 return pCollectionSpace->createCollection ( pCollection,
3551 INT32 dropCollection (
const CHAR *pCollection )
3553 if ( !pCollectionSpace )
3555 return SDB_NOT_CONNECTED ;
3557 return pCollectionSpace->dropCollection ( pCollection ) ;
3566 INT32 listCollections ( _sdbCursor **cursor )
3568 if ( !pCollectionSpace )
3570 return SDB_NOT_CONNECTED ;
3572 return pCollectionSpace->listCollections( cursor ) ;
3583 if ( !pCollectionSpace )
3585 return SDB_NOT_CONNECTED ;
3588 return pCollectionSpace->listCollections( cursor ) ;
3599 if ( !pCollectionSpace )
3601 return SDB_NOT_CONNECTED ;
3603 return pCollectionSpace->create () ;
3614 if ( !pCollectionSpace )
3616 return SDB_NOT_CONNECTED ;
3618 return pCollectionSpace->drop () ;
3625 const CHAR *getCSName ()
3627 if ( !pCollectionSpace )
3631 return pCollectionSpace->getCSName () ;
3644 INT32 renameCollection(
const CHAR* oldName,
const CHAR* newName,
3645 const bson::BSONObj &options = _sdbStaticObject )
3647 if( !pCollectionSpace )
3649 return SDB_NOT_CONNECTED ;
3651 return pCollectionSpace->renameCollection( oldName, newName, options ) ;
3665 INT32 alterCollectionSpace (
const bson::BSONObj & options )
3667 if ( NULL == pCollectionSpace )
3669 return SDB_NOT_CONNECTED ;
3671 return pCollectionSpace->alterCollectionSpace( options ) ;
3683 INT32 setDomain (
const bson::BSONObj & options )
3685 if ( NULL == pCollectionSpace )
3687 return SDB_NOT_CONNECTED ;
3689 return pCollectionSpace->setDomain( options ) ;
3699 INT32 getDomainName ( CHAR *result, INT32 resultLen )
3701 if ( !pCollectionSpace )
3703 return SDB_NOT_CONNECTED ;
3705 return pCollectionSpace->getDomainName( result, resultLen ) ;
3713 INT32 removeDomain ()
3715 if ( NULL == pCollectionSpace )
3717 return SDB_NOT_CONNECTED ;
3719 return pCollectionSpace->removeDomain() ;
3727 INT32 enableCapped ()
3729 if ( NULL == pCollectionSpace )
3731 return SDB_NOT_CONNECTED ;
3733 return pCollectionSpace->enableCapped() ;
3741 INT32 disableCapped ()
3743 if ( NULL == pCollectionSpace )
3745 return SDB_NOT_CONNECTED ;
3747 return pCollectionSpace->disableCapped() ;
3761 INT32 setAttributes (
const bson::BSONObj & options )
3763 if ( NULL == pCollectionSpace )
3765 return SDB_NOT_CONNECTED ;
3767 return pCollectionSpace->setAttributes( options ) ;
3771 class DLLEXPORT _sdbDomain
3774 _sdbDomain (
const _sdbDomain& other ) ;
3775 _sdbDomain& operator= (
const _sdbDomain& ) ;
3778 virtual ~_sdbDomain () {}
3780 virtual const CHAR* getName () = 0 ;
3782 virtual INT32 alterDomain (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
3784 virtual INT32 listCollectionSpacesInDomain ( _sdbCursor **cursor ) = 0 ;
3786 virtual INT32 listCollectionSpacesInDomain ( sdbCursor &cursor ) = 0 ;
3788 virtual INT32 listCollectionsInDomain ( _sdbCursor **cursor ) = 0 ;
3790 virtual INT32 listCollectionsInDomain ( sdbCursor &cursor ) = 0 ;
3792 virtual INT32 listReplicaGroupInDomain( _sdbCursor **cursor ) = 0 ;
3794 virtual INT32 listReplicaGroupInDomain( sdbCursor &cursor ) = 0 ;
3796 virtual INT32 addGroups (
const bson::BSONObj & options ) = 0 ;
3798 virtual INT32 setGroups (
const bson::BSONObj & options ) = 0 ;
3800 virtual INT32 removeGroups (
const bson::BSONObj & options ) = 0 ;
3802 virtual INT32 setAttributes (
const bson::BSONObj & options ) = 0 ;
3843 const CHAR *getName ()
3869 INT32 alterDomain (
const bson::BSONObj &options )
3873 return SDB_NOT_CONNECTED ;
3875 return pDomain->alterDomain ( options ) ;
3888 INT32 addGroups (
const bson::BSONObj & options )
3890 if ( NULL == pDomain )
3892 return SDB_NOT_CONNECTED ;
3894 return pDomain->addGroups( options ) ;
3909 INT32 setGroups (
const bson::BSONObj & options )
3911 if ( NULL == pDomain )
3913 return SDB_NOT_CONNECTED ;
3915 return pDomain->setGroups( options ) ;
3929 INT32 removeGroups (
const bson::BSONObj & options )
3931 if ( NULL == pDomain )
3933 return SDB_NOT_CONNECTED ;
3935 return pDomain->removeGroups( options ) ;
3955 INT32 setAttributes (
const bson::BSONObj &options )
3959 return SDB_NOT_CONNECTED ;
3961 return pDomain->setAttributes( options ) ;
3975 return SDB_NOT_CONNECTED ;
3978 return pDomain->listCollectionSpacesInDomain ( cursor ) ;
3981 INT32 listCollectionSpacesInDomain ( _sdbCursor **cursor )
3985 return SDB_NOT_CONNECTED ;
3987 return pDomain->listCollectionSpacesInDomain ( cursor ) ;
4001 return SDB_NOT_CONNECTED ;
4004 return pDomain->listCollectionsInDomain ( cursor ) ;
4014 INT32 listCollectionsInDomain ( _sdbCursor **cursor )
4018 return SDB_NOT_CONNECTED ;
4020 return pDomain->listCollectionsInDomain ( cursor ) ;
4023 INT32 listReplicaGroupInDomain( _sdbCursor **cursor )
4027 return SDB_NOT_CONNECTED ;
4029 return pDomain->listReplicaGroupInDomain( cursor ) ;
4042 return SDB_NOT_CONNECTED ;
4045 return pDomain->listReplicaGroupInDomain( cursor ) ;
4049 class DLLEXPORT _sdbDataCenter
4052 _sdbDataCenter (
const _sdbDataCenter& other ) ;
4053 _sdbDataCenter& operator= (
const _sdbDataCenter& ) ;
4056 _sdbDataCenter () {}
4057 virtual ~_sdbDataCenter () {}
4060 virtual const CHAR *getName () = 0 ;
4061 virtual INT32 getDetail( bson::BSONObj &retInfo ) = 0 ;
4062 virtual INT32 activateDC() = 0 ;
4063 virtual INT32 deactivateDC() = 0 ;
4064 virtual INT32 enableReadOnly( BOOLEAN isReadOnly ) = 0 ;
4065 virtual INT32 createImage(
const CHAR *pCataAddrList ) = 0 ;
4066 virtual INT32 removeImage() = 0 ;
4067 virtual INT32 enableImage() = 0 ;
4068 virtual INT32 disableImage() = 0 ;
4069 virtual INT32 attachGroups(
const bson::BSONObj &info ) = 0 ;
4070 virtual INT32 detachGroups(
const bson::BSONObj &info ) = 0 ;
4077 class DLLEXPORT sdbDataCenter
4080 sdbDataCenter (
const sdbDataCenter& ) ;
4081 sdbDataCenter& operator= (
const sdbDataCenter& ) ;
4091 _sdbDataCenter *pDC ;
4096 sdbDataCenter() { pDC = NULL ; }
4115 const CHAR *getName ()
4121 return pDC->getName() ;
4130 INT32 getDetail( bson::BSONObj &retInfo )
4134 return SDB_NOT_CONNECTED ;
4136 return pDC->getDetail( retInfo ) ;
4148 return SDB_NOT_CONNECTED ;
4150 return pDC->activateDC() ;
4158 INT32 deactivateDC()
4162 return SDB_NOT_CONNECTED ;
4164 return pDC->deactivateDC() ;
4173 INT32 enableReadOnly( BOOLEAN isReadOnly )
4177 return SDB_NOT_CONNECTED ;
4179 return pDC->enableReadOnly( isReadOnly ) ;
4189 INT32 createImage(
const CHAR *pCataAddrList )
4193 return SDB_NOT_CONNECTED ;
4195 return pDC->createImage( pCataAddrList ) ;
4207 return SDB_NOT_CONNECTED ;
4209 return pDC->removeImage() ;
4221 return SDB_NOT_CONNECTED ;
4223 return pDC->enableImage() ;
4231 INT32 disableImage()
4235 return SDB_NOT_CONNECTED ;
4237 return pDC->disableImage() ;
4246 INT32 attachGroups(
const bson::BSONObj &info )
4250 return SDB_NOT_CONNECTED ;
4252 return pDC->attachGroups( info ) ;
4261 INT32 detachGroups(
const bson::BSONObj &info )
4265 return SDB_NOT_CONNECTED ;
4267 return pDC->detachGroups( info ) ;
4272 class DLLEXPORT _sdbLob
4275 _sdbLob (
const _sdbLob& other ) ;
4276 _sdbLob& operator= (
const _sdbLob& ) ;
4281 virtual ~_sdbLob () {}
4283 virtual INT32 close () = 0 ;
4285 virtual INT32 read ( UINT32 len, CHAR *buf, UINT32 *read ) = 0 ;
4287 virtual INT32 write (
const CHAR *buf, UINT32 len ) = 0 ;
4289 virtual INT32 seek ( SINT64 size,
SDB_LOB_SEEK whence ) = 0 ;
4291 virtual INT32 lock( INT64 offset, INT64 length ) = 0 ;
4293 virtual INT32 lockAndSeek( INT64 offset, INT64 length ) = 0 ;
4295 virtual INT32 isClosed( BOOLEAN &flag ) = 0 ;
4297 virtual INT32 getOid( bson::OID &oid ) = 0 ;
4299 virtual INT32 getSize( SINT64 *size ) = 0 ;
4301 virtual INT32 getCreateTime ( UINT64 *millis ) = 0 ;
4303 virtual BOOLEAN isClosed() = 0 ;
4305 virtual bson::OID getOid() = 0 ;
4307 virtual SINT64 getSize() = 0 ;
4309 virtual UINT64 getCreateTime () = 0 ;
4311 virtual UINT64 getModificationTime() = 0 ;
4313 virtual INT32 getPiecesInfoNum() = 0 ;
4315 virtual bson::BSONArray getPiecesInfo() = 0 ;
4317 virtual BOOLEAN isEof() = 0 ;
4319 virtual INT32 getRunTimeDetail( bson::BSONObj &detail ) = 0 ;
4368 return pLob->
close() ;
4379 INT32 read ( UINT32 len, CHAR *buf, UINT32 *read )
4383 return SDB_NOT_CONNECTED ;
4385 return pLob->read( len, buf, read ) ;
4395 INT32 write (
const CHAR *buf, UINT32 len )
4399 return SDB_NOT_CONNECTED ;
4401 return pLob->write( buf, len ) ;
4415 return SDB_NOT_CONNECTED ;
4417 return pLob->seek( size, whence ) ;
4427 INT32 lock ( INT64 offset, INT64 length )
4431 return SDB_NOT_CONNECTED ;
4433 return pLob->lock( offset, length ) ;
4443 INT32 lockAndSeek ( INT64 offset, INT64 length )
4447 return SDB_NOT_CONNECTED ;
4449 return pLob->lockAndSeek( offset, length ) ;
4459 INT32 isClosed( BOOLEAN &flag )
4463 return SDB_NOT_CONNECTED ;
4465 return pLob->isClosed ( flag ) ;
4478 return pLob->isClosed () ;
4488 INT32 getOid ( bson::OID &oid )
4492 return SDB_NOT_CONNECTED ;
4494 return pLob->getOid( oid ) ;
4507 return pLob->getOid() ;
4517 INT32 getSize ( SINT64 *size )
4521 return SDB_NOT_CONNECTED ;
4523 return pLob->getSize( size ) ;
4536 return pLob->getSize();
4546 INT32 getCreateTime ( UINT64 *millis )
4550 return SDB_NOT_CONNECTED ;
4552 return pLob->getCreateTime( millis ) ;
4559 UINT64 getCreateTime ()
4565 return pLob->getCreateTime() ;
4572 UINT64 getModificationTime ()
4578 return pLob->getModificationTime() ;
4585 INT32 getPiecesInfoNum()
4591 return pLob->getPiecesInfoNum() ;
4598 bson::BSONArray getPiecesInfo()
4602 return bson::BSONArray() ;
4604 return pLob->getPiecesInfo() ;
4617 return pLob->isEof() ;
4625 INT32 getRunTimeDetail( bson::BSONObj &detail )
4631 return pLob->getRunTimeDetail( detail ) ;
4636 class DLLEXPORT _sdbSequence
4639 _sdbSequence (
const _sdbSequence& other ) ;
4640 _sdbSequence& operator=(
const _sdbSequence& ) ;
4643 virtual ~_sdbSequence () {}
4645 virtual INT32 setAttributes (
const bson::BSONObj &options ) = 0 ;
4647 virtual INT32 getNextValue ( INT64 &value ) = 0 ;
4649 virtual INT32 getCurrentValue ( INT64 &value ) = 0 ;
4651 virtual INT32 setCurrentValue (
const INT64 value ) = 0 ;
4653 virtual INT32 fetch(
const INT32 fetchNum,
4656 INT32 &Increment ) = 0 ;
4658 virtual INT32 restart(
const INT64 startValue ) = 0 ;
4723 INT32 setAttributes (
const bson::BSONObj & options )
4725 if ( NULL == pSequence )
4727 return SDB_NOT_CONNECTED ;
4738 INT32 getNextValue( INT64 &value )
4740 if ( NULL == pSequence )
4742 return SDB_NOT_CONNECTED ;
4744 return pSequence->getNextValue( value ) ;
4753 INT32 getCurrentValue( INT64 &value )
4755 if ( NULL == pSequence )
4757 return SDB_NOT_CONNECTED ;
4759 return pSequence->getCurrentValue( value ) ;
4768 INT32 setCurrentValue(
const INT64 value )
4770 if ( NULL == pSequence )
4772 return SDB_NOT_CONNECTED ;
4774 return pSequence->setCurrentValue( value ) ;
4787 INT32 fetch(
const INT32 fetchNum, INT64 &nextValue,
4788 INT32 &returnNum, INT32 &increment )
4790 if ( NULL == pSequence )
4792 return SDB_NOT_CONNECTED ;
4794 return pSequence->fetch( fetchNum, nextValue, returnNum, increment ) ;
4803 INT32 restart(
const INT64 startValue )
4805 if ( NULL == pSequence )
4807 return SDB_NOT_CONNECTED ;
4809 return pSequence->restart( startValue ) ;
4813 class DLLEXPORT _sdbDataSource
4816 _sdbDataSource(
const _sdbDataSource& other ) ;
4817 _sdbDataSource& operator=(
const _sdbDataSource& ) ;
4820 virtual ~_sdbDataSource() {}
4822 virtual INT32 alterDataSource(
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4823 virtual const CHAR *getName() = 0 ;
4835 _sdbDataSource *pDataSource ;
4839 pDataSource = NULL ;
4846 delete pDataSource ;
4890 INT32 alterDataSource(
const bson::BSONObj &options )
4894 return SDB_NOT_CONNECTED ;
4903 const CHAR *getName()
4909 return pDataSource->getName() ;
4913 class DLLEXPORT _sdb
4916 _sdb (
const _sdb& other ) ;
4917 _sdb& operator=(
const _sdb& ) ;
4921 virtual INT32 connect (
const CHAR *pHostName,
4924 virtual INT32 connect (
const CHAR *pHostName,
4926 const CHAR *pUsrName,
4927 const CHAR *pPasswd ) = 0 ;
4928 virtual INT32 connect (
const CHAR *pHostName,
4929 const CHAR *pServiceName ) = 0 ;
4930 virtual INT32 connect (
const CHAR *pHostName,
4931 const CHAR *pServiceName,
4932 const CHAR *pUsrName,
4933 const CHAR *pPasswd ) = 0 ;
4934 virtual INT32 connect (
const CHAR **pConnAddrs,
4936 const CHAR *pUsrName,
4937 const CHAR *pPasswd ) = 0 ;
4938 virtual INT32 connect (
const CHAR **pConnAddrs,
4940 const CHAR *pUsrName,
4942 const CHAR *pCipherFile ) = 0 ;
4944 virtual void disconnect () = 0 ;
4946 virtual UINT64 getDbStartTime() = 0 ;
4948 virtual const CHAR *getAddress() = 0 ;
4950 virtual void getVersion( UINT8 &version, UINT8 &subVersion,
4951 UINT8 &fixVersion ) = 0 ;
4953 virtual INT32 createUsr(
const CHAR *pUsrName,
4954 const CHAR *pPasswd,
4955 const bson::BSONObj &options = _sdbStaticObject
4958 virtual INT32 removeUsr(
const CHAR *pUsrName,
4959 const CHAR *pPasswd ) = 0 ;
4961 virtual INT32 alterUsr(
const CHAR *pUsrName,
4962 const CHAR *pAction,
4963 const bson::BSONObj &options ) = 0 ;
4965 virtual INT32 changeUsrPasswd(
const CHAR *pUsrName,
4966 const CHAR *pOldPasswd,
4967 const CHAR *pNewPasswd ) = 0 ;
4969 virtual INT32 getSnapshot ( _sdbCursor **cursor,
4971 const bson::BSONObj &condition = _sdbStaticObject,
4972 const bson::BSONObj &selector = _sdbStaticObject,
4973 const bson::BSONObj &orderBy = _sdbStaticObject,
4974 const bson::BSONObj &hint = _sdbStaticObject,
4975 INT64 numToSkip = 0,
4976 INT64 numToReturn = -1
4979 virtual INT32 getSnapshot ( sdbCursor &cursor,
4981 const bson::BSONObj &condition = _sdbStaticObject,
4982 const bson::BSONObj &selector = _sdbStaticObject,
4983 const bson::BSONObj &orderBy = _sdbStaticObject,
4984 const bson::BSONObj &hint = _sdbStaticObject,
4985 INT64 numToSkip = 0,
4986 INT64 numToReturn = -1
4989 virtual INT32 resetSnapshot (
const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
4991 virtual INT32 getList ( _sdbCursor **cursor,
4993 const bson::BSONObj &condition = _sdbStaticObject,
4994 const bson::BSONObj &selector = _sdbStaticObject,
4995 const bson::BSONObj &orderBy = _sdbStaticObject,
4996 const bson::BSONObj &hint = _sdbStaticObject,
4997 INT64 numToSkip = 0,
4998 INT64 numToReturn = -1
5000 virtual INT32 getList ( sdbCursor &cursor,
5002 const bson::BSONObj &condition = _sdbStaticObject,
5003 const bson::BSONObj &selector = _sdbStaticObject,
5004 const bson::BSONObj &orderBy = _sdbStaticObject,
5005 const bson::BSONObj &hint = _sdbStaticObject,
5006 INT64 numToSkip = 0,
5007 INT64 numToReturn = -1
5010 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
5011 _sdbCollection **collection,
5012 BOOLEAN checkExist = TRUE
5015 virtual INT32 getCollection (
const CHAR *pCollectionFullName,
5016 sdbCollection &collection,
5017 BOOLEAN checkExist = TRUE
5020 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5021 _sdbCollectionSpace **cs,
5022 BOOLEAN checkExist = TRUE
5025 virtual INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5026 sdbCollectionSpace &cs,
5027 BOOLEAN checkExist = TRUE
5030 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5032 _sdbCollectionSpace **cs
5035 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5037 sdbCollectionSpace &cs
5040 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5041 const bson::BSONObj &options,
5042 _sdbCollectionSpace **cs
5045 virtual INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5046 const bson::BSONObj &options,
5047 sdbCollectionSpace &cs
5050 virtual INT32 dropCollectionSpace (
5051 const CHAR *pCollectionSpaceName,
5052 const bson::BSONObj &options = _sdbStaticObject
5055 virtual INT32 listCollectionSpaces ( _sdbCursor **result ) = 0 ;
5057 virtual INT32 listCollectionSpaces ( sdbCursor &result ) = 0 ;
5060 virtual INT32 listCollections ( _sdbCursor **result ) = 0 ;
5062 virtual INT32 listCollections ( sdbCursor &result ) = 0 ;
5065 virtual INT32 listReplicaGroups ( _sdbCursor **result ) = 0 ;
5067 virtual INT32 listReplicaGroups ( sdbCursor &result ) = 0 ;
5069 virtual INT32 getReplicaGroup (
const CHAR *pName,
5070 _sdbReplicaGroup **result ) = 0 ;
5072 virtual INT32 getReplicaGroup (
const CHAR *pName,
5073 sdbReplicaGroup &result ) = 0 ;
5075 virtual INT32 getReplicaGroup ( INT32
id,
5076 _sdbReplicaGroup **result ) = 0 ;
5078 virtual INT32 getReplicaGroup ( INT32
id,
5079 sdbReplicaGroup &result ) = 0 ;
5081 virtual INT32 createReplicaGroup (
const CHAR *pName,
5082 _sdbReplicaGroup **replicaGroup ) = 0 ;
5084 virtual INT32 createReplicaGroup (
const CHAR *pName,
5085 sdbReplicaGroup &replicaGroup ) = 0 ;
5087 virtual INT32 removeReplicaGroup (
const CHAR *pName ) = 0 ;
5089 virtual INT32 createReplicaCataGroup (
const CHAR *pHostName,
5090 const CHAR *pServiceName,
5091 const CHAR *pDatabasePath,
5092 const bson::BSONObj &configure ) =0 ;
5094 virtual INT32 activateReplicaGroup (
const CHAR *pName,
5095 _sdbReplicaGroup **replicaGroup ) = 0 ;
5096 virtual INT32 activateReplicaGroup (
const CHAR *pName,
5097 sdbReplicaGroup &replicaGroup ) = 0 ;
5099 virtual INT32 execUpdate(
const CHAR *sql,
5100 bson::BSONObj *pResult = NULL ) = 0 ;
5102 virtual INT32 exec(
const CHAR *sql,
5103 _sdbCursor **result ) = 0 ;
5105 virtual INT32 exec(
const CHAR *sql,
5106 sdbCursor &result ) = 0 ;
5108 virtual INT32 transactionBegin() = 0 ;
5110 virtual INT32 transactionCommit(
const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
5112 virtual INT32 transactionRollback() = 0 ;
5114 virtual INT32 flushConfigure(
const bson::BSONObj &options ) = 0 ;
5116 virtual INT32 crtJSProcedure (
const CHAR *code ) = 0 ;
5117 virtual INT32 rmProcedure(
const CHAR *spName ) = 0 ;
5118 virtual INT32 listProcedures( _sdbCursor **cursor,
const bson::BSONObj &condition ) = 0 ;
5119 virtual INT32 listProcedures( sdbCursor &cursor,
const bson::BSONObj &condition ) = 0 ;
5120 virtual INT32 evalJS(
const CHAR *code,
5122 _sdbCursor **cursor,
5123 bson::BSONObj &errmsg ) = 0 ;
5124 virtual INT32 evalJS(
const CHAR *code,
5127 bson::BSONObj &errmsg ) = 0 ;
5130 virtual INT32 backup (
const bson::BSONObj &options) = 0 ;
5131 virtual INT32 listBackup ( _sdbCursor **cursor,
5132 const bson::BSONObj &options,
5133 const bson::BSONObj &condition = _sdbStaticObject,
5134 const bson::BSONObj &selector = _sdbStaticObject,
5135 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
5136 virtual INT32 listBackup ( sdbCursor &cursor,
5137 const bson::BSONObj &options,
5138 const bson::BSONObj &condition = _sdbStaticObject,
5139 const bson::BSONObj &selector = _sdbStaticObject,
5140 const bson::BSONObj &orderBy = _sdbStaticObject) = 0 ;
5141 virtual INT32 removeBackup (
const bson::BSONObj &options ) = 0 ;
5144 virtual INT32 listTasks ( _sdbCursor **cursor,
5145 const bson::BSONObj &condition = _sdbStaticObject,
5146 const bson::BSONObj &selector = _sdbStaticObject,
5147 const bson::BSONObj &orderBy = _sdbStaticObject,
5148 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
5151 virtual INT32 listTasks ( sdbCursor &cursor,
5152 const bson::BSONObj &condition = _sdbStaticObject,
5153 const bson::BSONObj &selector = _sdbStaticObject,
5154 const bson::BSONObj &orderBy = _sdbStaticObject,
5155 const bson::BSONObj &hint = _sdbStaticObject) = 0 ;
5157 virtual INT32 waitTasks (
const SINT64 *taskIDs,
5160 virtual INT32 cancelTask ( SINT64 taskID,
5161 BOOLEAN isAsync ) = 0 ;
5163 virtual INT32 setSessionAttr (
const bson::BSONObj &options =
5164 _sdbStaticObject ) = 0 ;
5166 virtual INT32 getSessionAttr ( bson::BSONObj &result,
5167 BOOLEAN useCache = TRUE ) = 0 ;
5170 virtual INT32 closeAllCursors () = 0 ;
5173 virtual INT32 interrupt() = 0 ;
5174 virtual INT32 interruptOperation() = 0 ;
5177 virtual INT32 isValid( BOOLEAN *result ) = 0 ;
5178 virtual BOOLEAN isValid() = 0 ;
5180 virtual BOOLEAN isClosed() = 0 ;
5183 virtual INT32 createDomain (
const CHAR *pDomainName,
5184 const bson::BSONObj &options,
5185 _sdbDomain **domain ) = 0 ;
5187 virtual INT32 createDomain (
const CHAR *pDomainName,
5188 const bson::BSONObj &options,
5189 sdbDomain &domain ) = 0 ;
5191 virtual INT32 dropDomain (
const CHAR *pDomainName ) = 0 ;
5193 virtual INT32 getDomain (
const CHAR *pDomainName,
5194 _sdbDomain **domain ) = 0 ;
5196 virtual INT32 getDomain (
const CHAR *pDomainName,
5197 sdbDomain &domain ) = 0 ;
5199 virtual INT32 listDomains ( _sdbCursor **cursor,
5200 const bson::BSONObj &condition = _sdbStaticObject,
5201 const bson::BSONObj &selector = _sdbStaticObject,
5202 const bson::BSONObj &orderBy = _sdbStaticObject,
5203 const bson::BSONObj &hint = _sdbStaticObject
5206 virtual INT32 listDomains ( sdbCursor &cursor,
5207 const bson::BSONObj &condition = _sdbStaticObject,
5208 const bson::BSONObj &selector = _sdbStaticObject,
5209 const bson::BSONObj &orderBy = _sdbStaticObject,
5210 const bson::BSONObj &hint = _sdbStaticObject
5212 virtual INT32 getDC( _sdbDataCenter **dc ) = 0 ;
5213 virtual INT32 getDC( sdbDataCenter &dc ) = 0 ;
5215 static _sdb *getObj ( BOOLEAN useSSL = FALSE ) ;
5218 virtual UINT64 getLastAliveTime()
const = 0 ;
5220 virtual INT32 syncDB(
5221 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5223 virtual INT32 analyze(
5224 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5226 virtual INT32 forceSession(
5228 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5230 virtual INT32 forceStepUp(
5231 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5233 virtual INT32 invalidateCache(
5234 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5236 virtual INT32 reloadConfig(
5237 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5239 virtual INT32 updateConfig (
const bson::BSONObj &configs = _sdbStaticObject,
5240 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5242 virtual INT32 deleteConfig (
const bson::BSONObj &configs = _sdbStaticObject,
5243 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5245 virtual INT32 setPDLevel( INT32 level,
5246 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5248 virtual INT32 memTrim(
const CHAR *maskStr =
"",
5249 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5251 virtual INT32 msg(
const CHAR* msg ) = 0 ;
5253 virtual INT32 loadCS(
const CHAR* csName,
5254 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5256 virtual INT32 unloadCS(
const CHAR* csName,
5257 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5259 virtual INT32 traceStart( UINT32 traceBufferSize,
5260 const CHAR* component = NULL,
5261 const CHAR* breakpoint = NULL,
5262 const vector<UINT32> &tidVec = _sdbStaticUINT32Vec ) = 0 ;
5264 virtual INT32 traceStart( UINT32 traceBufferSize,
5265 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5267 virtual INT32 traceStop(
const CHAR* dumpFileName ) = 0 ;
5269 virtual INT32 traceResume() = 0 ;
5271 virtual INT32 traceStatus( _sdbCursor** cursor ) = 0 ;
5273 virtual INT32 traceStatus( sdbCursor& cursor ) = 0 ;
5276 virtual INT32 renameCollectionSpace(
const CHAR* oldName,
5277 const CHAR* newName,
5278 const bson::BSONObj &options = _sdbStaticObject ) = 0 ;
5280 virtual INT32 getLastErrorObj( bson::BSONObj &result ) = 0 ;
5281 virtual void cleanLastErrorObj() = 0 ;
5283 virtual INT32 getLastResultObj( bson::BSONObj &result,
5284 BOOLEAN getOwned = FALSE )
const = 0 ;
5287 virtual INT32 createSequence(
const CHAR *pSequenceName,
5288 const bson::BSONObj &options,
5289 _sdbSequence **sequence ) = 0 ;
5291 virtual INT32 createSequence(
const CHAR *pSequenceName,
5292 const bson::BSONObj &options,
5293 sdbSequence &sequence ) = 0 ;
5295 virtual INT32 createSequence(
const CHAR *pSequenceName,
5296 sdbSequence &sequence ) = 0 ;
5299 virtual INT32 getSequence(
const CHAR *pSequenceName,
5300 _sdbSequence **sequence ) = 0 ;
5302 virtual INT32 getSequence(
const CHAR *pSequenceName,
5303 sdbSequence &sequence ) = 0 ;
5305 virtual INT32 renameSequence(
const CHAR *pOldName,
5306 const CHAR *pNewName ) = 0 ;
5308 virtual INT32 dropSequence(
const CHAR *pSequenceName ) = 0 ;
5310 virtual INT32 createDataSource( _sdbDataSource **dataSource,
5311 const CHAR *pDataSourceName,
5312 const CHAR *addresses,
5313 const CHAR *user = NULL,
5314 const CHAR *password = NULL,
5315 const CHAR *type = NULL,
5316 const bson::BSONObj *options = NULL
5319 virtual INT32 dropDataSource(
const CHAR *pDataSourceName ) = 0 ;
5321 virtual INT32 getDataSource(
const CHAR *pDataSourceName,
5322 _sdbDataSource **dataSource ) = 0 ;
5324 virtual INT32 listDataSources( _sdbCursor** cursor,
5325 const bson::BSONObj &condition = _sdbStaticObject,
5326 const bson::BSONObj &selector = _sdbStaticObject,
5327 const bson::BSONObj &orderBy = _sdbStaticObject,
5328 const bson::BSONObj &hint = _sdbStaticObject ) = 0 ;
5332 typedef class _sdb _sdb ;
5339 sdb (
const sdb& other ) ;
5340 sdb& operator=(
const sdb& ) ;
5354 sdb ( BOOLEAN useSSL = FALSE ) :
5355 pSDB ( _sdb::getObj( useSSL ) )
5379 INT32 connect (
const CHAR *pHostName,
5385 return SDB_NOT_CONNECTED ;
5387 return pSDB->
connect ( pHostName, port ) ;
5403 INT32 connect (
const CHAR *pHostName,
5405 const CHAR *pUsrName,
5411 return SDB_NOT_CONNECTED ;
5413 return pSDB->connect ( pHostName, port,
5414 pUsrName, pPasswd ) ;
5426 INT32 connect (
const CHAR *pHostName,
5427 const CHAR *pServiceName
5432 return SDB_NOT_CONNECTED ;
5434 return pSDB->connect ( pHostName, pServiceName ) ;
5450 INT32 connect (
const CHAR *pHostName,
5451 const CHAR *pServiceName,
5452 const CHAR *pUsrName,
5453 const CHAR *pPasswd )
5457 return SDB_NOT_CONNECTED ;
5459 return pSDB->connect ( pHostName, pServiceName,
5460 pUsrName, pPasswd ) ;
5476 INT32 connect (
const CHAR **pConnAddrs,
5478 const CHAR *pUsrName,
5479 const CHAR *pPasswd )
5483 return SDB_NOT_CONNECTED ;
5485 return pSDB->connect ( pConnAddrs, arrSize,
5486 pUsrName, pPasswd ) ;
5504 INT32 connect (
const CHAR **pConnAddrs,
5506 const CHAR *pUsrName,
5508 const CHAR *pCipherFile )
5512 return SDB_NOT_CONNECTED ;
5514 return pSDB->connect ( pConnAddrs, arrSize,
5515 pUsrName, pToken, pCipherFile ) ;
5522 UINT64 getDbStartTime ()
5528 return pSDB->getDbStartTime() ;
5535 const CHAR *getAddress ()
5541 return pSDB->getAddress () ;
5554 void getVersion ( UINT8 &version, UINT8 &subVersion, UINT8 &fixVersion )
5560 pSDB->getVersion( version, subVersion, fixVersion ) ;
5591 INT32 createUsr(
const CHAR *pUsrName,
5592 const CHAR *pPasswd,
5593 const bson::BSONObj &options = _sdbStaticObject )
5597 return SDB_NOT_CONNECTED ;
5599 return pSDB->createUsr( pUsrName, pPasswd, options ) ;
5610 INT32 removeUsr(
const CHAR *pUsrName,
5611 const CHAR *pPasswd )
5615 return SDB_NOT_CONNECTED ;
5617 return pSDB->removeUsr( pUsrName, pPasswd ) ;
5632 INT32 alterUsr(
const CHAR *pUsrName,
5633 const CHAR *pAction,
5634 const bson::BSONObj &options )
5638 return SDB_NOT_CONNECTED ;
5640 return pSDB->alterUsr( pUsrName, pAction, options ) ;
5653 INT32 changeUsrPasswd(
const CHAR *pUsrName,
5654 const CHAR *pOldPasswd,
5655 const CHAR *pNewPasswd )
5659 return SDB_NOT_CONNECTED ;
5661 return pSDB->changeUsrPasswd( pUsrName, pOldPasswd, pNewPasswd ) ;
5673 pSDB->disconnect () ;
5718 const bson::BSONObj &condition = _sdbStaticObject,
5719 const bson::BSONObj &selector = _sdbStaticObject,
5720 const bson::BSONObj &orderBy = _sdbStaticObject,
5721 const bson::BSONObj &hint = _sdbStaticObject,
5722 INT64 numToSkip = 0,
5723 INT64 numToReturn = -1 )
5727 return SDB_NOT_CONNECTED ;
5730 return pSDB->getSnapshot ( cursor, snapType, condition,
5731 selector, orderBy, hint,
5732 numToSkip, numToReturn ) ;
5776 INT32 getSnapshot ( _sdbCursor **cursor,
5778 const bson::BSONObj &condition = _sdbStaticObject,
5779 const bson::BSONObj &selector = _sdbStaticObject,
5780 const bson::BSONObj &orderBy = _sdbStaticObject,
5781 const bson::BSONObj &hint = _sdbStaticObject,
5782 INT64 numToSkip = 0,
5783 INT64 numToReturn = -1 )
5787 return SDB_NOT_CONNECTED ;
5789 return pSDB->getSnapshot ( cursor, snapType, condition,
5790 selector, orderBy, hint,
5791 numToSkip, numToReturn ) ;
5816 INT32 resetSnapshot (
const bson::BSONObj &options = _sdbStaticObject )
5820 return SDB_NOT_CONNECTED ;
5822 return pSDB->resetSnapshot ( options ) ;
5825 INT32 getList ( _sdbCursor **cursor,
5827 const bson::BSONObj &condition = _sdbStaticObject,
5828 const bson::BSONObj &selector = _sdbStaticObject,
5829 const bson::BSONObj &orderBy = _sdbStaticObject,
5830 const bson::BSONObj &hint = _sdbStaticObject,
5831 INT64 numToSkip = 0,
5832 INT64 numToReturn = -1
5837 return SDB_NOT_CONNECTED ;
5839 return pSDB->getList ( cursor, listType,
5840 condition, selector, orderBy, hint,
5841 numToSkip, numToReturn ) ;
5887 const bson::BSONObj &condition = _sdbStaticObject,
5888 const bson::BSONObj &selector = _sdbStaticObject,
5889 const bson::BSONObj &orderBy = _sdbStaticObject,
5890 const bson::BSONObj &hint = _sdbStaticObject,
5891 INT64 numToSkip = 0,
5892 INT64 numToReturn = -1
5897 return SDB_NOT_CONNECTED ;
5900 return pSDB->getList ( cursor, listType,
5901 condition, selector, orderBy, hint,
5902 numToSkip, numToReturn ) ;
5905 INT32 getCollection (
const CHAR *pCollectionFullName,
5906 _sdbCollection **collection,
5907 BOOLEAN checkExist = TRUE
5912 return SDB_NOT_CONNECTED ;
5914 return pSDB->getCollection ( pCollectionFullName,
5915 collection, checkExist ) ;
5928 INT32 getCollection (
const CHAR *pCollectionFullName,
5930 BOOLEAN checkExist = TRUE
5935 return SDB_NOT_CONNECTED ;
5938 return pSDB->getCollection ( pCollectionFullName,
5943 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5944 _sdbCollectionSpace **cs,
5945 BOOLEAN checkExist = TRUE
5950 return SDB_NOT_CONNECTED ;
5952 return pSDB->getCollectionSpace ( pCollectionSpaceName,
5966 INT32 getCollectionSpace (
const CHAR *pCollectionSpaceName,
5968 BOOLEAN checkExist = TRUE
5973 return SDB_NOT_CONNECTED ;
5976 return pSDB->getCollectionSpace ( pCollectionSpaceName,
5980 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
5982 _sdbCollectionSpace **cs
5987 return SDB_NOT_CONNECTED ;
5989 return pSDB->createCollectionSpace ( pCollectionSpaceName,
6012 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
6019 return SDB_NOT_CONNECTED ;
6022 return pSDB->createCollectionSpace ( pCollectionSpaceName,
6026 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
6027 const bson::BSONObj &options,
6028 _sdbCollectionSpace **cs
6033 return SDB_NOT_CONNECTED ;
6035 return pSDB->createCollectionSpace ( pCollectionSpaceName,
6056 INT32 createCollectionSpace (
const CHAR *pCollectionSpaceName,
6057 const bson::BSONObj &options,
6063 return SDB_NOT_CONNECTED ;
6066 return pSDB->createCollectionSpace ( pCollectionSpaceName,
6079 INT32 dropCollectionSpace (
6080 const CHAR *pCollectionSpaceName,
6081 const bson::BSONObj &options = _sdbStaticObject )
6085 return SDB_NOT_CONNECTED ;
6088 return pSDB->dropCollectionSpace ( pCollectionSpaceName, options ) ;
6091 INT32 listCollectionSpaces ( _sdbCursor **result )
6095 return SDB_NOT_CONNECTED ;
6097 return pSDB->listCollectionSpaces ( result ) ;
6110 return SDB_NOT_CONNECTED ;
6113 return pSDB->listCollectionSpaces ( cursor ) ;
6122 INT32 listCollections ( _sdbCursor **result )
6126 return SDB_NOT_CONNECTED ;
6128 return pSDB->listCollections ( result ) ;
6141 return SDB_NOT_CONNECTED ;
6144 return pSDB->listCollections ( cursor ) ;
6153 INT32 listReplicaGroups ( _sdbCursor **result )
6157 return SDB_NOT_CONNECTED ;
6159 return pSDB->listReplicaGroups ( result ) ;
6173 return SDB_NOT_CONNECTED ;
6176 return pSDB->listReplicaGroups ( cursor ) ;
6186 INT32 getReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **result )
6190 return SDB_NOT_CONNECTED ;
6192 return pSDB->getReplicaGroup ( pName, result ) ;
6207 return SDB_NOT_CONNECTED ;
6210 return pSDB->getReplicaGroup ( pName, group ) ;
6220 INT32 getReplicaGroup ( INT32
id, _sdbReplicaGroup **result )
6224 return SDB_NOT_CONNECTED ;
6226 return pSDB->getReplicaGroup (
id, result ) ;
6240 return SDB_NOT_CONNECTED ;
6243 return pSDB->getReplicaGroup (
id, group ) ;
6253 INT32 createReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **replicaGroup )
6257 return SDB_NOT_CONNECTED ;
6259 return pSDB->createReplicaGroup ( pName, replicaGroup ) ;
6273 return SDB_NOT_CONNECTED ;
6276 return pSDB->createReplicaGroup ( pName, group ) ;
6285 INT32 removeReplicaGroup (
const CHAR *pName )
6289 return SDB_NOT_CONNECTED ;
6291 return pSDB->removeReplicaGroup ( pName ) ;
6306 INT32 createReplicaCataGroup (
const CHAR *pHostName,
6307 const CHAR *pServiceName,
6308 const CHAR *pDatabasePath,
6309 const bson::BSONObj &configure )
6313 return SDB_NOT_CONNECTED ;
6315 return pSDB->createReplicaCataGroup ( pHostName, pServiceName,
6316 pDatabasePath, configure ) ;
6319 INT32 activateReplicaGroup (
const CHAR *pName, _sdbReplicaGroup **replicaGroup )
6323 return SDB_NOT_CONNECTED ;
6325 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
6339 return SDB_NOT_CONNECTED ;
6342 return pSDB->activateReplicaGroup ( pName, replicaGroup ) ;
6352 INT32 execUpdate(
const CHAR *sql, bson::BSONObj *pResult = NULL )
6356 return SDB_NOT_CONNECTED ;
6358 return pSDB->execUpdate( sql, pResult ) ;
6369 INT32 exec(
const CHAR *sql,
6370 _sdbCursor **result )
6374 return SDB_NOT_CONNECTED ;
6376 return pSDB->exec( sql, result ) ;
6387 INT32 exec(
const CHAR *sql,
6392 return SDB_NOT_CONNECTED ;
6395 return pSDB->exec( sql, cursor ) ;
6403 INT32 transactionBegin()
6407 return SDB_NOT_CONNECTED ;
6409 return pSDB->transactionBegin() ;
6419 INT32 transactionCommit(
const bson::BSONObj &hint = _sdbStaticObject )
6423 return SDB_NOT_CONNECTED ;
6425 return pSDB->transactionCommit( hint ) ;
6433 INT32 transactionRollback()
6437 return SDB_NOT_CONNECTED ;
6439 return pSDB->transactionRollback() ;
6450 INT32 flushConfigure(
const bson::BSONObj &options )
6454 return SDB_NOT_CONNECTED ;
6456 return pSDB->flushConfigure( options ) ;
6465 INT32 crtJSProcedure (
const CHAR *code )
6469 return SDB_NOT_CONNECTED ;
6471 return pSDB->crtJSProcedure( code ) ;
6480 INT32 rmProcedure(
const CHAR *spName )
6484 return SDB_NOT_CONNECTED ;
6486 return pSDB->rmProcedure( spName ) ;
6489 INT32 listProcedures( _sdbCursor **cursor,
const bson::BSONObj &condition )
6493 return SDB_NOT_CONNECTED ;
6495 return pSDB->listProcedures( cursor, condition ) ;
6505 INT32 listProcedures(
sdbCursor &cursor,
const bson::BSONObj &condition )
6509 return SDB_NOT_CONNECTED ;
6512 return pSDB->listProcedures( cursor, condition ) ;
6515 INT32 evalJS(
const CHAR *code,
6517 _sdbCursor **cursor,
6518 bson::BSONObj &errmsg )
6522 return SDB_NOT_CONNECTED ;
6524 return pSDB->evalJS( code, type, cursor, errmsg ) ;
6541 bson::BSONObj &errmsg )
6545 return SDB_NOT_CONNECTED ;
6548 return pSDB->evalJS( code, type, cursor, errmsg ) ;
6570 INT32 backupOffline (
const bson::BSONObj &options)
6572 return backup( options ) ;
6593 INT32 backup (
const bson::BSONObj &options)
6597 return SDB_NOT_CONNECTED ;
6599 return pSDB->backup( options ) ;
6603 INT32 listBackup ( _sdbCursor **cursor,
6604 const bson::BSONObj &options,
6605 const bson::BSONObj &condition = _sdbStaticObject,
6606 const bson::BSONObj &selector = _sdbStaticObject,
6607 const bson::BSONObj &orderBy = _sdbStaticObject)
6611 return SDB_NOT_CONNECTED ;
6613 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
6639 const bson::BSONObj &options,
6640 const bson::BSONObj &condition = _sdbStaticObject,
6641 const bson::BSONObj &selector = _sdbStaticObject,
6642 const bson::BSONObj &orderBy = _sdbStaticObject)
6646 return SDB_NOT_CONNECTED ;
6649 return pSDB->listBackup( cursor, options, condition, selector, orderBy ) ;
6666 INT32 removeBackup (
const bson::BSONObj &options)
6670 return SDB_NOT_CONNECTED ;
6672 return pSDB->removeBackup( options ) ;
6675 INT32 listTasks ( _sdbCursor **cursor,
6676 const bson::BSONObj &condition = _sdbStaticObject,
6677 const bson::BSONObj &selector = _sdbStaticObject,
6678 const bson::BSONObj &orderBy = _sdbStaticObject,
6679 const bson::BSONObj &hint = _sdbStaticObject)
6683 return SDB_NOT_CONNECTED ;
6685 return pSDB->listTasks ( cursor,
6709 const bson::BSONObj &condition = _sdbStaticObject,
6710 const bson::BSONObj &selector = _sdbStaticObject,
6711 const bson::BSONObj &orderBy = _sdbStaticObject,
6712 const bson::BSONObj &hint = _sdbStaticObject)
6716 return SDB_NOT_CONNECTED ;
6719 return pSDB->listTasks ( cursor,
6734 INT32 waitTasks (
const SINT64 *taskIDs,
6739 return SDB_NOT_CONNECTED ;
6741 return pSDB->waitTasks ( taskIDs,
6754 INT32 cancelTask ( SINT64 taskID,
6759 return SDB_NOT_CONNECTED ;
6761 return pSDB->cancelTask ( taskID,
6775 INT32 setSessionAttr (
const bson::BSONObj &options = _sdbStaticObject )
6779 return SDB_NOT_CONNECTED ;
6781 return pSDB->setSessionAttr ( options ) ;
6792 INT32 getSessionAttr ( bson::BSONObj & result,
6793 BOOLEAN useCache = TRUE )
6797 return SDB_NOT_CONNECTED ;
6799 return pSDB->getSessionAttr( result, useCache ) ;
6808 INT32 closeAllCursors ()
6810 return interrupt() ;
6823 return SDB_NOT_CONNECTED ;
6825 return pSDB->interrupt () ;
6836 INT32 interruptOperation()
6840 return SDB_NOT_CONNECTED ;
6842 return pSDB->interruptOperation () ;
6852 INT32 isValid ( BOOLEAN *result )
6856 return SDB_NOT_CONNECTED ;
6858 return pSDB->isValid ( result ) ;
6871 return pSDB->isValid () ;
6884 return pSDB->isClosed() ;
6905 INT32 createDomain (
const CHAR *pDomainName,
6906 const bson::BSONObj &options,
6911 return SDB_NOT_CONNECTED ;
6914 return pSDB->createDomain ( pDomainName, options, domain ) ;
6917 INT32 createDomain (
const CHAR *pDomainName,
6918 const bson::BSONObj &options,
6919 _sdbDomain **domain )
6923 return SDB_NOT_CONNECTED ;
6925 return pSDB->createDomain ( pDomainName, options, domain ) ;
6934 INT32 dropDomain (
const CHAR *pDomainName )
6938 return SDB_NOT_CONNECTED ;
6940 return pSDB->dropDomain ( pDomainName ) ;
6943 INT32 getDomain (
const CHAR *pDomainName,
6944 _sdbDomain **domain )
6948 return SDB_NOT_CONNECTED ;
6950 return pSDB->getDomain ( pDomainName, domain ) ;
6961 INT32 getDomain (
const CHAR *pDomainName,
6966 return SDB_NOT_CONNECTED ;
6969 return pSDB->getDomain ( pDomainName, domain ) ;
6972 INT32 listDomains ( _sdbCursor **cursor,
6973 const bson::BSONObj &condition = _sdbStaticObject,
6974 const bson::BSONObj &selector = _sdbStaticObject,
6975 const bson::BSONObj &orderBy = _sdbStaticObject,
6976 const bson::BSONObj &hint = _sdbStaticObject )
6980 return SDB_NOT_CONNECTED ;
6982 return pSDB->listDomains ( cursor, condition, selector, orderBy, hint ) ;
7003 const bson::BSONObj &condition = _sdbStaticObject,
7004 const bson::BSONObj &selector = _sdbStaticObject,
7005 const bson::BSONObj &orderBy = _sdbStaticObject,
7006 const bson::BSONObj &hint = _sdbStaticObject )
7010 return SDB_NOT_CONNECTED ;
7013 return pSDB->listDomains ( cursor, condition, selector, orderBy, hint ) ;
7021 INT32 getDC( sdbDataCenter &dc )
7025 return SDB_NOT_CONNECTED ;
7028 return pSDB->getDC ( dc ) ;
7036 INT32 getDC( _sdbDataCenter **dc )
7040 return SDB_NOT_CONNECTED ;
7042 return pSDB->getDC ( dc ) ;
7074 INT32 syncDB(
const bson::BSONObj &options = _sdbStaticObject )
7078 return SDB_NOT_CONNECTED ;
7080 return pSDB->syncDB ( options ) ;
7109 INT32 analyze (
const bson::BSONObj &options = _sdbStaticObject )
7113 return SDB_NOT_CONNECTED ;
7115 return pSDB->analyze ( options ) ;
7133 INT32 forceSession( SINT64 sessionID,
7134 const bson::BSONObj &options = _sdbStaticObject )
7138 return SDB_NOT_CONNECTED ;
7140 return pSDB->forceSession( sessionID, options ) ;
7157 INT32 forceStepUp(
const bson::BSONObj &options = _sdbStaticObject )
7161 return SDB_NOT_CONNECTED ;
7163 return pSDB->forceStepUp( options ) ;
7178 INT32 invalidateCache(
const bson::BSONObj &options = _sdbStaticObject )
7182 return SDB_NOT_CONNECTED ;
7184 return pSDB->invalidateCache( options ) ;
7200 INT32 reloadConfig(
const bson::BSONObj &options = _sdbStaticObject )
7204 return SDB_NOT_CONNECTED ;
7206 return pSDB->reloadConfig( options ) ;
7225 INT32 updateConfig(
const bson::BSONObj &configs = _sdbStaticObject,
7226 const bson::BSONObj &options = _sdbStaticObject )
7230 return SDB_NOT_CONNECTED ;
7232 return pSDB->updateConfig( configs, options ) ;
7251 INT32 deleteConfig(
const bson::BSONObj &configs = _sdbStaticObject,
7252 const bson::BSONObj &options = _sdbStaticObject )
7256 return SDB_NOT_CONNECTED ;
7258 return pSDB->deleteConfig( configs, options ) ;
7283 INT32 setPDLevel( INT32 level,
7284 const bson::BSONObj &options = _sdbStaticObject )
7288 return SDB_NOT_CONNECTED ;
7290 return pSDB->setPDLevel( level, options ) ;
7308 INT32 memTrim(
const CHAR *maskStr =
"",
7309 const bson::BSONObj &options = _sdbStaticObject )
7313 return SDB_NOT_CONNECTED ;
7315 return pSDB->memTrim( maskStr, options ) ;
7318 INT32 msg(
const CHAR* msg )
7322 return SDB_NOT_CONNECTED ;
7324 return pSDB->msg( msg ) ;
7342 INT32 loadCS(
const CHAR* csName,
7343 const bson::BSONObj &options = _sdbStaticObject )
7347 return SDB_NOT_CONNECTED ;
7349 return pSDB->loadCS( csName, options ) ;
7367 INT32 unloadCS(
const CHAR* csName,
7368 const bson::BSONObj &options = _sdbStaticObject )
7372 return SDB_NOT_CONNECTED ;
7374 return pSDB->unloadCS( csName, options ) ;
7389 INT32 traceStart( UINT32 traceBufferSize,
7390 const CHAR* component = NULL,
7391 const CHAR* breakpoint = NULL,
7392 const vector<UINT32> &tidVec = _sdbStaticUINT32Vec )
7396 return SDB_NOT_CONNECTED ;
7398 return pSDB->traceStart( traceBufferSize, component,
7399 breakpoint, tidVec ) ;
7421 INT32 traceStart( UINT32 traceBufferSize,
7422 const bson::BSONObj &options )
7426 return SDB_NOT_CONNECTED ;
7428 return pSDB->traceStart( traceBufferSize, options ) ;
7439 INT32 traceStop(
const CHAR* dumpFileName )
7443 return SDB_NOT_CONNECTED ;
7445 return pSDB->traceStop( dumpFileName ) ;
7457 return SDB_NOT_CONNECTED ;
7459 return pSDB->traceResume() ;
7472 return SDB_NOT_CONNECTED ;
7475 return pSDB->traceStatus( cursor ) ;
7478 INT32 traceStatus( _sdbCursor** cursor )
7482 return SDB_NOT_CONNECTED ;
7484 return pSDB->traceStatus( cursor ) ;
7497 INT32 renameCollectionSpace(
const CHAR* oldName,
7498 const CHAR* newName,
7499 const bson::BSONObj &options = _sdbStaticObject )
7503 return SDB_NOT_CONNECTED ;
7505 return pSDB->renameCollectionSpace( oldName, newName, options ) ;
7519 INT32 getLastErrorObj( bson::BSONObj &errObj )
7523 return SDB_NOT_CONNECTED ;
7525 return pSDB->getLastErrorObj( errObj ) ;
7531 void cleanLastErrorObj()
7537 return pSDB->cleanLastErrorObj() ;
7550 INT32 getLastResultObj( bson::BSONObj &result,
7551 BOOLEAN getOwned = FALSE )
const
7555 return SDB_NOT_CONNECTED ;
7557 return pSDB->getLastResultObj( result, getOwned ) ;
7579 INT32 createSequence(
const CHAR *pSequenceName,
7580 const bson::BSONObj &options,
7581 _sdbSequence **sequence )
7585 return SDB_NOT_CONNECTED ;
7587 return pSDB->createSequence( pSequenceName, options, sequence ) ;
7609 INT32 createSequence(
const CHAR *pSequenceName,
7610 const bson::BSONObj &options,
7615 return SDB_NOT_CONNECTED ;
7617 return pSDB->createSequence( pSequenceName, options, sequence ) ;
7628 INT32 createSequence(
const CHAR *pSequenceName,
7633 return SDB_NOT_CONNECTED ;
7635 return pSDB->createSequence( pSequenceName, sequence ) ;
7646 INT32 getSequence(
const CHAR *pSequenceName,
7647 _sdbSequence **sequence )
7651 return SDB_NOT_CONNECTED ;
7653 return pSDB->getSequence( pSequenceName, sequence ) ;
7664 INT32 getSequence(
const CHAR *pSequenceName,
7669 return SDB_NOT_CONNECTED ;
7671 return pSDB->getSequence( pSequenceName, sequence ) ;
7681 INT32 renameSequence(
const CHAR *pOldName,
const CHAR *pNewName )
7685 return SDB_NOT_CONNECTED ;
7687 return pSDB->renameSequence( pOldName, pNewName ) ;
7696 INT32 dropSequence(
const CHAR *pSequenceName )
7700 return SDB_NOT_CONNECTED ;
7702 return pSDB->dropSequence( pSequenceName ) ;
7754 const CHAR *pDataSourceName,
7755 const CHAR *addresses,
7756 const CHAR *user = NULL,
7757 const CHAR *password = NULL,
7758 const CHAR *type = NULL,
7759 const bson::BSONObj *options = NULL )
7763 return SDB_NOT_CONNECTED ;
7766 return pSDB->createDataSource( &dataSource.pDataSource, pDataSourceName, addresses,
7767 user, password, type, options ) ;
7776 INT32 dropDataSource(
const CHAR *pDataSourceName )
7780 return SDB_NOT_CONNECTED ;
7782 return pSDB->dropDataSource( pDataSourceName ) ;
7793 INT32 getDataSource(
const CHAR *pDataSourceName,
7798 return SDB_NOT_CONNECTED ;
7801 return pSDB->getDataSource( pDataSourceName, &dataSource.pDataSource ) ;
7819 const bson::BSONObj &condition = _sdbStaticObject,
7820 const bson::BSONObj &selector = _sdbStaticObject,
7821 const bson::BSONObj &orderBy = _sdbStaticObject,
7822 const bson::BSONObj &hint = _sdbStaticObject )
7826 return SDB_NOT_CONNECTED ;
7829 return pSDB->listDataSources( &cursor.
pCursor, condition, selector, orderBy, hint ) ;