diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-12-23 11:21:01 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-12-23 11:21:01 +0100 |
commit | 356d343ced28673b4dd76f3600aaf535099979a4 (patch) | |
tree | 98ab28712f22e6f7c9bb588452c63480e54754a5 /ndb/include | |
parent | fde8d07de354dda6d9d9b45d3295a8fb17d53e17 (diff) | |
download | mariadb-git-356d343ced28673b4dd76f3600aaf535099979a4.tar.gz |
backwards compatible name change NdbConnectionto NdbTransaction
removed friend declarations from doxygen
updated some documentation in mgmapi
BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136:
Delete: ndb/include/ndbapi/NdbCursorOperation.hpp
BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5:
Delete: ndb/src/ndbapi/NdbCursorOperation.cpp
ndb/include/Makefile.am:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/ScanTab.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/TcCommit.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/TcHbRep.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/TcIndx.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/TcKeyConf.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/TcKeyFailConf.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/TcRollbackRep.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/kernel/signaldata/TransIdAI.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/mgmapi/mgmapi.h:
backwards compatible name change NdbConnectionto NdbTransaction
documented some missing things in mgmapi
ndb/include/ndbapi/Ndb.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbApi.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbBlob.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbDictionary.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbEventOperation.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbIndexOperation.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbIndexScanOperation.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbOperation.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbRecAttr.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbReceiver.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbScanFilter.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbScanOperation.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/include/ndbapi/NdbTransaction.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/Makefile.am:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/Ndb.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbApiSignal.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbBlob.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbImpl.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbIndexOperation.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbOperation.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbOperationDefine.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbOperationExec.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbOperationInt.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbOperationSearch.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbReceiver.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbScanOperation.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbTransaction.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/NdbTransactionScan.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/Ndberr.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/Ndbif.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/Ndbinit.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/src/ndbapi/Ndblist.cpp:
backwards compatible name change NdbConnectionto NdbTransaction
ndb/tools/restore/consumer_restore.hpp:
backwards compatible name change NdbConnectionto NdbTransaction
sql/ha_ndbcluster.h:
backwards compatible name change NdbConnectionto NdbTransaction
Diffstat (limited to 'ndb/include')
24 files changed, 340 insertions, 278 deletions
diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index f729d422dd9..49857c53fb1 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -9,8 +9,7 @@ ndbapiinclude_HEADERS = \ ndbapi/ndbapi_limits.h \ ndbapi/Ndb.hpp \ ndbapi/NdbApi.hpp \ -ndbapi/NdbConnection.hpp \ -ndbapi/NdbCursorOperation.hpp \ +ndbapi/NdbTransaction.hpp \ ndbapi/NdbDictionary.hpp \ ndbapi/NdbError.hpp \ ndbapi/NdbEventOperation.hpp \ diff --git a/ndb/include/kernel/signaldata/ScanTab.hpp b/ndb/include/kernel/signaldata/ScanTab.hpp index 548b9e520ae..894f973145c 100644 --- a/ndb/include/kernel/signaldata/ScanTab.hpp +++ b/ndb/include/kernel/signaldata/ScanTab.hpp @@ -33,7 +33,7 @@ class ScanTabReq { /** * Sender(s) */ - friend class NdbConnection; + friend class NdbTransaction; friend class NdbScanOperation; friend class NdbIndexScanOperation; @@ -277,7 +277,7 @@ class ScanTabConf { /** * Reciver(s) */ - friend class NdbConnection; // Reciver + friend class NdbTransaction; // Reciver /** * Sender(s) @@ -345,7 +345,7 @@ class ScanTabRef { /** * Reciver(s) */ - friend class NdbConnection; // Reciver + friend class NdbTransaction; // Reciver /** * Sender(s) diff --git a/ndb/include/kernel/signaldata/TcCommit.hpp b/ndb/include/kernel/signaldata/TcCommit.hpp index b7f3fbbb361..9499b20ada3 100644 --- a/ndb/include/kernel/signaldata/TcCommit.hpp +++ b/ndb/include/kernel/signaldata/TcCommit.hpp @@ -33,7 +33,7 @@ class TcCommitConf { * Reciver(s) */ friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; public: STATIC_CONST( SignalLength = 3 ); @@ -60,7 +60,7 @@ class TcCommitRef { /** * Reciver(s) */ - friend class NdbConnection; + friend class NdbTransaction; public: STATIC_CONST( SignalLength = 4 ); diff --git a/ndb/include/kernel/signaldata/TcHbRep.hpp b/ndb/include/kernel/signaldata/TcHbRep.hpp index 58ab015917a..7e701b510f9 100644 --- a/ndb/include/kernel/signaldata/TcHbRep.hpp +++ b/ndb/include/kernel/signaldata/TcHbRep.hpp @@ -36,7 +36,7 @@ class TcHbRep { /** * Sender(s) */ - friend class NdbConnection; + friend class NdbTransaction; /** * For printing diff --git a/ndb/include/kernel/signaldata/TcIndx.hpp b/ndb/include/kernel/signaldata/TcIndx.hpp index 605d92678ee..c5e7d2489ba 100644 --- a/ndb/include/kernel/signaldata/TcIndx.hpp +++ b/ndb/include/kernel/signaldata/TcIndx.hpp @@ -26,7 +26,7 @@ class TcIndxConf { * Reciver(s) */ friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; /** * Sender(s) diff --git a/ndb/include/kernel/signaldata/TcKeyConf.hpp b/ndb/include/kernel/signaldata/TcKeyConf.hpp index 277872b990b..c23e94951dc 100644 --- a/ndb/include/kernel/signaldata/TcKeyConf.hpp +++ b/ndb/include/kernel/signaldata/TcKeyConf.hpp @@ -27,7 +27,7 @@ class TcKeyConf { * Reciver(s) */ friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; friend class Ndbcntr; friend class DbUtil; diff --git a/ndb/include/kernel/signaldata/TcKeyFailConf.hpp b/ndb/include/kernel/signaldata/TcKeyFailConf.hpp index d8207b63262..7c0a766df40 100644 --- a/ndb/include/kernel/signaldata/TcKeyFailConf.hpp +++ b/ndb/include/kernel/signaldata/TcKeyFailConf.hpp @@ -33,7 +33,7 @@ class TcKeyFailConf { * Reciver(s) */ friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; public: STATIC_CONST( SignalLength = 3 ); diff --git a/ndb/include/kernel/signaldata/TcRollbackRep.hpp b/ndb/include/kernel/signaldata/TcRollbackRep.hpp index b00731a04a6..febbd4f86b1 100644 --- a/ndb/include/kernel/signaldata/TcRollbackRep.hpp +++ b/ndb/include/kernel/signaldata/TcRollbackRep.hpp @@ -23,7 +23,7 @@ class TcRollbackRep { /** * Sender(s) */ - friend class NdbConnection; + friend class NdbTransaction; friend class DbUtil; /** diff --git a/ndb/include/kernel/signaldata/TransIdAI.hpp b/ndb/include/kernel/signaldata/TransIdAI.hpp index 4df7bf2a126..5beaf6eba4b 100755 --- a/ndb/include/kernel/signaldata/TransIdAI.hpp +++ b/ndb/include/kernel/signaldata/TransIdAI.hpp @@ -28,7 +28,7 @@ class TransIdAI { /** * Receiver(s) */ - friend class NdbConnection; + friend class NdbTransaction; friend class Dbtc; friend class Dbutil; friend class Dblqh; diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 230a866ea11..bce46d53f35 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -362,22 +362,6 @@ extern "C" { */ NdbMgmHandle ndb_mgm_create_handle(); - /** - * Set connecst string to management server - * - * @param handle Management handle - * @param connect_string Connect string to the management server, - * - * @return -1 on error. - */ - int ndb_mgm_set_connectstring(NdbMgmHandle handle, - const char *connect_string); - - int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle); - int ndb_mgm_get_connected_port(NdbMgmHandle handle); - const char *ndb_mgm_get_connected_host(NdbMgmHandle handle); - const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz); - /** * Destroy a management server handle * @@ -391,6 +375,29 @@ extern "C" { * @{ */ + /** + * Set connect string to management server + * + * @param handle Management handle + * @param connect_string Connect string to the management server, + * + * @return -1 on error. + */ + int ndb_mgm_set_connectstring(NdbMgmHandle handle, + const char *connect_string); + + /** + * Get connectstring used for connection + * + * @note returns what the connectstring defaults to if the above call has + * not been performed + * + * @param handle Management handle + * + * @return connectstring + */ + const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz); + /** * Connect to a management server * @@ -408,6 +415,33 @@ extern "C" { */ int ndb_mgm_disconnect(NdbMgmHandle handle); + /** + * Get nodeid used in the connection + * + * @param handle Management handle + * + * @return node id + */ + int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle); + + /** + * Get port used in the connection + * + * @param handle Management handle + * + * @return port + */ + int ndb_mgm_get_connected_port(NdbMgmHandle handle); + + /** + * Get host used in the connection + * + * @param handle Management handle + * + * @return hostname + */ + const char *ndb_mgm_get_connected_host(NdbMgmHandle handle); + /** @} *********************************************************************/ /** * @name Functions: Convert between different data formats @@ -436,7 +470,8 @@ extern "C" { * @param type Node type. * @return NULL if invalid id. */ - const char * ndb_mgm_get_node_type_alias_string(enum ndb_mgm_node_type type, const char **str); + const char * ndb_mgm_get_node_type_alias_string(enum ndb_mgm_node_type type, + const char **str); /** * Convert a string to a ndb_mgm_node_status @@ -454,8 +489,10 @@ extern "C" { */ const char * ndb_mgm_get_node_status_string(enum ndb_mgm_node_status status); +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL ndb_mgm_event_category ndb_mgm_match_event_category(const char *); const char * ndb_mgm_get_event_category_string(enum ndb_mgm_event_category); +#endif /** @} *********************************************************************/ /** @@ -469,6 +506,7 @@ extern "C" { * Note the caller must free the pointer returned. * * @param handle Management handle. + * * @return Cluster state (or NULL on error). */ struct ndb_mgm_cluster_state * ndb_mgm_get_status(NdbMgmHandle handle); @@ -488,6 +526,7 @@ extern "C" { * n - Means stop n node(s) specified in the * array node_list * @param node_list List of node ids of database nodes to be stopped + * * @return No of nodes stopped (or -1 on error) * * @note The function is equivalent @@ -507,6 +546,7 @@ extern "C" { * @param node_list List of node ids of database nodes to be stopped * @param abort Don't perform gracefull stop, * but rather stop immediatly + * * @return No of nodes stopped (or -1 on error). */ int ndb_mgm_stop2(NdbMgmHandle handle, int no_of_nodes, @@ -521,6 +561,7 @@ extern "C" { * n - Means stop n node(s) specified in the * array node_list * @param node_list List of node ids of database nodes to be stopped + * * @return No of nodes stopped (or -1 on error). * * @note The function is equivalent to @@ -543,6 +584,7 @@ extern "C" { * waiting for start command * @param abort Don't perform gracefull restart, * but rather restart immediatly + * * @return No of nodes stopped (or -1 on error). */ int ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, @@ -558,6 +600,7 @@ extern "C" { * n - Means start n node(s) specified in * the array node_list * @param node_list List of node ids of database nodes to be started + * * @return No of nodes started (or -1 on error). * * @note The nodes to start must have been started with nostart(-n) @@ -582,6 +625,7 @@ extern "C" { * @param handle NDB management handle. * @param level A cluster log level to filter. * @param reply Reply message. + * * @return -1 on error. */ int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, @@ -592,6 +636,7 @@ extern "C" { * Get log filter * * @param handle NDB management handle + * * @return A vector of seven elements, * where each element contains * 1 if a severity is enabled and 0 if not. @@ -620,7 +665,7 @@ extern "C" { enum ndb_mgm_event_category category, int level, struct ndb_mgm_reply* reply); - +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** * Set log category and levels for the Node * @@ -646,6 +691,7 @@ extern "C" { */ int ndb_mgm_get_stat_port(NdbMgmHandle handle, struct ndb_mgm_reply* reply); +#endif /** @} *********************************************************************/ /** @@ -699,6 +745,7 @@ extern "C" { * @param handle NDB management handle. * @param nodeId Node Id of the single user node * @param reply Reply message. + * * @return -1 on error. */ int ndb_mgm_exit_single_user(NdbMgmHandle handle, @@ -709,6 +756,7 @@ extern "C" { * * @param filter pairs of { level, category } that will be * pushed to fd, level=0 ends lists + * * @return fd which events will be pushed to */ int ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]); @@ -718,12 +766,16 @@ extern "C" { * @param handle NDB management handle. * @param version Version of configuration, 0 means latest * @see MAKE_VERSION - * @Note the caller must call ndb_mgm_detroy_configuration + * + * @return configuration + * + * @note the caller must call ndb_mgm_detroy_configuration */ struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned version); void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *); +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL int ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned version, int nodetype); /** @@ -749,6 +801,8 @@ extern "C" { int param, const char ** value); int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **); int ndb_mgm_check_connection(NdbMgmHandle handle); +#endif + #ifdef __cplusplus } #endif diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index b3475841c87..e919c6de529 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -25,7 +25,7 @@ The NDB API consists of the following fundamental classes: - Ndb_cluster_connection class representing a connection to a cluster, - Ndb is the main class representing the database, - - NdbConnection represents a transaction, + - NdbTransaction represents a transaction, - NdbOperation represents a operation using primary key, - NdbScanOperation represents a operation performing a full table scan. - NdbIndexOperation represents a operation using a unique hash index, @@ -40,12 +40,12 @@ -# Construct and connect to a cluster using the Ndb_cluster_connection object. -# Construct and initialize Ndb object(s). - -# Define and execute transactions using NdbConnection and Ndb*Operation. + -# Define and execute transactions using NdbTransaction and Ndb*Operation. -# Delete Ndb objects -# Delete connection to cluster The main structure of a transaction is as follows: - -# Start transaction, a NdbConnection + -# Start transaction, a NdbTransaction -# Add and define operations (associated with the transaction), Ndb*Operation -# Execute transaction @@ -73,15 +73,15 @@ Synchronous transactions are defined and executed in the following way. -# Start (create) transaction (the transaction will be - referred to by an NdbConnection object, + referred to by an NdbTransaction object, typically created by Ndb::startTransaction). At this step the transaction is being defined. It is not yet sent to the NDB kernel. -# Add and define operations to the transaction - (using NdbConnection::getNdb*Operation and + (using NdbTransaction::getNdb*Operation and methods from class Ndb*Operation). The transaction is still not sent to the NDB kernel. - -# Execute the transaction (using NdbConnection::execute). + -# Execute the transaction (using NdbTransaction::execute). -# Close the transaction (using Ndb::closeTransaction). See example program in section @ref ndbapi_example1.cpp. @@ -97,15 +97,15 @@ @section secNdbOperations Operations - Each transaction (NdbConnection object) consist of a list of + Each transaction (NdbTransaction object) consist of a list of operations (Ndb*Operation objects). Operations are of two different kinds: -# standard operations, and -# interpreted program operations. <h3>Single row operations</h3> - After the operation is created using NdbConnection::getNdbOperation - (or NdbConnection::getNdbIndexOperation), + After the operation is created using NdbTransaction::getNdbOperation + (or NdbTransaction::getNdbIndexOperation), it is defined in the following three steps: -# Defining standard operation type (e.g. using NdbOperation::readTuple) @@ -117,7 +117,7 @@ Example code (using an NdbOperation and excluding error handling): @code // 1. Create - MyOperation= MyConnection->getNdbOperation("MYTABLENAME"); + MyOperation= MyTransaction->getNdbOperation("MYTABLENAME"); // 2. Define type of operation and lock mode MyOperation->readTuple(NdbOperation::LM_Read); @@ -134,7 +134,7 @@ Example code (using an NdbIndexOperation and excluding error handling): @code // 1. Create - MyOperation= MyConnection->getNdbIndexOperation("MYINDEX", "MYTABLENAME"); + MyOperation= MyTransaction->getNdbIndexOperation("MYINDEX", "MYTABLENAME"); // 2. Define type of operation and lock mode MyOperation->readTuple(NdbOperation::LM_Read); @@ -167,7 +167,7 @@ operate on a defined unique hash index.) @note If you want to define multiple operations within the same transaction, - then you need to call NdbConnection::getNdb*Operation for each + then you need to call NdbTransaction::getNdb*Operation for each operation. <h4>Step 2: Specify Search Conditions</h4> @@ -203,7 +203,7 @@ Thus, the application can not reference this object after Ndb::closeTransaction have been called. The result of reading data from an NdbRecAttr object before - calling NdbConnection::execute is undefined. + calling NdbTransaction::execute is undefined. @@ -333,9 +333,9 @@ not abort the transaction, it only skips the tuple and proceeds with the next. The skipped tuple will not be reported to the application. - -# Call NdbConnection::executeScan to define (and start) the scan. - -# Call NdbConnection::nextScanResult to proceed with next tuple. - When calling NdbConnection::nextScanResult, the lock on any + -# Call NdbTransaction::executeScan to define (and start) the scan. + -# Call NdbTransaction::nextScanResult to proceed with next tuple. + When calling NdbTransaction::nextScanResult, the lock on any previous tuples are released. <br> If the tuple should be updated then it must be transferred over @@ -343,7 +343,7 @@ This is performed by calling NdbOperation::takeOverForUpdate or takeOverForDelete on the scanning transactions NdbOperation object with the updating - transactions NdbConnection object as parameter. + transactions NdbTransaction object as parameter. <p> If NdbOperation::takeOverFor* returns NULL then the operation was not successful, otherwise it returns a reference @@ -364,7 +364,7 @@ -# NdbScanOperation::readTuplesExclusive returns a handle to a NdbResultSet. -# Search conditions are defined by NdbScanFilter - -# Call NdbConnection::execute(NoCommit) to start the scan. + -# Call NdbTransaction::execute(NoCommit) to start the scan. -# Call NdbResultSet::nextResult to proceed with next tuple. When calling NdbResultSet::nextResult(false), the lock on any previous tuples are released and the next tuple cached in the API @@ -375,7 +375,7 @@ The new update operation can the be used to modify the tuple. When nextResult(false) returns != 0, then no more tuples are cached in the API. Updated tuples is now commit using - NdbConnection::execute(Commit). + NdbTransaction::execute(Commit). After the commit, more tuples are fetched from NDB using nextResult(true). -# Use Ndb::closeTransaction as usual to close the transaction. @@ -469,7 +469,7 @@ chunks of data are sent when actually sending and thus decreasing the operating system overhead. - The synchronous call to NdbConnection::execute + The synchronous call to NdbTransaction::execute normally performs three main steps:<br> -# <b>Prepare</b> Check transaction status @@ -481,7 +481,7 @@ -# <b>Poll</b> Wait for response from NDB kernel. - The asynchronous method NdbConnection::executeAsynchPrepare + The asynchronous method NdbTransaction::executeAsynchPrepare only perform step 1. (The abort part in step 1 is only prepared for. The actual aborting of the transaction is performed in a later step.) @@ -492,11 +492,11 @@ synchronous transactions) -# Add and define operations (also as in the synchronous case) -# <b>Prepare</b> transactions - (using NdbConnection::executeAsynchPrepare or - NdbConnection::executeAsynch) + (using NdbTransaction::executeAsynchPrepare or + NdbTransaction::executeAsynch) -# <b>Send</b> transactions to NDB Kernel (using Ndb::sendPreparedTransactions, - NdbConnection::executeAsynch, or Ndb::sendPollNdb) + NdbTransaction::executeAsynch, or Ndb::sendPollNdb) -# <b>Poll</b> NDB kernel to find completed transactions (using Ndb::pollNdb or Ndb::sendPollNdb) -# Close transactions (same way as for the synchronous transactions) @@ -507,24 +507,24 @@ - (Prepare-Send-Poll). This is the one-step variant provided by synchronous transactions. - (Prepare-Send)-Poll. This is the two-step variant using - NdbConnection::executeAsynch and Ndb::pollNdb. + NdbTransaction::executeAsynch and Ndb::pollNdb. - Prepare-(Send-Poll). This is the two-step variant using - NdbConnection::executeAsynchPrepare and Ndb::sendPollNdb. + NdbTransaction::executeAsynchPrepare and Ndb::sendPollNdb. - Prepare-Send-Poll. This is the three-step variant using - NdbConnection::executeAsynchPrepare, Ndb::sendPreparedTransactions, and + NdbTransaction::executeAsynchPrepare, Ndb::sendPreparedTransactions, and Ndb::pollNdb. Transactions first has to be prepared by using method - NdbConnection::executeAsynchPrepare or NdbConnection::executeAsynch. + NdbTransaction::executeAsynchPrepare or NdbTransaction::executeAsynch. The difference between these is that - NdbConnection::executeAsynch also sends the transaction to + NdbTransaction::executeAsynch also sends the transaction to the NDB kernel. One of the arguments to these methods is a callback method. The callback method is executed during polling (item 5 above). - Note that NdbConnection::executeAsynchPrepare does not + Note that NdbTransaction::executeAsynchPrepare does not send the transaction to the NDB kernel. When using - NdbConnection::executeAsynchPrepare, you either have to call + NdbTransaction::executeAsynchPrepare, you either have to call Ndb::sendPreparedTransactions or Ndb::sendPollNdb to send the database operations. (Ndb::sendPollNdb also polls Ndb for completed transactions.) @@ -550,8 +550,8 @@ objects belonging to this transaction until the transaction callback method have been executed. (The transaction is stated and sent by either - NdbConnection::executeAsynch or through the combination of - NdbConnection::executeAsynchPrepare and either + NdbTransaction::executeAsynch or through the combination of + NdbTransaction::executeAsynchPrepare and either Ndb::sendPreparedTransactions or Ndb::sendPollNdb). More about how transactions are send the NDB Kernel is @@ -566,7 +566,7 @@ One recommended way to handle a transaction failure (i.e. an error is reported) is to: - -# Rollback transaction (NdbConnection::execute with a special parameter) + -# Rollback transaction (NdbTransaction::execute with a special parameter) -# Close transaction -# Restart transaction (if the error was temporary) @@ -578,14 +578,14 @@ objects and query for their NdbError objects to find out what really happened. - NdbConnection::getNdbErrorOperation returns a reference to the + NdbTransaction::getNdbErrorOperation returns a reference to the operation causing the latest error. - NdbConnection::getNdbErrorLine delivers the method number of the + NdbTransaction::getNdbErrorLine delivers the method number of the erroneous method in the operation. @code - theConnection = theNdb->startTransaction(); - theOperation = theConnection->getNdbOperation("TEST_TABLE"); + theTransaction = theNdb->startTransaction(); + theOperation = theTransaction->getNdbOperation("TEST_TABLE"); if (theOperation == NULL) goto error; theOperation->readTuple(); theOperation->setValue("ATTR_1", at1); @@ -593,9 +593,9 @@ theOperation->setValue("ATTR_3", at1); theOperation->setValue("ATTR_4", at1); - if (theConnection->execute(Commit) == -1) { - errorLine = theConnection->getNdbErrorLine(); - errorOperation = theConnection->getNdbErrorOperation(); + if (theTransaction->execute(Commit) == -1) { + errorLine = theTransaction->getNdbErrorLine(); + errorOperation = theTransaction->getNdbErrorOperation(); @endcode Here errorLine will be 3 as the error occurred in the third method @@ -603,11 +603,11 @@ Getting errorLine == 0 means that the error occurred when executing the operations. Here errorOperation will be a pointer to the theOperation object. - NdbConnection::getNdbError will return the NdbError object + NdbTransaction::getNdbError will return the NdbError object including holding information about the error. Since errors could have occurred even when a commit was reported, - there is also a special method, NdbConnection::commitStatus, + there is also a special method, NdbTransaction::commitStatus, to check the commit status of the transaction. *******************************************************************************/ @@ -654,7 +654,7 @@ @page secAdapt Adaptive Send Algorithm At the time of "sending" the transaction - (using NdbConnection::execute), the transactions + (using NdbTransaction::execute), the transactions are in reality <em>not</em> immediately transfered to the NDB Kernel. Instead, the "sent" transactions are only kept in a special send list (buffer) in the Ndb object to which they belong. @@ -710,7 +710,7 @@ later releases of NDB Cluster. However, to support faster than 10 ms checks, there has to be support from the operating system. - -# When calling NdbConnection::execute synchronously or calling any + -# When calling NdbTransaction::execute synchronously or calling any of the poll-methods, there is a force parameter that overrides the adaptive algorithm and forces the send to all nodes. @@ -876,7 +876,7 @@ class NdbEventOperationImpl; class NdbScanOperation; class NdbIndexScanOperation; class NdbIndexOperation; -class NdbConnection; +class NdbTransaction; class NdbApiSignal; class NdbRecAttr; class NdbLabel; @@ -970,10 +970,11 @@ public: class Ndb { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbReceiver; friend class NdbOperation; friend class NdbEventOperationImpl; - friend class NdbConnection; + friend class NdbTransaction; friend class Table; friend class NdbApiSignal; friend class NdbIndexOperation; @@ -982,6 +983,7 @@ class Ndb friend class NdbDictionaryImpl; friend class NdbDictInterface; friend class NdbBlob; +#endif public: /** @@ -1075,11 +1077,11 @@ public: * * @param maxNoOfTransactions * Maximum number of parallel - * NdbConnection objects that can be handled by the Ndb object. + * NdbTransaction objects that can be handled by the Ndb object. * Maximum value is 1024. * * @note each scan or index scan operation uses one extra - * NdbConnection object + * NdbTransaction object * * @return 0 if successful, -1 otherwise. */ @@ -1171,7 +1173,7 @@ public: * Start a transaction * * @note When the transaction is completed it must be closed using - * Ndb::closeTransaction or NdbConnection::close. + * Ndb::closeTransaction or NdbTransaction::close. * The transaction must be closed independent of its outcome, i.e. * even if there is an error. * @@ -1180,9 +1182,9 @@ public: * which node to run the Transaction Coordinator on * @param keyLen Length of partition key expressed in bytes * - * @return NdbConnection object, or NULL on failure. + * @return NdbTransaction object, or NULL on failure. */ - NdbConnection* startTransaction(Uint32 prio = 0, + NdbTransaction* startTransaction(Uint32 prio = 0, const char * keyData = 0, Uint32 keyLen = 0); @@ -1213,9 +1215,9 @@ public: * @param type is the type of distribution group.<br> * 0 means direct usage of the two characters, and<br> * 1 means the ASCII digit variant. - * @return NdbConnection, or NULL if it failed. + * @return NdbTransaction, or NULL if it failed. */ - NdbConnection* startTransactionDGroup(Uint32 aPrio, + NdbTransaction* startTransactionDGroup(Uint32 aPrio, const char * keyData, int type); #endif @@ -1234,7 +1236,7 @@ public: * has completed before calling Ndb::closeTransaction). * If the transaction is not committed it will be aborted. */ - void closeTransaction(NdbConnection* aConnection); + void closeTransaction(NdbTransaction*); /** @} *********************************************************************/ @@ -1420,7 +1422,7 @@ public: /** */ - NdbConnection* hupp( NdbConnection* ); + NdbTransaction* hupp( NdbTransaction* ); Uint32 getReference() const { return theMyRef;} #endif @@ -1435,11 +1437,11 @@ private: void connected(Uint32 block_reference); - NdbConnection* startTransactionLocal(Uint32 aPrio, Uint32 aFragmentId); + NdbTransaction* startTransactionLocal(Uint32 aPrio, Uint32 aFragmentId); // Connect the connection object to the Database. int NDB_connect(Uint32 tNode); - NdbConnection* doConnect(Uint32 nodeId); + NdbTransaction* doConnect(Uint32 nodeId); void doDisconnect(); NdbReceiver* getNdbScanRec();// Get a NdbScanReceiver from idle list @@ -1471,8 +1473,8 @@ private: void check_send_timeout(); void remove_sent_list(Uint32); - Uint32 insert_completed_list(NdbConnection*); - Uint32 insert_sent_list(NdbConnection*); + Uint32 insert_completed_list(NdbTransaction*); + Uint32 insert_sent_list(NdbTransaction*); // Handle a received signal. Used by both // synchronous and asynchronous interface @@ -1512,20 +1514,20 @@ private: void freeNdbScanRec(); // Free the first idle NdbScanRec obj void freeNdbBlob(); // Free the first etc - NdbConnection* getNdbCon(); // Get a connection from idle list + NdbTransaction* getNdbCon(); // Get a connection from idle list /** - * Get a connected NdbConnection to nodeId + * Get a connected NdbTransaction to nodeId * Returns NULL if none found */ - NdbConnection* getConnectedNdbConnection(Uint32 nodeId); + NdbTransaction* getConnectedNdbTransaction(Uint32 nodeId); // Release and disconnect from DBTC a connection // and seize it to theConIdleList - void releaseConnectToNdb (NdbConnection* aConnectConnection); + void releaseConnectToNdb (NdbTransaction*); // Release a connection to idle list - void releaseNdbCon (NdbConnection* aConnection); + void releaseNdbCon (NdbTransaction*); int checkInitState(); // Check that we are initialized void report_node_failure(Uint32 node_id); // Report Failed node @@ -1535,15 +1537,15 @@ private: int NDB_connect(); // Perform connect towards NDB Kernel - // Release arrays of NdbConnection pointers + // Release arrays of NdbTransaction pointers void releaseTransactionArrays(); - Uint32 pollCompleted(NdbConnection** aCopyArray); + Uint32 pollCompleted(NdbTransaction** aCopyArray); void sendPrepTrans(int forceSend); - void reportCallback(NdbConnection** aCopyArray, Uint32 aNoOfComplTrans); + void reportCallback(NdbTransaction** aCopyArray, Uint32 aNoOfComplTrans); void waitCompletedTransactions(int milliSecs, int noOfEventsToWaitFor); - void completedTransaction(NdbConnection* aTransaction); - void completedScanTransaction(NdbConnection* aTransaction); + void completedTransaction(NdbTransaction* aTransaction); + void completedScanTransaction(NdbTransaction* aTransaction); void abortTransactionsAfterNodeFailure(Uint16 aNodeId); @@ -1565,7 +1567,7 @@ private: void* int2void (Uint32 val); NdbReceiver* void2rec (void* val); - NdbConnection* void2con (void* val); + NdbTransaction* void2con (void* val); NdbOperation* void2rec_op (void* val); NdbIndexOperation* void2rec_iop (void* val); @@ -1575,9 +1577,9 @@ private: NdbObjectIdMap* theNdbObjectIdMap; Ndb_cluster_connection *m_ndb_cluster_connection; - NdbConnection** thePreparedTransactionsArray; - NdbConnection** theSentTransactionsArray; - NdbConnection** theCompletedTransactionsArray; + NdbTransaction** thePreparedTransactionsArray; + NdbTransaction** theSentTransactionsArray; + NdbTransaction** theCompletedTransactionsArray; Uint32 theNoOfPreparedTransactions; Uint32 theNoOfSentTransactions; @@ -1603,21 +1605,21 @@ private: class NdbDictionaryImpl* theDictionary; class NdbGlobalEventBufferHandle* theGlobalEventBufferHandle; - NdbConnection* theConIdleList; // First connection in idle list. + NdbTransaction* theConIdleList; // First connection in idle list. NdbOperation* theOpIdleList; // First operation in the idle list. NdbIndexScanOperation* theScanOpIdleList; // First scan operation in the idle list. NdbIndexOperation* theIndexOpIdleList; // First index operation in the idle list. - NdbConnection* theTransactionList; - NdbConnection** theConnectionArray; + NdbTransaction* theTransactionList; + NdbTransaction** theConnectionArray; NdbRecAttr* theRecAttrIdleList; NdbApiSignal* theSignalIdleList; // First signal in idlelist. NdbLabel* theLabelList; // First label descriptor in list NdbBranch* theBranchList; // First branch descriptor in list NdbSubroutine* theSubroutineList; // First subroutine descriptor in NdbCall* theCallList; // First call descriptor in list - NdbReceiver* theScanList; + NdbReceiver* theScanList; NdbBlob* theNdbBlobIdleList; Uint32 theMyRef; // My block reference diff --git a/ndb/include/ndbapi/NdbApi.hpp b/ndb/include/ndbapi/NdbApi.hpp index c6c6bfdd546..8d0c9752b0f 100644 --- a/ndb/include/ndbapi/NdbApi.hpp +++ b/ndb/include/ndbapi/NdbApi.hpp @@ -19,7 +19,7 @@ #include "ndbapi_limits.h" #include "Ndb.hpp" -#include "NdbConnection.hpp" +#include "NdbTransaction.hpp" #include "NdbOperation.hpp" #include "NdbScanOperation.hpp" #include "NdbIndexOperation.hpp" diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp index 132df59c349..4f8da2c6454 100644 --- a/ndb/include/ndbapi/NdbBlob.hpp +++ b/ndb/include/ndbapi/NdbBlob.hpp @@ -19,11 +19,11 @@ #include <ndb_types.h> #include <NdbDictionary.hpp> -#include <NdbConnection.hpp> +#include <NdbTransaction.hpp> #include <NdbError.hpp> class Ndb; -class NdbConnection; +class NdbTransaction; class NdbOperation; class NdbRecAttr; class NdbTableImpl; @@ -67,7 +67,7 @@ class NdbColumnImpl; * cases NdbBlob is forced to do implicit executes. To avoid this, * operate on complete blob parts. * - * Use NdbConnection::executePendingBlobOps to flush your reads and + * Use NdbTransaction::executePendingBlobOps to flush your reads and * writes. It avoids execute penalty if nothing is pending. It is not * needed after execute (obviously) or after next scan result. * @@ -212,12 +212,14 @@ public: NdbBlob* blobsNextBlob(); private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; friend class NdbOperation; friend class NdbScanOperation; friend class NdbDictionaryImpl; friend class NdbResultSet; // atNextResult +#endif // state State theState; void setState(State newState); @@ -226,7 +228,7 @@ private: static void getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c); // ndb api stuff Ndb* theNdb; - NdbConnection* theNdbCon; + NdbTransaction* theNdbCon; NdbOperation* theNdbOp; const NdbTableImpl* theTable; const NdbTableImpl* theAccessTable; @@ -316,7 +318,7 @@ private: // callbacks int invokeActiveHook(); // blob handle maintenance - int atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn); + int atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn); int preExecute(ExecType anExecType, bool& batch); int postExecute(ExecType anExecType); int preCommit(); @@ -324,7 +326,7 @@ private: // errors void setErrorCode(int anErrorCode, bool invalidFlag = true); void setErrorCode(NdbOperation* anOp, bool invalidFlag = true); - void setErrorCode(NdbConnection* aCon, bool invalidFlag = true); + void setErrorCode(NdbTransaction* aCon, bool invalidFlag = true); #ifdef VM_TRACE int getOperationType() const; friend class NdbOut& operator<<(NdbOut&, const NdbBlob&); diff --git a/ndb/include/ndbapi/NdbCursorOperation.hpp b/ndb/include/ndbapi/NdbCursorOperation.hpp deleted file mode 100644 index e7eeb54ba2d..00000000000 --- a/ndb/include/ndbapi/NdbCursorOperation.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef NdbCursorOperation_H -#define NdbCursorOperation_H - -#endif diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index f12cff8584f..f160e39ae36 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -388,8 +388,10 @@ public: #endif private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbRecAttr; friend class NdbColumnImpl; +#endif class NdbColumnImpl & m_impl; Column(NdbColumnImpl&); Column& operator=(const Column&); @@ -646,7 +648,9 @@ public: #endif private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbTableImpl; +#endif class NdbTableImpl & m_impl; Table(NdbTableImpl&); }; @@ -798,8 +802,9 @@ public: virtual int getObjectVersion() const; private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbIndexImpl; - +#endif class NdbIndexImpl & m_impl; Index(NdbIndexImpl&); }; @@ -851,8 +856,10 @@ public: void print(); private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbEventImpl; friend class NdbEventOperationImpl; +#endif class NdbEventImpl & m_impl; Event(NdbEventImpl&); }; @@ -1071,9 +1078,11 @@ public: ~Dictionary(); private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbDictionaryImpl; friend class UtilTransactions; friend class NdbBlob; +#endif class NdbDictionaryImpl & m_impl; Dictionary(NdbDictionaryImpl&); const Table * getIndexTable(const char * indexName, diff --git a/ndb/include/ndbapi/NdbEventOperation.hpp b/ndb/include/ndbapi/NdbEventOperation.hpp index 6a2e7d56ca8..759e8e70351 100644 --- a/ndb/include/ndbapi/NdbEventOperation.hpp +++ b/ndb/include/ndbapi/NdbEventOperation.hpp @@ -203,8 +203,10 @@ public: void print(); private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbEventOperationImpl; friend class Ndb; +#endif NdbEventOperation(Ndb *theNdb, const char* eventName,int bufferLength); ~NdbEventOperation(); static int wait(void *p, int aMillisecondNumber); diff --git a/ndb/include/ndbapi/NdbIndexOperation.hpp b/ndb/include/ndbapi/NdbIndexOperation.hpp index 4c81282caa9..0ae527516b9 100644 --- a/ndb/include/ndbapi/NdbIndexOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexOperation.hpp @@ -14,18 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/***************************************************************************** - * Name: NdbIndexOperation.hpp - * Include: - * Link: - * Author: Martin Sköld - * Date: 2002-04-01 - * Version: 0.1 - * Description: Secondary index support - * Documentation: - * Adjust: 2002-04-01 Martin Sköld First version. - ****************************************************************************/ - #ifndef NdbIndexOperation_H #define NdbIndexOperation_H @@ -40,8 +28,10 @@ class NdbResultSet; */ class NdbIndexOperation : public NdbOperation { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; +#endif public: /** @@ -54,16 +44,17 @@ public: /** * Define the NdbIndexOperation to be a standard operation of type readTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * reads a tuple. * * @return 0 if successful otherwise -1. */ int readTuple(LockMode); +#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** * Define the NdbIndexOperation to be a standard operation of type readTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * reads a tuple. * * @return 0 if successful otherwise -1. @@ -73,7 +64,7 @@ public: /** * Define the NdbIndexOperation to be a standard operation of type * readTupleExclusive. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * read a tuple using an exclusive lock. * * @return 0 if successful otherwise -1. @@ -82,7 +73,7 @@ public: /** * Define the NdbIndexOperation to be a standard operation of type simpleRead. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * reads an existing tuple (using shared read lock), * but releases lock immediately after read. * @@ -101,7 +92,7 @@ public: /** * Define the NdbOperation to be a standard operation of type committedRead. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * read latest committed value of the record. * * This means that if another transaction is updating the @@ -113,7 +104,6 @@ public: */ int dirtyRead(); -#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED int committedRead(); #endif @@ -121,7 +111,7 @@ public: * Define the NdbIndexOperation to be a standard operation of type * updateTuple. * - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * updates a tuple in the table. * * @return 0 if successful otherwise -1. @@ -132,7 +122,7 @@ public: * Define the NdbIndexOperation to be a standard operation of type * deleteTuple. * - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * deletes a tuple. * * @return 0 if successful otherwise -1. @@ -143,7 +133,7 @@ public: * Define the NdbIndexOperation to be a standard operation of type * dirtyUpdate. * - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * updates without two-phase commit. * * @return 0 if successful otherwise -1. @@ -181,7 +171,7 @@ private: // Overloaded methods from NdbCursorOperation int indxInit(const class NdbIndexImpl* anIndex, const class NdbTableImpl* aTable, - NdbConnection* myConnection); + NdbTransaction*); int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId); diff --git a/ndb/include/ndbapi/NdbIndexScanOperation.hpp b/ndb/include/ndbapi/NdbIndexScanOperation.hpp index 140d86f4a35..c94f48ea06b 100644 --- a/ndb/include/ndbapi/NdbIndexScanOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexScanOperation.hpp @@ -24,11 +24,14 @@ * @brief Class of scan operations for use to scan ordered index */ class NdbIndexScanOperation : public NdbScanOperation { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; friend class NdbResultSet; friend class NdbOperation; friend class NdbScanOperation; +#endif + public: /** * readTuples returns a NdbResultSet where tuples are stored. @@ -50,6 +53,7 @@ public: bool order_desc = false, bool read_range_no = false); +#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED inline int readTuples(int parallell){ return readTuples(LM_Read, 0, parallell, false); } @@ -57,6 +61,7 @@ public: inline int readTuplesExclusive(int parallell = 0){ return readTuples(LM_Exclusive, 0, parallell, false); } +#endif /** * Type of ordered index key bound. The values (0-4) will not change diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index 053413af090..a1d5541f6ac 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -27,7 +27,7 @@ class Ndb; class NdbApiSignal; class NdbRecAttr; class NdbOperation; -class NdbConnection; +class NdbTransaction; class NdbColumnImpl; class NdbBlob; @@ -37,14 +37,17 @@ class NdbBlob; */ class NdbOperation { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; friend class NdbScanOperation; friend class NdbScanReceiver; friend class NdbScanFilter; friend class NdbScanFilterImpl; friend class NdbReceiver; friend class NdbBlob; +#endif + public: /** * @name Define Standard Operation Type @@ -66,7 +69,7 @@ public: /** * Define the NdbOperation to be a standard operation of type insertTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * adds a new tuple to the table. * * @return 0 if successful otherwise -1. @@ -75,7 +78,7 @@ public: /** * Define the NdbOperation to be a standard operation of type updateTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * updates a tuple in the table. * * @return 0 if successful otherwise -1. @@ -84,7 +87,7 @@ public: /** * Define the NdbOperation to be a standard operation of type writeTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * writes a tuple to the table. * If the tuple exists, it updates it, otherwise an insert takes place. * @@ -94,7 +97,7 @@ public: /** * Define the NdbOperation to be a standard operation of type deleteTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * delete a tuple. * * @return 0 if successful otherwise -1. @@ -103,7 +106,7 @@ public: /** * Define the NdbOperation to be a standard operation of type readTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * reads a tuple. * * @return 0 if successful otherwise -1. @@ -112,17 +115,18 @@ public: /** * Define the NdbOperation to be a standard operation of type readTuple. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * reads a tuple. * * @return 0 if successful otherwise -1. */ virtual int readTuple(); +#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** * Define the NdbOperation to be a standard operation of type * readTupleExclusive. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * read a tuple using an exclusive lock. * * @return 0 if successful otherwise -1. @@ -132,7 +136,7 @@ public: /** * Define the NdbOperation to be a standard operation of type * simpleRead. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * reads an existing tuple (using shared read lock), * but releases lock immediately after read. * @@ -149,10 +153,9 @@ public: */ virtual int simpleRead(); -#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** * Define the NdbOperation to be a standard operation of type committedRead. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * read latest committed value of the record. * * This means that if another transaction is updating the @@ -169,7 +172,7 @@ public: /** * Define the NdbOperation to be a standard operation of type committedRead. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * read latest committed value of the record. * * This means that if another transaction is updating the @@ -183,7 +186,7 @@ public: /** * Define the NdbOperation to be a standard operation of type dirtyUpdate. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * updates without two-phase commit. * * @return 0 if successful otherwise -1. @@ -192,7 +195,7 @@ public: /** * Define the NdbOperation to be a standard operation of type dirtyWrite. - * When calling NdbConnection::execute, this operation + * When calling NdbTransaction::execute, this operation * writes without two-phase commit. * * @return 0 if successful otherwise -1. @@ -301,7 +304,7 @@ public: * @note This method does not fetch the attribute value from * the database! The NdbRecAttr object returned by this method * is <em>not</em> readable/printable before the - * transaction has been executed with NdbConnection::execute. + * transaction has been executed with NdbTransaction::execute. * * @param anAttrName Attribute name * @param aValue If this is non-NULL, then the attribute value @@ -743,7 +746,7 @@ protected: //-------------------------------------------------------------- // Initialise after allocating operation to a transaction //-------------------------------------------------------------- - int init(const class NdbTableImpl*, NdbConnection* aCon); + int init(const class NdbTableImpl*, NdbTransaction* aCon); void initInterpreter(); void next(NdbOperation*); // Set next pointer @@ -775,7 +778,7 @@ protected: void Status(OperationStatus); // Set the status information - void NdbCon(NdbConnection*); // Set reference to connection + void NdbCon(NdbTransaction*); // Set reference to connection // object. virtual void release(); // Release all operations @@ -812,7 +815,7 @@ protected: virtual int equal_impl(const NdbColumnImpl*,const char* aValue, Uint32 len); virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0); int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); - NdbBlob* getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* anAttrObject); + NdbBlob* getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* anAttrObject); int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue); int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); @@ -861,7 +864,7 @@ protected: int theErrorLine; // Error line Ndb* theNdb; // Point back to the Ndb object. - NdbConnection* theNdbCon; // Point back to the connection object. + NdbTransaction* theNdbCon; // Point back to the connection object. NdbOperation* theNext; // Next pointer to operation. union { @@ -1043,14 +1046,14 @@ NdbOperation::Status( OperationStatus aStatus ) } /****************************************************************************** -void NdbCon(NdbConnection* aNdbCon); +void NdbCon(NdbTransaction* aNdbCon); -Parameters: aNdbCon: Pointers to NdbConnection object. +Parameters: aNdbCon: Pointers to NdbTransaction object. Remark: Set the reference to the connection in the operation object. ******************************************************************************/ inline void -NdbOperation::NdbCon(NdbConnection* aNdbCon) +NdbOperation::NdbCon(NdbTransaction* aNdbCon) { theNdbCon = aNdbCon; } diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 85b11d52bc1..71c4d4e1247 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -34,7 +34,7 @@ class NdbOperation; * MyRecAttr = MyOperation->getValue("ATTR2", NULL); * if (MyRecAttr == NULL) goto error; * - * if (MyConnection->execute(Commit) == -1) goto error; + * if (MyTransaction->execute(Commit) == -1) goto error; * * ndbout << MyRecAttr->u_32_value(); * @endcode @@ -43,14 +43,14 @@ class NdbOperation; * @ref ndbapi_example2.cpp. * * @note The NdbRecAttr object is instantiated with its value when - * NdbConnection::execute is called. Before this, the value is + * NdbTransaction::execute is called. Before this, the value is * undefined. (NdbRecAttr::isNULL can be used to check * if the value is defined or not.) * This means that an NdbRecAttr object only has valid information - * between the time of calling NdbConnection::execute and + * between the time of calling NdbTransaction::execute and * the time of Ndb::closeTransaction. * The value of the null indicator is -1 until the - * NdbConnection::execute method have been called. + * NdbTransaction::execute method have been called. * * For simple types, there are methods which directly getting the value * from the NdbRecAttr object. @@ -72,12 +72,14 @@ class NdbOperation; */ class NdbRecAttr { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbOperation; friend class NdbIndexScanOperation; friend class NdbEventOperationImpl; friend class NdbReceiver; friend class Ndb; friend class NdbOut& operator<<(class NdbOut&, const class AttributeS&); +#endif public: /** @@ -124,7 +126,7 @@ public: * Check if attribute value is NULL. * * @return -1 = Not defined (Failure or - * NdbConnection::execute not yet called).<br> + * NdbTransaction::execute not yet called).<br> * 0 = Attribute value is defined, but not equal to NULL.<br> * 1 = Attribute value is defined and equal to NULL. */ diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index dba53bae4a6..a02a162491d 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -22,16 +22,18 @@ #include <ndb_global.h> class Ndb; -class NdbConnection; +class NdbTransaction; class NdbReceiver { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class Ndb; friend class NdbOperation; friend class NdbScanOperation; friend class NdbIndexOperation; friend class NdbIndexScanOperation; - friend class NdbConnection; + friend class NdbTransaction; +#endif public: enum ReceiverType { NDB_UNINITIALIZED, NDB_OPERATION = 1, @@ -52,7 +54,7 @@ public: return m_type; } - inline NdbConnection * getTransaction(); + inline NdbTransaction * getTransaction(); void* getOwner(){ return m_owner; } diff --git a/ndb/include/ndbapi/NdbScanFilter.hpp b/ndb/include/ndbapi/NdbScanFilter.hpp index 9f8a01b1059..02190f88b9a 100644 --- a/ndb/include/ndbapi/NdbScanFilter.hpp +++ b/ndb/include/ndbapi/NdbScanFilter.hpp @@ -169,7 +169,9 @@ public: /** @} *********************************************************************/ private: +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbScanFilterImpl; +#endif class NdbScanFilterImpl & m_impl; NdbScanFilter& operator=(const NdbScanFilter&); ///< Defined not implemented }; diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index 1b61192c99c..dd3d0e0001d 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -39,11 +39,14 @@ class NdbResultSet; * @brief Class of scan operations for use in transactions. */ class NdbScanOperation : public NdbOperation { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class Ndb; - friend class NdbConnection; + friend class NdbTransaction; friend class NdbResultSet; friend class NdbOperation; friend class NdbBlob; +#endif + public: /** * readTuples returns a NdbResultSet where tuples are stored. @@ -58,6 +61,7 @@ public: int readTuples(LockMode = LM_Read, Uint32 batch = 0, Uint32 parallel = 0); +#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED inline int readTuples(int parallell){ return readTuples(LM_Read, 0, parallell); } @@ -65,9 +69,12 @@ public: inline int readTuplesExclusive(int parallell = 0){ return readTuples(LM_Exclusive, 0, parallell); } +#endif +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL NdbBlob* getBlobHandle(const char* anAttrName); NdbBlob* getBlobHandle(Uint32 anAttrId); +#endif /** * Get the next tuple in a scan transaction. @@ -145,7 +152,7 @@ public: * @return an NdbOperation or NULL. */ NdbOperation* updateCurrentTuple(); - NdbOperation* updateCurrentTuple(NdbConnection* updateTrans); + NdbOperation* updateCurrentTuple(NdbTransaction* updateTrans); /** * Transfer scan operation to a deleting transaction. Use this function @@ -164,7 +171,7 @@ public: * @return an NdbOperation or NULL. */ int deleteCurrentTuple(); - int deleteCurrentTuple(NdbConnection* takeOverTransaction); + int deleteCurrentTuple(NdbTransaction* takeOverTransaction); protected: NdbScanOperation(Ndb* aNdb); @@ -179,7 +186,7 @@ protected: int executeCursor(int ProcessorId); // Overloaded private methods from NdbOperation - int init(const NdbTableImpl* tab, NdbConnection* myConnection); + int init(const NdbTableImpl* tab, NdbTransaction*); int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId); int doSend(int ProcessorId); void checkForceSend(bool forceSend); @@ -187,7 +194,7 @@ protected: virtual void setErrorCode(int aErrorCode); virtual void setErrorCodeAbort(int aErrorCode); - NdbConnection *m_transConnection; + NdbTransaction *m_transConnection; // Scan related variables Uint32 theParallelism; @@ -230,7 +237,7 @@ protected: void execCLOSE_SCAN_REP(); int getKeyFromKEYINFO20(Uint32* data, unsigned size); - NdbOperation* takeOverScanOp(OperationType opType, NdbConnection*); + NdbOperation* takeOverScanOp(OperationType opType, NdbTransaction*); bool m_ordered; bool m_descending; @@ -245,7 +252,7 @@ NdbScanOperation::updateCurrentTuple(){ inline NdbOperation* -NdbScanOperation::updateCurrentTuple(NdbConnection* takeOverTrans){ +NdbScanOperation::updateCurrentTuple(NdbTransaction* takeOverTrans){ return takeOverScanOp(NdbOperation::UpdateRequest, takeOverTrans); } @@ -258,7 +265,7 @@ NdbScanOperation::deleteCurrentTuple(){ inline int -NdbScanOperation::deleteCurrentTuple(NdbConnection * takeOverTrans){ +NdbScanOperation::deleteCurrentTuple(NdbTransaction * takeOverTrans){ void * res = takeOverScanOp(NdbOperation::DeleteRequest, takeOverTrans); if(res == 0) diff --git a/ndb/include/ndbapi/NdbTransaction.hpp b/ndb/include/ndbapi/NdbTransaction.hpp index 2a9a39a1a49..f028a119961 100644 --- a/ndb/include/ndbapi/NdbTransaction.hpp +++ b/ndb/include/ndbapi/NdbTransaction.hpp @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NdbConnection_H -#define NdbConnection_H +#ifndef NdbTransaction_H +#define NdbTransaction_H #include <ndb_types.h> #include <NdbError.hpp> #include <NdbDictionary.hpp> -class NdbConnection; +class NdbTransaction; class NdbOperation; class NdbScanOperation; class NdbIndexScanOperation; @@ -30,17 +30,16 @@ class NdbApiSignal; class Ndb; class NdbBlob; - #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // to be documented later /** * NdbAsynchCallback functions are used when executing asynchronous - * transactions (using NdbConnection::executeAsynchPrepare, or - * NdbConnection::executeAsynch). + * transactions (using NdbTransaction::executeAsynchPrepare, or + * NdbTransaction::executeAsynch). * The functions are called when the execute has finished. * See @ref secAsync for more information. */ -typedef void (* NdbAsynchCallback)(int, NdbConnection*, void*); +typedef void (* NdbAsynchCallback)(int, NdbTransaction*, void*); #endif /** @@ -73,37 +72,37 @@ enum ExecType { /** - * @class NdbConnection + * @class NdbTransaction * @brief Represents a transaction. * - * A transaction (represented by an NdbConnection object) + * A transaction (represented by an NdbTransaction object) * belongs to an Ndb object and is typically created using * Ndb::startTransaction. * A transaction consists of a list of operations * (represented by NdbOperation objects). * Each operation access exactly one table. * - * After getting the NdbConnection object, + * After getting the NdbTransaction object, * the first step is to get (allocate) an operation given the table name. * Then the operation is defined. * Several operations can be defined in parallel on the same - * NdbConnection object. - * When all operations are defined, the NdbConnection::execute + * NdbTransaction object. + * When all operations are defined, the NdbTransaction::execute * method sends them to the NDB kernel for execution. * - * The NdbConnection::execute method returns when the NDB kernel has + * The NdbTransaction::execute method returns when the NDB kernel has * completed execution of all operations defined before the call to - * NdbConnection::execute. + * NdbTransaction::execute. * All allocated operations should be properly defined - * before calling NdbConnection::execute. + * before calling NdbTransaction::execute. * - * A call to NdbConnection::execute uses one out of three types of execution: + * A call to NdbTransaction::execute uses one out of three types of execution: * -# ExecType::NoCommit Executes operations without committing them. * -# ExecType::Commit Executes remaining operation and commits the * complete transaction * -# ExecType::Rollback Rollbacks the entire transaction. * - * NdbConnection::execute is equipped with an extra error handling parameter + * NdbTransaction::execute is equipped with an extra error handling parameter * There are two alternatives: * -# AbortOption::AbortOnError (default). * The transaction is aborted if there are any error during the @@ -111,28 +110,28 @@ enum ExecType { * -# AbortOption::IgnoreError * Continue execution of transaction even if operation fails * - * NdbConnection::execute can sometimes indicate an error - * (return with -1) while the error code on the NdbConnection is 0. + * NdbTransaction::execute can sometimes indicate an error + * (return with -1) while the error code on the NdbTransaction is 0. * This is an indication that one of the operations found a record * problem. The transaction is still ok and can continue as usual. - * The NdbConnection::execute returns -1 together with error code - * on NdbConnection object equal to 0 always means that an + * The NdbTransaction::execute returns -1 together with error code + * on NdbTransaction object equal to 0 always means that an * operation was not successful but that the total transaction was OK. * By checking error codes on the individual operations it is possible * to find out which operation was not successful. * - * NdbConnection::executeScan is used to setup a scan in the NDB kernel + * NdbTransaction::executeScan is used to setup a scan in the NDB kernel * after it has been defined. - * NdbConnection::nextScanResult is used to iterate through the + * NdbTransaction::nextScanResult is used to iterate through the * scanned tuples. - * After each call to NdbConnection::nextScanResult, the pointers + * After each call to NdbTransaction::nextScanResult, the pointers * of NdbRecAttr objects defined in the NdbOperation::getValue * operations are updated with the values of the new the scanned tuple. */ /* FUTURE IMPLEMENTATION: * Later a prepare mode will be added when Ndb supports Prepare-To-Commit - * The NdbConnection can deliver the Transaction Id of the transaction. + * The NdbTransaction can deliver the Transaction Id of the transaction. * After committing a transaction it is also possible to retrieve the * global transaction checkpoint which the transaction was put in. * @@ -151,21 +150,23 @@ enum ExecType { * not known the table of the tuple. As long as the table is * derived from the known base class everything is ok. * It is not possible to provide any primary key since it is - * already supplied with the call to NdbConnection::getNdbOperation. + * already supplied with the call to NdbTransaction::getNdbOperation. * -# The third method is used when a scanned tuple is to be transferred to * another transaction. In this case it is not possible to define the * primary key since it came along from the scanned tuple. * */ -class NdbConnection +class NdbTransaction { +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class Ndb; friend class NdbOperation; friend class NdbScanOperation; friend class NdbIndexOperation; friend class NdbIndexScanOperation; friend class NdbBlob; - +#endif + public: /** @@ -195,7 +196,7 @@ public: /** * Get an operation from NdbScanOperation idlelist and - * get the NdbConnection object which + * get the NdbTransaction object which * was fetched by startTransaction pointing to this operation. * * @param aTableName The table name. @@ -205,7 +206,7 @@ public: /** * Get an operation from NdbScanOperation idlelist and - * get the NdbConnection object which + * get the NdbTransaction object which * was fetched by startTransaction pointing to this operation. * * @param aTable @@ -216,7 +217,7 @@ public: /** * Get an operation from NdbIndexScanOperation idlelist and - * get the NdbConnection object which + * get the NdbTransaction object which * was fetched by startTransaction pointing to this operation. * * @param anIndexName The index name. @@ -228,7 +229,7 @@ public: /** * Get an operation from NdbIndexScanOperation idlelist and - * get the NdbConnection object which + * get the NdbTransaction object which * was fetched by startTransaction pointing to this operation. * * @param anIndex @@ -243,7 +244,7 @@ public: /** * Get an operation from NdbIndexOperation idlelist and - * get the NdbConnection object that + * get the NdbTransaction object that * was fetched by startTransaction pointing to this operation. * * @param anIndexName The index name (as created by createIndex). @@ -256,7 +257,7 @@ public: /** * Get an operation from NdbIndexOperation idlelist and - * get the NdbConnection object that + * get the NdbTransaction object that * was fetched by startTransaction pointing to this operation. * * @param anIndex @@ -333,10 +334,10 @@ public: * Prepare and send an asynchronous transaction. * * This method perform the same action as - * NdbConnection::executeAsynchPrepare + * NdbTransaction::executeAsynchPrepare * but also sends the operations to the NDB kernel. * - * See NdbConnection::executeAsynchPrepare for information + * See NdbTransaction::executeAsynchPrepare for information * about the parameters of this method. * * See @ref secAsync for more information on @@ -361,12 +362,12 @@ public: /** * Close transaction - * @note It is not allowed to call NdbConnection::close after sending the + * @note It is not allowed to call NdbTransaction::close after sending the * transaction asynchronously before the callback method has * been called. * (The application should keep track of the number of * outstanding transactions and wait until all of them - * has completed before calling NdbConnection::close). + * has completed before calling NdbTransaction::close). * If the transaction is not committed it will be aborted. */ void close(); @@ -406,7 +407,7 @@ public: * (This is because no updates are performed in scan transactions.) * * @return GCI of transaction or -1 if GCI is not available. - * (Note that there has to be an NdbConnection::execute call + * (Note that there has to be an NdbTransaction::execute call * with Ndb::Commit for the GCI to be available.) */ int getGCI(); @@ -450,7 +451,7 @@ public: /** * Get the latest NdbOperation which had an error. - * This method is used on the NdbConnection object to find the + * This method is used on the NdbTransaction object to find the * NdbOperation causing an error. * To find more information about the * actual error, use method NdbOperation::getNdbError @@ -472,9 +473,9 @@ public: * * This method should only be used <em>after</em> a transaction * has been executed. - * - NdbConnection::getNextCompletedOperation(NULL) returns the + * - NdbTransaction::getNextCompletedOperation(NULL) returns the * first NdbOperation object. - * - NdbConnection::getNextCompletedOperation(op) returns the + * - NdbTransaction::getNextCompletedOperation(op) returns the * NdbOperation object defined after the NdbOperation "op". * * This method is typically used to fetch all NdbOperation:s of @@ -519,9 +520,9 @@ private: * These are the create and delete methods of this class. * **************************************************************************/ - NdbConnection(Ndb* aNdb); + NdbTransaction(Ndb* aNdb); - ~NdbConnection(); + ~NdbTransaction(); void init(); // Initialize connection object for new transaction @@ -541,8 +542,8 @@ private: int getTC_ConnectPtr(); // Gets TC Connect pointer void setBuddyConPtr(Uint32); // Sets Buddy Con Ptr Uint32 getBuddyConPtr(); // Gets Buddy Con Ptr - NdbConnection* next(); // Returns the next pointer - void next(NdbConnection*); // Sets the next pointer + NdbTransaction* next(); // Returns the next pointer + void next(NdbTransaction*); // Sets the next pointer enum ConStatusType { NotConnected, @@ -653,7 +654,7 @@ private: NdbOperation* theErrorOperation; // The NdbOperation where the error occurred Ndb* theNdb; // Pointer to Ndb object - NdbConnection* theNext; // Next pointer. Used in idle list. + NdbTransaction* theNext; // Next pointer. Used in idle list. NdbOperation* theFirstOpInList; // First operation in defining list. NdbOperation* theLastOpInList; // Last operation in defining list. @@ -746,14 +747,14 @@ private: inline Uint32 -NdbConnection::get_send_size() +NdbTransaction::get_send_size() { return 0; } inline void -NdbConnection::set_send_size(Uint32 send_size) +NdbTransaction::set_send_size(Uint32 send_size) { return; } @@ -764,7 +765,7 @@ NdbConnection::set_send_size(Uint32 send_size) inline int -NdbConnection::checkMagicNumber() +NdbTransaction::checkMagicNumber() { if (theMagicNumber == 0x37412619) return 0; @@ -778,7 +779,7 @@ NdbConnection::checkMagicNumber() inline bool -NdbConnection::checkState_TransId(const Uint32 * transId) const { +NdbTransaction::checkState_TransId(const Uint32 * transId) const { const Uint32 tTmp1 = transId[0]; const Uint32 tTmp2 = transId[1]; Uint64 tRecTransId = (Uint64)tTmp1 + ((Uint64)tTmp2 << 32); @@ -793,14 +794,14 @@ Remark: Set the transaction identity. ************************************************************************************************/ inline void -NdbConnection::setTransactionId(Uint64 aTransactionId) +NdbTransaction::setTransactionId(Uint64 aTransactionId) { theTransactionId = aTransactionId; } inline void -NdbConnection::setConnectedNodeId(Uint32 aNode, Uint32 aSequenceNo) +NdbTransaction::setConnectedNodeId(Uint32 aNode, Uint32 aSequenceNo) { theDBnode = aNode; theNodeSequence = aSequenceNo; @@ -813,7 +814,7 @@ Remark: Get Connected node id. ******************************************************************************/ inline Uint32 -NdbConnection::getConnectedNodeId() +NdbTransaction::getConnectedNodeId() { return theDBnode; } @@ -825,7 +826,7 @@ Remark: Set my block refrerence. ******************************************************************************/ inline void -NdbConnection::setMyBlockReference(int aBlockRef) +NdbTransaction::setMyBlockReference(int aBlockRef) { theMyRef = aBlockRef; } @@ -837,7 +838,7 @@ Remark: Sets TC Connect pointer. ******************************************************************************/ inline void -NdbConnection::setTC_ConnectPtr(Uint32 aTCConPtr) +NdbTransaction::setTC_ConnectPtr(Uint32 aTCConPtr) { theTCConPtr = aTCConPtr; } @@ -850,61 +851,61 @@ Remark: Gets TC Connect pointer. ******************************************************************************/ inline int -NdbConnection::getTC_ConnectPtr() +NdbTransaction::getTC_ConnectPtr() { return theTCConPtr; } inline void -NdbConnection::setBuddyConPtr(Uint32 aBuddyConPtr) +NdbTransaction::setBuddyConPtr(Uint32 aBuddyConPtr) { theBuddyConPtr = aBuddyConPtr; } inline -Uint32 NdbConnection::getBuddyConPtr() +Uint32 NdbTransaction::getBuddyConPtr() { return theBuddyConPtr; } /****************************************************************************** -NdbConnection* next(); +NdbTransaction* next(); inline void -NdbConnection::setBuddyConPtr(Uint32 aBuddyConPtr) +NdbTransaction::setBuddyConPtr(Uint32 aBuddyConPtr) { theBuddyConPtr = aBuddyConPtr; } inline -Uint32 NdbConnection::getBuddyConPtr() +Uint32 NdbTransaction::getBuddyConPtr() { return theBuddyConPtr; } -Return Value: Return next pointer to NdbConnection object. +Return Value: Return next pointer to NdbTransaction object. Remark: Get the next pointer. ******************************************************************************/ inline -NdbConnection* -NdbConnection::next() +NdbTransaction* +NdbTransaction::next() { return theNext; } /****************************************************************************** -void next(NdbConnection aConnection); +void next(NdbTransaction aTransaction); -Parameters: aConnection: The connection object. +Parameters: aTransaction: The connection object. Remark: Sets the next pointer. ******************************************************************************/ inline void -NdbConnection::next(NdbConnection* aConnection) +NdbTransaction::next(NdbTransaction* aTransaction) { - theNext = aConnection; + theNext = aTransaction; } /****************************************************************************** @@ -915,8 +916,8 @@ Parameters: aStatus: The status. Remark: Sets Connect status. ******************************************************************************/ inline -NdbConnection::ConStatusType -NdbConnection::Status() +NdbTransaction::ConStatusType +NdbTransaction::Status() { return theStatus; } @@ -929,7 +930,7 @@ Remark: Sets Connect status. ******************************************************************************/ inline void -NdbConnection::Status( ConStatusType aStatus ) +NdbTransaction::Status( ConStatusType aStatus ) { theStatus = aStatus; } @@ -942,7 +943,7 @@ Remark: Set global checkpoint identity of the transaction ******************************************************************************/ inline void -NdbConnection::setGCI(int aGlobalCheckpointId) +NdbTransaction::setGCI(int aGlobalCheckpointId) { theGlobalCheckpointId = aGlobalCheckpointId; } @@ -954,7 +955,7 @@ Remark: An operation was sent with success that expects a response. ******************************************************************************/ inline void -NdbConnection::OpSent() +NdbTransaction::OpSent() { theNoOfOpSent++; } @@ -965,7 +966,7 @@ void executePendingBlobOps(); #include <stdlib.h> inline int -NdbConnection::executePendingBlobOps(Uint8 flags) +NdbTransaction::executePendingBlobOps(Uint8 flags) { if (thePendingBlobOps & flags) { // not executeNoBlobs because there can be new ops with blobs @@ -976,8 +977,10 @@ NdbConnection::executePendingBlobOps(Uint8 flags) inline Uint32 -NdbConnection::ptr2int(){ +NdbTransaction::ptr2int(){ return theId; } +typedef NdbTransaction NdbConnection; + #endif |