Commit 97956339 authored by unknown's avatar unknown
Browse files

ndb

  impl support for querying resource usage in ndb api
  to help track down mem leaks


ndb/include/ndbapi/Ndb.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/include/ndbapi/NdbBlob.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/include/ndbapi/NdbConnection.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/include/ndbapi/NdbIndexOperation.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/include/ndbapi/NdbIndexScanOperation.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/include/ndbapi/NdbOperation.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/include/ndbapi/NdbRecAttr.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/NdbApiSignal.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/NdbApiSignal.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/NdbBlob.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/NdbImpl.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/NdbRecAttr.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/NdbUtil.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/NdbUtil.hpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/Ndbif.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/Ndbinit.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/src/ndbapi/Ndblist.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
ndb/tools/restore/Restore.cpp:
  Impl. reporting of free list usage
  Put free list into handler class
parent 01587e47
Loading
Loading
Loading
Loading
+13 −15
Original line number Diff line number Diff line
@@ -882,10 +882,10 @@ class BaseString;
class NdbEventOperation;
class NdbBlob;
class NdbReceiver;
template <class T> struct Ndb_free_list_t;

typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);


#if defined NDB_OSE
/**
 * Default time to wait for response after request has been sent to 
@@ -1386,8 +1386,20 @@ public:
   */
  NdbConnection* hupp( NdbConnection* );
  Uint32 getReference() const { return theMyRef;}

  struct Free_list_usage
  {
    const char * m_name;
    Uint32 m_created;
    Uint32 m_free;
    Uint32 m_sizeof;
  };

  Free_list_usage * get_free_list_usage(Free_list_usage*);
#endif

  

/*****************************************************************************
 *	These are service routines used by the other classes in the NDBAPI.
 ****************************************************************************/
@@ -1562,22 +1574,8 @@ private:
  class NdbDictionaryImpl* theDictionary;
  class NdbGlobalEventBufferHandle* theGlobalEventBufferHandle;

  NdbConnection*	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;
  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;
  NdbBlob*              theNdbBlobIdleList;

  Uint32   theMyRef;        // My block reference  
  Uint32   theNode;         // The node number of our node
+5 −1
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ private:
  // for keeping in lists
  NdbBlob* theNext;
  // initialization
  NdbBlob();
  NdbBlob(Ndb*);
  void init();
  void release();
  // classify operations
@@ -314,6 +314,10 @@ private:
  int getOperationType() const;
  friend class NdbOut& operator<<(NdbOut&, const NdbBlob&);
#endif

  void next(NdbBlob* obj) { theNext= obj;}
  NdbBlob* next() { return theNext;}
  friend struct Ndb_free_list_t<NdbBlob>;
};

#endif
+6 −6
Original line number Diff line number Diff line
@@ -18,8 +18,9 @@
#define NdbConnection_H

#include <ndb_types.h>
#include <NdbError.hpp>
#include <NdbDictionary.hpp>
#include "NdbError.hpp"
#include "NdbDictionary.hpp"
#include "Ndb.hpp"

class NdbConnection;
class NdbOperation;
@@ -465,10 +466,10 @@ private:
  /**************************************************************************
   *	These are the create and delete methods of this class.              *
   **************************************************************************/
  
  NdbConnection(Ndb* aNdb); 
  
  ~NdbConnection();
  NdbConnection* next();			  // Returns the next pointer
  void next(NdbConnection*);		  // Sets the next pointer

  void init();           // Initialize connection object for new transaction

@@ -487,8 +488,6 @@ 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

  enum ConStatusType { 
    NotConnected,
@@ -691,6 +690,7 @@ private:
  void define_scan_op(NdbIndexScanOperation*);

  friend class HugoOperations;
  friend struct Ndb_free_list_t<NdbConnection>;
};

inline
+1 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ private:
  Uint32 m_theIndexDefined[NDB_MAX_ATTRIBUTES_IN_INDEX][3];
  Uint32 m_theIndexLen;	  	 // Length of the index in words
  Uint32 m_theNoOfIndexDefined;  // The number of index attributes
  friend struct Ndb_free_list_t<NdbIndexOperation>;
};

#endif
+2 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ private:
  int compare(Uint32 key, Uint32 cols, const NdbReceiver*, const NdbReceiver*);

  Uint32 m_sort_columns;

  friend struct Ndb_free_list_t<NdbIndexScanOperation>;
};

#endif
Loading