List:Commits« Previous MessageNext Message »
From:John David Duncan Date:September 7 2011 5:21pm
Subject:bzr push into mysql-5.1-telco-7.0 branch (john.duncan:4505 to 4506)
View as plain text  
 4506 John David Duncan	2011-09-07
      Configurable timer in the NDB API send thread (from 1 ms to 10 ms)

    modified:
      storage/ndb/include/ndbapi/ndb_cluster_connection.hpp
      storage/ndb/src/ndbapi/TransporterFacade.cpp
      storage/ndb/src/ndbapi/TransporterFacade.hpp
      storage/ndb/src/ndbapi/ndb_cluster_connection.cpp
 4505 John David Duncan	2011-09-07
      New NDB API client stats; provide insignt on behavior of the adaptive send algorithm.

    modified:
      sql/ha_ndbcluster.cc
      storage/ndb/include/ndbapi/Ndb.hpp
      storage/ndb/src/ndbapi/Ndb.cpp
      storage/ndb/src/ndbapi/Ndbif.cpp
      storage/ndb/src/ndbapi/TransporterFacade.cpp
      storage/ndb/src/ndbapi/TransporterFacade.hpp
      storage/ndb/src/ndbapi/trp_client.cpp
      storage/ndb/src/ndbapi/trp_client.hpp
=== modified file 'storage/ndb/include/ndbapi/ndb_cluster_connection.hpp'
--- a/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp	2011-09-07 17:20:19 +0000
@@ -180,6 +180,15 @@ public:
    */
   Uint32 collect_client_stats(Uint64* statsArr, Uint32 sz);
 
+ /**
+  * Get/set the minimum time in milliseconds that can lapse until the adaptive 
+  * send mechanism forces all pending signals to be sent. 
+  * The default value is 10, and the allowed range is from 1 to 10.
+  */
+ void set_max_adaptive_send_time(Uint32 milliseconds);
+ Uint32 get_max_adaptive_send_time();
+
+
 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
   int get_no_ready();
   const char *get_connectstring(char *buf, int buf_sz) const;

=== modified file 'storage/ndb/src/ndbapi/TransporterFacade.cpp'
--- a/storage/ndb/src/ndbapi/TransporterFacade.cpp	2011-09-07 17:12:12 +0000
+++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp	2011-09-07 17:20:19 +0000
@@ -425,6 +425,19 @@ TransporterFacade::doStop(){
   DBUG_VOID_RETURN;
 }
 
+void TransporterFacade::setSendThreadInterval(Uint32 ms)
+{
+  if(ms > 0 && ms <= 10) 
+  { 
+    sendThreadWaitMillisec = ms;
+  }
+}
+
+Uint32 TransporterFacade::getSendThreadInterval(void)
+{
+  return sendThreadWaitMillisec;
+}
+
 extern "C" 
 void* 
 runSendRequest_C(void * me)
@@ -444,7 +457,7 @@ void TransporterFacade::threadMainSend(v
   m_socket_server.startServer();
 
   while(!theStopReceive) {
-    NdbSleep_MilliSleep(10);
+    NdbSleep_MilliSleep(sendThreadWaitMillisec);
     NdbMutex_Lock(theMutexPtr);
     if (sendPerformedLastInterval == 0) {
       theTransporterRegistry->performSend();
@@ -537,7 +550,8 @@ TransporterFacade::TransporterFacade(Glo
   theSendThread(NULL),
   theReceiveThread(NULL),
   m_fragmented_signal_id(0),
-  m_globalDictCache(cache)
+  m_globalDictCache(cache),
+  sendThreadWaitMillisec(10)
 {
   DBUG_ENTER("TransporterFacade::TransporterFacade");
   theMutexPtr = NdbMutex_CreateWithName("TTFM");

=== modified file 'storage/ndb/src/ndbapi/TransporterFacade.hpp'
--- a/storage/ndb/src/ndbapi/TransporterFacade.hpp	2011-09-07 17:12:12 +0000
+++ b/storage/ndb/src/ndbapi/TransporterFacade.hpp	2011-09-07 17:20:19 +0000
@@ -71,6 +71,12 @@ public:
 
   Uint32 get_active_ndb_objects() const;
 
+  /** 
+   * Get/Set wait time in the send thread.
+   */
+ void setSendThreadInterval(Uint32 ms);
+ Uint32 getSendThreadInterval(void);
+
   // Only sends to nodes which are alive
 private:
   int sendSignal(const NdbApiSignal * signal, NodeId nodeId);
@@ -225,6 +231,7 @@ private:
 
   // Declarations for the receive and send thread
   int  theStopReceive;
+  Uint32 sendThreadWaitMillisec;
 
   void threadMainSend(void);
   NdbThread* theSendThread;

=== modified file 'storage/ndb/src/ndbapi/ndb_cluster_connection.cpp'
--- a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2011-09-07 17:20:19 +0000
@@ -981,5 +981,16 @@ Ndb_cluster_connection::collect_client_s
   return relevant;
 }
 
-template class Vector<Ndb_cluster_connection_impl::Node>;
+void
+Ndb_cluster_connection::set_max_adaptive_send_time(Uint32 milliseconds)
+{
+  m_impl.m_transporter_facade->setSendThreadInterval(milliseconds);
+}
 
+Uint32
+Ndb_cluster_connection::get_max_adaptive_send_time()
+{
+  return m_impl.m_transporter_facade->getSendThreadInterval();
+}
+
+template class Vector<Ndb_cluster_connection_impl::Node>;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (john.duncan:4505 to 4506) John David Duncan7 Sep