List:Commits« Previous MessageNext Message »
From:jonas oreland Date:February 24 2011 8:25am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:4231)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 4231 jonas oreland	2011-02-24
      ndb - remove TcIndxConf-struct and use TcKeyConf-struct instead...they are identical, and former serves no purpose (rather hinders progress)

    modified:
      storage/ndb/include/kernel/signaldata/TcIndx.hpp
      storage/ndb/include/ndbapi/NdbTransaction.hpp
      storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
      storage/ndb/src/common/debugger/signaldata/TcIndx.cpp
      storage/ndb/src/ndbapi/NdbTransaction.cpp
      storage/ndb/src/ndbapi/Ndbif.cpp
=== modified file 'storage/ndb/include/kernel/signaldata/TcIndx.hpp'
--- a/storage/ndb/include/kernel/signaldata/TcIndx.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/TcIndx.hpp	2011-02-24 08:25:08 +0000
@@ -21,108 +21,8 @@
 
 #include "SignalData.hpp"
 #include "TcKeyReq.hpp"
+#include "TcKeyConf.hpp"
 
-class TcIndxConf {
-
-  /**
-   * Reciver(s)
-   */
-  friend class Ndb;
-  friend class NdbTransaction;
-
-  /**
-   * Sender(s)
-   */
-  friend class Dbtc; 
-
-  /**
-   * For printing
-   */
-  friend bool printTCINDXCONF(FILE *, const Uint32 *, Uint32, Uint16);
-
-public:
-  /**
-   * Length of signal
-   */
-  STATIC_CONST( SignalLength = 5 );
-
-private:
-  /**
-   * DATA VARIABLES
-   */
-  //-------------------------------------------------------------
-  // Unconditional part. First 5 words
-  //-------------------------------------------------------------
-
-  Uint32 apiConnectPtr;
-  Uint32 gci_hi; // gci_lo is stored after operations
-  Uint32 confInfo;
-  Uint32 transId1;
-  Uint32 transId2;
-
-  struct OperationConf {
-    Uint32 apiOperationPtr;
-    Uint32 attrInfoLen;
-  };
-  //-------------------------------------------------------------
-  // Operations confirmations,
-  // No of actually sent = getNoOfOperations(confInfo)
-  //-------------------------------------------------------------
-  OperationConf operations[10];
-  
-  /**
-   * Get:ers for confInfo
-   */
-  static Uint32 getNoOfOperations(const Uint32 & confInfo);
-  static Uint32 getCommitFlag(const Uint32 & confInfo);
-  static bool getMarkerFlag(const Uint32 & confInfo);
-  
-  /**
-   * Set:ers for confInfo
-   */
-  static void setCommitFlag(Uint32 & confInfo, Uint8 flag);
-  static void setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps);
-  static void setMarkerFlag(Uint32 & confInfo, Uint32 flag);
-};
-
-inline
-Uint32
-TcIndxConf::getNoOfOperations(const Uint32 & confInfo){
-  return confInfo & 65535;
-}
-
-inline
-Uint32
-TcIndxConf::getCommitFlag(const Uint32 & confInfo){
-  return ((confInfo >> 16) & 1);
-}
-
-inline
-bool
-TcIndxConf::getMarkerFlag(const Uint32 & confInfo){
-  const Uint32 bits = 3 << 16; // Marker only valid when doing commit
-  return (confInfo & bits) == bits;
-}
-
-inline
-void 
-TcIndxConf::setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps){
-  ASSERT_MAX(noOfOps, 65535, "TcIndxConf::setNoOfOperations");
-  confInfo |= noOfOps;
-}
-
-inline
-void 
-TcIndxConf::setCommitFlag(Uint32 & confInfo, Uint8 flag){
-  ASSERT_BOOL(flag, "TcIndxConf::setCommitFlag");
-  confInfo |= (flag << 16);
-}
-
-inline
-void
-TcIndxConf::setMarkerFlag(Uint32 & confInfo, Uint32 flag){
-  ASSERT_BOOL(flag, "TcIndxConf::setMarkerFlag");
-  confInfo |= (flag << 17);
-}
+typedef TcKeyConf TcIndxConf;
 
 #endif

