Commit 7901cd30 authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1

parents 65256dea 7b0857a7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -31,12 +31,12 @@ QUIT Quit management client
<id>       = ALL | Any database node id

Connected to Management Server at: localhost:1186
Node 1: started (Version 4.1.8)
Node 2: started (Version 4.1.8)
Node 1: started (Version 4.1.9)
Node 2: started (Version 4.1.9)

Node 1: started (Version 4.1.8)
Node 1: started (Version 4.1.9)

Node 2: started (Version 4.1.8)
Node 2: started (Version 4.1.9)

Executing CLUSTERLOG on node 1 OK!
Executing CLUSTERLOG on node 2 OK!
+21 −10
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@

#include "Logger.hpp"


/**
 * This class is the base class for all log handlers. A log handler is 
 * responsible for formatting and writing log messages to a specific output.
@@ -68,7 +67,8 @@ public:
  /**
   * Append a log message to the output stream/file whatever.
   * append() will call writeHeader(), writeMessage() and writeFooter() for
   * a child class and in that order.
   * a child class and in that order. Append checks for repeated messages.
   * append_impl() does not check for repeats.
   *
   * @param pCategory the category/name to tag the log entry with.
   * @param level the log level.
@@ -76,6 +76,8 @@ public:
   */
  void append(const char* pCategory, Logger::LoggerLevel level,
	      const char* pMsg);
  void append_impl(const char* pCategory, Logger::LoggerLevel level,
		   const char* pMsg);

  /**
   * Returns a default formatted header. It currently has the
@@ -111,14 +113,6 @@ public:
   */
  void setDateTimeFormat(const char* pFormat);
  
  /**
   * Returns a string date and time string.
   * 
   * @param pStr a string.
   * @return a string with date and time.
   */
  char* getTimeAsString(char* pStr) const;

  /**
   * Returns the error code.
   */
@@ -185,6 +179,15 @@ protected:
  virtual void writeFooter() = 0;
  
private: 
  /**
   * Returns a string date and time string.
   * @note does not update time, uses m_now as time
   * @param pStr a string.
   * @return a string with date and time.
   */
  char* getTimeAsString(char* pStr) const;
  time_t m_now;

  /** Prohibit */
  LogHandler(const LogHandler&);
  LogHandler* operator = (const LogHandler&);
@@ -192,6 +195,14 @@ private:

  const char* m_pDateTimeFormat;
  int m_errorCode;

  // for handling repeated messages
  unsigned m_count_repeated_messages;
  unsigned m_max_repeat_frequency;
  time_t m_last_log_time;
  char m_last_category[MAX_HEADER_LENGTH];
  char m_last_message[MAX_LOG_MESSAGE_SIZE];
  Logger::LoggerLevel m_last_level;
};

#endif
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <ndb_global.h>
#include <BaseString.hpp>

#define MAX_LOG_MESSAGE_SIZE 1024

class LogHandler;
class LogHandlerList;

+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public:

  void set_optimized_node_selection(int val);

  int no_db_nodes();
  unsigned no_db_nodes();
#endif

private:
+6 −1
Original line number Diff line number Diff line
@@ -100,6 +100,11 @@ public:
  
  bool init(NodeId localNodeId);

  /**
   * after a connect from client, perform connection using correct transporter
   */
  bool connect_server(NDB_SOCKET_TYPE sockfd);

  /**
   * Remove all transporters
   */
Loading