diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-12-17 09:55:23 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-12-17 09:55:23 +0100 |
commit | cd2e3aca3491b204e702b47713598513ab945e50 (patch) | |
tree | a941a0b0e8959bf30cd569ecb048d772a85f4156 /ndb/src/ndbapi/Ndbinit.cpp | |
parent | 4630d406d11a8e7c0e8dc4b8601fc8dd94e8a343 (diff) | |
download | mariadb-git-cd2e3aca3491b204e702b47713598513ab945e50.tar.gz |
moved some Ndb member variables to NdbImpl class
removed theCurrentConnectCounter
optimized the_release_ind by using pos[0] to indicate that there is something there
smaller storage of theDBNodes array by using Uint8
set the_relase_ind array to Uint32 to avoid possible parallell thread usage errors
Diffstat (limited to 'ndb/src/ndbapi/Ndbinit.cpp')
-rw-r--r-- | ndb/src/ndbapi/Ndbinit.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 48e62c36a5f..9754c25ab15 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -82,7 +82,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, { DBUG_ENTER("Ndb::setup"); - theNdbObjectIdMap= 0; m_ndb_cluster_connection= ndb_cluster_connection; thePreparedTransactionsArray= NULL; theSentTransactionsArray= NULL; @@ -110,9 +109,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theCallList= NULL; theScanList= NULL; theNdbBlobIdleList= NULL; - theNoOfDBnodes= 0; - theDBnodes= NULL; - the_release_ind= NULL; the_last_check_time= 0; theFirstTransId= 0; theRestartGCI= 0; @@ -134,19 +130,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theError.code = 0; - theNdbObjectIdMap = new NdbObjectIdMap(1024,1024); theConnectionArray = new NdbConnection * [MAX_NDB_NODES]; - theDBnodes = new Uint32[MAX_NDB_NODES]; - the_release_ind = new Uint8[MAX_NDB_NODES]; theCommitAckSignal = NULL; - theCurrentConnectCounter = 1; - theCurrentConnectIndex = 0; int i; for (i = 0; i < MAX_NDB_NODES ; i++) { theConnectionArray[i] = NULL; - the_release_ind[i] = 0; - theDBnodes[i] = 0; }//forg for (i = 0; i < 2048 ; i++) { theFirstTupleId[i] = 0; @@ -213,7 +202,6 @@ Ndb::~Ndb() doDisconnect(); delete theDictionary; - delete theImpl; NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle); @@ -260,15 +248,12 @@ Ndb::~Ndb() startTransactionNodeSelectionData.release(); delete []theConnectionArray; - delete []theDBnodes; - delete []the_release_ind; if(theCommitAckSignal != NULL){ delete theCommitAckSignal; theCommitAckSignal = NULL; } - if(theNdbObjectIdMap != 0) - delete theNdbObjectIdMap; + delete theImpl; /** * This sleep is to make sure that the transporter @@ -307,4 +292,17 @@ NdbWaiter::~NdbWaiter(){ NdbCondition_Destroy(m_condition); } +NdbImpl::NdbImpl() : theNdbObjectIdMap(1024,1024), + theCurrentConnectIndex(0), + theNoOfDBnodes(0) +{ + int i; + for (i = 0; i < MAX_NDB_NODES; i++) { + the_release_ind[i] = 0; + } +} + +NdbImpl::~NdbImpl() +{ +} |