=== modified file 'storage/ndb/include/ndbapi/NdbTransaction.hpp'
--- a/storage/ndb/include/ndbapi/NdbTransaction.hpp	2011-02-10 08:10:20 +0000
+++ b/storage/ndb/include/ndbapi/NdbTransaction.hpp	2011-02-24 08:25:08 +0000
@@ -965,7 +965,6 @@ private:						
   int  receiveTCROLLBACKCONF(const NdbApiSignal* anApiSignal);
   int  receiveTCROLLBACKREF(const NdbApiSignal* anApiSignal);
   int  receiveTCROLLBACKREP(const NdbApiSignal* anApiSignal);
-  int  receiveTCINDXCONF(const class TcIndxConf *, Uint32 aDataLength);
   int  receiveTCINDXREF(const NdbApiSignal*);
   int  receiveSCAN_TABREF(const NdbApiSignal*);
   int  receiveSCAN_TABCONF(const NdbApiSignal*, const Uint32*, Uint32 len);

=== modified file 'storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp	2011-02-08 13:55:54 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp	2011-02-24 08:25:08 +0000
@@ -81,7 +81,7 @@ SignalDataPrintFunctions[] = {
   { GSN_ALTER_INDX_REQ, printALTER_INDX_REQ },
   { GSN_ALTER_INDX_CONF, printALTER_INDX_CONF },
   { GSN_ALTER_INDX_REF, printALTER_INDX_REF },
-  { GSN_TCINDXCONF, printTCINDXCONF },
+  { GSN_TCINDXCONF, printTCKEYCONF },
   { GSN_TCINDXREF, printTCINDXREF },
   { GSN_INDXKEYINFO, printINDXKEYINFO },
   { GSN_INDXATTRINFO, printINDXATTRINFO },

=== modified file 'storage/ndb/src/common/debugger/signaldata/TcIndx.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/TcIndx.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/TcIndx.cpp	2011-02-24 08:25:08 +0000
@@ -20,48 +20,6 @@
 #include <signaldata/TcKeyReq.hpp>
 #include <BlockNumbers.h>
 
-
-bool
-printTCINDXCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
-  
-  if (receiverBlockNo == API_PACKED) {
-    fprintf(output, "Signal data: ");
-    Uint32 i = 0;
-    while (i < len)
-      fprintf(output, "H\'%.8x ", theData[i++]);
-    fprintf(output,"\n");
-  }
-  else {
-    const TcIndxConf * const sig = (TcIndxConf *) theData;
-    
-    fprintf(output, "Signal data: ");
-    Uint32 i = 0;
-    Uint32 confInfo = sig->confInfo;
-    Uint32 noOfOp = TcIndxConf::getNoOfOperations(confInfo);
-    while (i < len)
-      fprintf(output, "H\'%.8x ", theData[i++]);
-    fprintf(output,"\n");
-    fprintf(output, "apiConnectPtr: H'%.8x, gci: %u/%u, transId:(H'%.8x, H'%.8x)\n",
-	    sig->apiConnectPtr,
-            sig->gci_hi, *(Uint32*)&sig->operations[noOfOp],
-            sig->transId1, sig->transId2);
-    
-    fprintf(output, "noOfOperations: %u, commitFlag: %s, markerFlag: %s\n", 
-	    noOfOp,
-	    (TcIndxConf::getCommitFlag(confInfo) == 0)?"false":"true",
-	    (TcIndxConf::getMarkerFlag(confInfo) == 0)?"false":"true");
-    fprintf(output, "Operations:\n");
-    for(i = 0; i < noOfOp; i++) {
-      fprintf(output,
-	      "apiOperationPtr: H'%.8x, attrInfoLen: %u\n",
-	      sig->operations[i].apiOperationPtr,
-	      sig->operations[i].attrInfoLen);
-    }
-  }
-
-  return true;
-}
-
 bool
 printTCINDXREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
   

=== modified file 'storage/ndb/src/ndbapi/NdbTransaction.cpp'
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp	2011-02-10 08:10:20 +0000
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp	2011-02-24 08:25:08 +0000
@@ -2097,77 +2097,6 @@ NdbTransaction::receiveTCKEY_FAILREF(con
   return -1;
 }//NdbTransaction::receiveTCKEY_FAILREF()
 
