MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:lzhou Date:August 29 2006 4:33pm
Subject:bk commit into 5.0 tree (lzhou:1.2250) BUG#21128
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of root. When root does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-08-29 16:33:30+00:00, lzhou@stripped +4 -0
  BUG#21128: Add ndb_mgm_get_clusterlog_loglevel() funtion

  ndb/include/mgmapi/mgmapi.h@stripped, 2006-08-29 16:33:28+00:00, lzhou@stripped +14 -0
    Add the definition of two new function(ndb_mgm_get_clusterlog_loglevel and ndb_mgm_get_loglevel_clusterlog)

  ndb/src/mgmapi/mgmapi.cpp@stripped, 2006-08-29 16:33:28+00:00, lzhou@stripped +39 -0
    Add new function: ndb_mgm_get_clusterlog_loglevel()

  ndb/src/mgmsrv/Services.cpp@stripped, 2006-08-29 16:33:28+00:00, lzhou@stripped +27 -0
    Add new function to deal with get cluster log level

  ndb/src/mgmsrv/Services.hpp@stripped, 2006-08-29 16:33:28+00:00, lzhou@stripped +2 -0
    Add the definition of new function to deal with get cluster log level

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	lzhou
# Host:	dev3-138.dev.cn.tlan
# Root:	/home/zhl/mysql/mysql-5.0/bug21128-2

--- 1.49/ndb/include/mgmapi/mgmapi.h	2006-08-29 16:33:35 +00:00
+++ 1.50/ndb/include/mgmapi/mgmapi.h	2006-08-29 16:33:35 +00:00
@@ -862,6 +862,15 @@
 				      enum ndb_mgm_event_category category,
 				      int level,
 				      struct ndb_mgm_reply* reply);
+  /**
+   * get log category and levels 
+   *
+   * @param   handle        NDB management handle.
+   * @return                A vector of twelve elements,
+   *                        where each element contains
+   *                        loglevel of corresponding category
+   */
+  const unsigned int *ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle);
 
   /** @} *********************************************************************/
   /**
@@ -1141,6 +1150,11 @@
 				      enum ndb_mgm_event_category c,
 				      int l, struct ndb_mgm_reply* r)
   { return ndb_mgm_set_clusterlog_loglevel(h,n,c,l,r); }
+
+  inline
+  const unsigned int *ndb_mgm_get_loglevel_clusterlog(NdbMgmHandle h)
+  { return ndb_mgm_get_clusterlog_loglevel(h); }
+
 #endif
 
 #ifdef __cplusplus

--- 1.61/ndb/src/mgmapi/mgmapi.cpp	2006-08-29 16:33:35 +00:00
+++ 1.62/ndb/src/mgmapi/mgmapi.cpp	2006-08-29 16:33:35 +00:00
@@ -1300,6 +1300,45 @@
   return 0;
 }
 
+static const char *clusterlog_names[]=
+  { "startup", "shutdown", "statistics", "checkpoint", "noderestart", "connection", "info", "warning", "error", "congestion", "debug", "backup" };
+
+extern "C"
+const unsigned int *
+ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle)
+{
+  SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_clusterlog_loglevel");
+  int loglevel_count = CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1 ;
+  static unsigned int loglevel[CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1] = {0,0,0,0,0,0,0,0,0,0,0,0};
+  const ParserRow<ParserDummy> getloglevel_reply[] = {
+    MGM_CMD("get cluster loglevel", NULL, ""),
+    MGM_ARG(clusterlog_names[0], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[1], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[2], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[3], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[4], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[5], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[6], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[7], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[8], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[9], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[10], Int, Mandatory, ""),
+    MGM_ARG(clusterlog_names[11], Int, Mandatory, ""),
+  };
+  CHECK_HANDLE(handle, NULL);
+  CHECK_CONNECTED(handle, NULL);
+
+  Properties args;
+  const Properties *reply;
+  reply = ndb_mgm_call(handle, getloglevel_reply, "get cluster loglevel", &args);
+  CHECK_REPLY(reply, NULL);
+
+  for(int i=0; i < loglevel_count; i++) {
+    reply->get(clusterlog_names[i], &loglevel[i]);
+  }
+  return loglevel;
+}
+
 extern "C"
 int 
 ndb_mgm_set_clusterlog_loglevel(NdbMgmHandle handle, int nodeId,

--- 1.69/ndb/src/mgmsrv/Services.cpp	2006-08-29 16:33:35 +00:00
+++ 1.70/ndb/src/mgmsrv/Services.cpp	2006-08-29 16:33:35 +00:00
@@ -147,6 +147,7 @@
   MGM_CMD("get status", &MgmApiSession::getStatus, ""),
 
   MGM_CMD("get info clusterlog", &MgmApiSession::getInfoClusterLog, ""),
+  MGM_CMD("get cluster loglevel", &MgmApiSession::getClusterLogLevel, ""),
 
   MGM_CMD("restart node", &MgmApiSession::restart_v1, ""),
     MGM_ARG("node", String, Mandatory, "Nodes to restart"),
@@ -801,6 +802,32 @@
   m_allocated_resources= new MgmtSrvr::Allocated_resources(m_mgmsrv);
 
   m_output->println("end session reply");
+}
+
+void
+MgmApiSession::getClusterLogLevel(Parser<MgmApiSession>::Context &			, Properties const &) {
+  const char* names[] = { "startup",
+			  "shutdown", 
+			  "statistics", 
+			  "checkpoint", 
+			  "noderestart", 
+			  "connection", 
+			  "info", 
+			  "warning", 
+			  "error", 
+			  "congestion", 
+			  "debug", 
+			  "backup" };
+
+  int loglevel_count = (CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1) ;
+  LogLevel::EventCategory category;
+
+  m_output->println("get cluster loglevel");
+  for(int i = 0; i < loglevel_count; i++) {
+    category = (LogLevel::EventCategory) i;
+    m_output->println("%s: %d", names[i], m_mgmsrv.m_event_listner[0].m_logLevel.getLogLevel(category));
+  }
+  m_output->println("");
 }
 
 void

--- 1.20/ndb/src/mgmsrv/Services.hpp	2006-08-29 16:33:35 +00:00
+++ 1.21/ndb/src/mgmsrv/Services.hpp	2006-08-29 16:33:35 +00:00
@@ -87,6 +87,8 @@
   void bye(Parser_t::Context &ctx, const class Properties &args);
   void endSession(Parser_t::Context &ctx, const class Properties &args);
   void setLogLevel(Parser_t::Context &ctx, const class Properties &args);
+  void getClusterLogLevel(Parser_t::Context &ctx, 
+			  const class Properties &args);
   void setClusterLogLevel(Parser_t::Context &ctx, 
 			  const class Properties &args);
   void setLogFilter(Parser_t::Context &ctx, const class Properties &args);
Thread
bk commit into 5.0 tree (lzhou:1.2250) BUG#21128lzhou29 Aug