-/******************************************************************************
-int  receiveTCINDXCONF(NdbApiSignal* aSignal, Uint32 long_short_ind);
-
-Return Value:  Return 0 : receiveTCINDXCONF was successful.
-               Return -1: In all other case.
-Parameters:    aSignal: The signal object pointer.
-Remark:        
-******************************************************************************/
-int			
-NdbTransaction::receiveTCINDXCONF(const TcIndxConf * indxConf, 
-				 Uint32 aDataLength)
-{
-  if(checkState_TransId(&indxConf->transId1)){
-    const Uint32 tTemp = indxConf->confInfo;
-    const Uint32 tNoOfOperations = TcIndxConf::getNoOfOperations(tTemp);
-    const Uint32 tCommitFlag = TcKeyConf::getCommitFlag(tTemp);
-    
-    const Uint32* tPtr = (Uint32 *)&indxConf->operations[0];
-    Uint32 tNoComp = theNoOfOpCompleted;
-    for (Uint32 i = 0; i < tNoOfOperations ; i++) {
-      NdbReceiver* tOp = theNdb->void2rec(theNdb->int2void(*tPtr));
-      tPtr++;
-      const Uint32 tAttrInfoLen = *tPtr;
-      tPtr++;
-      if (tOp && tOp->checkMagicNumber()) {
-	tNoComp += tOp->execTCOPCONF(tAttrInfoLen);
-      } else {
-	return -1;
-      }//if
-    }//for
-    Uint32 tNoSent = theNoOfOpSent;
-    Uint32 tGCI_hi = indxConf->gci_hi;
-    Uint32 tGCI_lo = * tPtr;
-    if (unlikely(aDataLength < TcIndxConf::SignalLength+1+2*tNoOfOperations))
-    {
-      tGCI_lo = 0;
-    }
-    Uint64 tGCI = Uint64(tGCI_lo) | (Uint64(tGCI_hi) << 32);
-
-    theNoOfOpCompleted = tNoComp;
-    if (tCommitFlag == 1) 
-    {
-      theCommitStatus = Committed;
-      theGlobalCheckpointId = tGCI;
-      if (tGCI) // Read(dirty) only transaction doesnt get GCI
-      {
-	*p_latest_trans_gci = tGCI;
-      }
-    }
-    else if (theLastExecOpInList->theCommitIndicator == 1)
-    {  
-      /**
-       * We're waiting for a commit reply...
-       */
-      return -1;
-    }//if
-
-    if (tNoComp >= tNoSent) 
-    {
-      return 0;	// No more operations to wait for
-    }//if
-     // Not completed the reception yet.
-  } else {
-#ifdef NDB_NO_DROPPED_SIGNAL
-    abort();
-#endif
-  }
-
-  return -1;
-}//NdbTransaction::receiveTCINDXCONF()
-
 /*******************************************************************************
 int OpCompletedFailure();
 

=== modified file 'storage/ndb/src/ndbapi/Ndbif.cpp'
--- a/storage/ndb/src/ndbapi/Ndbif.cpp	2011-02-04 17:52:38 +0000
+++ b/storage/ndb/src/ndbapi/Ndbif.cpp	2011-02-24 08:25:08 +0000
@@ -338,6 +338,7 @@ Ndb::handleReceivedSignal(const NdbApiSi
   
   switch (tSignalNumber){
   case GSN_TCKEYCONF:
+  case GSN_TCINDXCONF:
     {
       tFirstDataPtr = int2void(tFirstData);
       if (tFirstDataPtr == 0) goto InvalidSignal;
@@ -834,30 +835,6 @@ Ndb::handleReceivedSignal(const NdbApiSi
       return;
     }
   }
-  case GSN_TCINDXCONF:{
-    tFirstDataPtr = int2void(tFirstData);
-    if (tFirstDataPtr == 0) goto InvalidSignal;
-
-    const TcIndxConf * const indxConf = (TcIndxConf *)tDataPtr;
-    const BlockReference aTCRef = aSignal->theSendersBlockRef;
-    tCon = void2con(tFirstDataPtr);
-    if ((tCon->checkMagicNumber() == 0) &&
-	(tCon->theSendStatus == NdbTransaction::sendTC_OP)) {
-      tReturnCode = tCon->receiveTCINDXCONF(indxConf, tLen);
-      if (tReturnCode != -1) { 
-	completedTransaction(tCon);
-      }//if
-    }//if
-    
-    if(TcIndxConf::getMarkerFlag(indxConf->confInfo)){
-      NdbTransaction::sendTC_COMMIT_ACK(theImpl,
-                                        theCommitAckSignal,
-                                        indxConf->transId1, 
-                                        indxConf->transId2,
-                                        aTCRef);
-    }
-    return;
-  }
   case GSN_TCINDXREF:{
     tFirstDataPtr = int2void(tFirstData);
     if (tFirstDataPtr == 0) goto InvalidSignal;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110224082508-1sshlc6z57uis83r.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4231) jonas oreland24 Feb