Commit 99f07f83 authored by unknown's avatar unknown

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

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

parents cfe5650c 33465a14
...@@ -26,17 +26,17 @@ CONNECT [<connectstring>] Connect to management server (reconnect i ...@@ -26,17 +26,17 @@ CONNECT [<connectstring>] Connect to management server (reconnect i
QUIT Quit management client QUIT Quit management client
<severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG <severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG
<category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | GREP | DEBUG | BACKUP <category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | CONGESTION | DEBUG | BACKUP
<level> = 0 - 15 <level> = 0 - 15
<id> = ALL | Any database node id <id> = ALL | Any database node id
Connected to Management Server at: localhost:1186 Connected to Management Server at: localhost:1186
Node 1: started (Version 4.1.9) Node 1: started (Version 5.0.3)
Node 2: started (Version 4.1.9) Node 2: started (Version 5.0.3)
Node 1: started (Version 4.1.9) Node 1: started (Version 5.0.3)
Node 2: started (Version 4.1.9) Node 2: started (Version 5.0.3)
Executing CLUSTERLOG on node 1 OK! Executing CLUSTERLOG on node 1 OK!
Executing CLUSTERLOG on node 2 OK! Executing CLUSTERLOG on node 2 OK!
......
...@@ -8,5 +8,5 @@ sleep 5 ...@@ -8,5 +8,5 @@ sleep 5
all clusterlog connection=8 all clusterlog connection=8
sleep 1 sleep 1
1 restart 1 restart
sleep 5 sleep 10
clusterlog on all clusterlog on all
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# General configuration options # General configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
DETAILS_AT_TOP = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project. # by quotes) that should identify the project.
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# General configuration options # General configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
DETAILS_AT_TOP = yes DETAILS_AT_TOP = YES
HIDE_FRIEND_COMPOUNDS = yes HIDE_FRIEND_COMPOUNDS = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project. # by quotes) that should identify the project.
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# General configuration options # General configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
DETAILS_AT_TOP = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project. # by quotes) that should identify the project.
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# General configuration options # General configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
DETAILS_AT_TOP = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project. # by quotes) that should identify the project.
......
...@@ -145,9 +145,6 @@ int create_table(Ndb * myNdb); ...@@ -145,9 +145,6 @@ int create_table(Ndb * myNdb);
int tempErrors = 0; int tempErrors = 0;
int permErrors = 0; int permErrors = 0;
/**
* Helper function for callback(...)
*/
void void
closeTransaction(Ndb * ndb , async_callback_t * cb) closeTransaction(Ndb * ndb , async_callback_t * cb)
{ {
......
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
llInfo = CFG_LOGLEVEL_INFO - CFG_MIN_LOGLEVEL, llInfo = CFG_LOGLEVEL_INFO - CFG_MIN_LOGLEVEL,
llWarning = CFG_LOGLEVEL_WARNING - CFG_MIN_LOGLEVEL, llWarning = CFG_LOGLEVEL_WARNING - CFG_MIN_LOGLEVEL,
llError = CFG_LOGLEVEL_ERROR - CFG_MIN_LOGLEVEL, llError = CFG_LOGLEVEL_ERROR - CFG_MIN_LOGLEVEL,
llGrep = CFG_LOGLEVEL_GREP - CFG_MIN_LOGLEVEL, llCongestion = CFG_LOGLEVEL_CONGESTION - CFG_MIN_LOGLEVEL,
llDebug = CFG_LOGLEVEL_DEBUG - CFG_MIN_LOGLEVEL llDebug = CFG_LOGLEVEL_DEBUG - CFG_MIN_LOGLEVEL
,llBackup = CFG_LOGLEVEL_BACKUP - CFG_MIN_LOGLEVEL ,llBackup = CFG_LOGLEVEL_BACKUP - CFG_MIN_LOGLEVEL
}; };
......
This diff is collapsed.
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
#define CFG_LOGLEVEL_INFO 256 #define CFG_LOGLEVEL_INFO 256
#define CFG_LOGLEVEL_WARNING 257 #define CFG_LOGLEVEL_WARNING 257
#define CFG_LOGLEVEL_ERROR 258 #define CFG_LOGLEVEL_ERROR 258
#define CFG_LOGLEVEL_GREP 259 #define CFG_LOGLEVEL_CONGESTION 259
#define CFG_LOGLEVEL_DEBUG 260 #define CFG_LOGLEVEL_DEBUG 260
#define CFG_LOGLEVEL_BACKUP 261 #define CFG_LOGLEVEL_BACKUP 261
#define CFG_MAX_LOGLEVEL 261 #define CFG_MAX_LOGLEVEL 261
......
This diff is collapsed.
...@@ -107,6 +107,9 @@ public: ...@@ -107,6 +107,9 @@ public:
Closed = 3, Closed = 3,
Invalid = 9 Invalid = 9
}; };
/**
* Get the state of a NdbBlob object.
*/
State getState(); State getState();
/** /**
* Inline blob header. * Inline blob header.
...@@ -116,7 +119,7 @@ public: ...@@ -116,7 +119,7 @@ public:
}; };
/** /**
* Prepare to read blob value. The value is available after execute. * Prepare to read blob value. The value is available after execute.
* Use getNull to check for NULL and getLength to get the real length * Use getNull() to check for NULL and getLength() to get the real length
* and to check for truncation. Sets current read/write position to * and to check for truncation. Sets current read/write position to
* after the data read. * after the data read.
*/ */
...@@ -129,10 +132,10 @@ public: ...@@ -129,10 +132,10 @@ public:
*/ */
int setValue(const void* data, Uint32 bytes); int setValue(const void* data, Uint32 bytes);
/** /**
* Callback for setActiveHook. Invoked immediately when the prepared * Callback for setActiveHook(). Invoked immediately when the prepared
* operation has been executed (but not committed). Any getValue or * operation has been executed (but not committed). Any getValue() or
* setValue is done first. The blob handle is active so readData or * setValue() is done first. The blob handle is active so readData or
* writeData etc can be used to manipulate blob value. A user-defined * writeData() etc can be used to manipulate blob value. A user-defined
* argument is passed along. Returns non-zero on error. * argument is passed along. Returns non-zero on error.
*/ */
typedef int ActiveHook(NdbBlob* me, void* arg); typedef int ActiveHook(NdbBlob* me, void* arg);
...@@ -195,10 +198,15 @@ public: ...@@ -195,10 +198,15 @@ public:
const NdbError& getNdbError() const; const NdbError& getNdbError() const;
/** /**
* Return info about all blobs in this operation. * Return info about all blobs in this operation.
*
* Get first blob in list.
*/ */
// Get first blob in list
NdbBlob* blobsFirstBlob(); NdbBlob* blobsFirstBlob();
// Get next blob in list after this one /**
* Return info about all blobs in this operation.
*
* Get next blob in list. Initialize with blobsFirstBlob().
*/
NdbBlob* blobsNextBlob(); NdbBlob* blobsNextBlob();
private: private:
......
...@@ -631,7 +631,7 @@ public: ...@@ -631,7 +631,7 @@ public:
* Assignment operator, deep copy * Assignment operator, deep copy
* @param table Table to be copied * @param table Table to be copied
*/ */
Table& operator=(const Table&); Table& operator=(const Table& table);
/** /**
* Name of table * Name of table
...@@ -946,12 +946,12 @@ public: ...@@ -946,12 +946,12 @@ public:
#endif #endif
}; };
/* /**
* Constructor * Constructor
* @param name Name of event * @param name Name of event
*/ */
Event(const char *name); Event(const char *name);
/* /**
* Constructor * Constructor
* @param name Name of event * @param name Name of event
* @param table Reference retrieved from NdbDictionary * @param table Reference retrieved from NdbDictionary
...@@ -994,9 +994,12 @@ public: ...@@ -994,9 +994,12 @@ public:
*/ */
void addTableEvent(const TableEvent te); void addTableEvent(const TableEvent te);
/** /**
* Get/set durability of the event * Set durability of the event
*/
void setDurability(EventDurability);
/**
* Get durability of the event
*/ */
void setDurability(EventDurability ed);
EventDurability getDurability() const; EventDurability getDurability() const;
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
void addColumn(const Column &c); void addColumn(const Column &c);
...@@ -1116,6 +1119,13 @@ public: ...@@ -1116,6 +1119,13 @@ public:
/** /**
* Fetch list of all objects, optionally restricted to given type. * Fetch list of all objects, optionally restricted to given type.
*
* @param list List of objects returned in the dictionary
* @param type Restrict returned list to only contain objects of
* this type
*
* @return -1 if error.
*
*/ */
int listObjects(List & list, Object::Type type = Object::TypeUndefined); int listObjects(List & list, Object::Type type = Object::TypeUndefined);
int listObjects(List & list, int listObjects(List & list,
...@@ -1168,10 +1178,10 @@ public: ...@@ -1168,10 +1178,10 @@ public:
/** /**
* Create event given defined Event instance * Create event given defined Event instance
* @param Event to create * @param event Event to create
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
*/ */
int createEvent(const Event &); int createEvent(const Event &event);
/** /**
* Drop event with given name * Drop event with given name
...@@ -1199,17 +1209,17 @@ public: ...@@ -1199,17 +1209,17 @@ public:
/** /**
* Create defined table given defined Table instance * Create defined table given defined Table instance
* @param Table Table to create * @param table Table to create
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
*/ */
int createTable(const Table &); int createTable(const Table &table);
/** /**
* Drop table given retrieved Table instance * Drop table given retrieved Table instance
* @param Table Table to drop * @param table Table to drop
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
*/ */
int dropTable(Table &); int dropTable(Table & table);
/** /**
* Drop table given table name * Drop table given table name
...@@ -1220,12 +1230,12 @@ public: ...@@ -1220,12 +1230,12 @@ public:
/** /**
* Alter defined table given defined Table instance * Alter defined table given defined Table instance
* @param Table Table to alter * @param table Table to alter
* @return -2 (incompatible version) <br> * @return -2 (incompatible version) <br>
* -1 general error <br> * -1 general error <br>
* 0 success * 0 success
*/ */
int alterTable(const Table &); int alterTable(const Table &table);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/** /**
...@@ -1257,10 +1267,10 @@ public: ...@@ -1257,10 +1267,10 @@ public:
/** /**
* Create index given defined Index instance * Create index given defined Index instance
* @param Index to create * @param index Index to create
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
*/ */
int createIndex(const Index &); int createIndex(const Index &index);
/** /**
* Drop index with given name * Drop index with given name
......
...@@ -204,6 +204,7 @@ struct NdbError { ...@@ -204,6 +204,7 @@ struct NdbError {
*/ */
char * details; char * details;
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
NdbError(){ NdbError(){
status = UnknownResult; status = UnknownResult;
classification = NoError; classification = NoError;
...@@ -227,6 +228,7 @@ struct NdbError { ...@@ -227,6 +228,7 @@ struct NdbError {
ndberror.details = details; ndberror.details = details;
return ndberror; return ndberror;
} }
#endif
}; };
class NdbOut& operator <<(class NdbOut&, const NdbError &); class NdbOut& operator <<(class NdbOut&, const NdbError &);
......
...@@ -132,7 +132,7 @@ public: ...@@ -132,7 +132,7 @@ public:
* next() has returned a value greater than * next() has returned a value greater than
* zero. If a specific attribute has not changed the corresponding * zero. If a specific attribute has not changed the corresponding
* NdbRecAttr will be in state UNDEFINED. This is checked by * NdbRecAttr will be in state UNDEFINED. This is checked by
* NdbRecAttr::isNull() which then returns -1. * NdbRecAttr::isNULL() which then returns -1.
* *
* @param anAttrName Attribute name * @param anAttrName Attribute name
* @param aValue If this is non-NULL, then the attribute value * @param aValue If this is non-NULL, then the attribute value
...@@ -144,6 +144,9 @@ public: ...@@ -144,6 +144,9 @@ public:
* (indicating error). * (indicating error).
*/ */
NdbRecAttr *getValue(const char *anAttrName, char *aValue = 0); NdbRecAttr *getValue(const char *anAttrName, char *aValue = 0);
/**
* See getValue().
*/
NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = 0); NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = 0);
/** /**
......
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
* @returns 0 for success and -1 for failure * @returns 0 for success and -1 for failure
* @see NdbScanOperation::readTuples * @see NdbScanOperation::readTuples
*/ */
int readTuples(LockMode = LM_Read, int readTuples(LockMode lock_mode = LM_Read,
Uint32 batch = 0, Uint32 batch = 0,
Uint32 parallel = 0, Uint32 parallel = 0,
bool order_by = false, bool order_by = false,
...@@ -90,15 +90,14 @@ public: ...@@ -90,15 +90,14 @@ public:
* An index stores also all-NULL keys. Doing index scan with empty * An index stores also all-NULL keys. Doing index scan with empty
* bound set returns all table tuples. * bound set returns all table tuples.
* *
* @param attrName Attribute name, alternatively: * @param attr Attribute name, alternatively:
* @param anAttrId Index column id (starting from 0)
* @param type Type of bound * @param type Type of bound
* @param value Pointer to bound value, 0 for NULL * @param value Pointer to bound value, 0 for NULL
* @param len Value length in bytes. * @param len Value length in bytes.
* Fixed per datatype and can be omitted * Fixed per datatype and can be omitted
* @return 0 if successful otherwise -1 * @return 0 if successful otherwise -1
*/ */
int setBound(const char* attr, int type, const void* aValue, Uint32 len = 0); int setBound(const char* attr, int type, const void* value, Uint32 len = 0);
/** /**
* Define bound on index key in range scan using index column id. * Define bound on index key in range scan using index column id.
......
...@@ -966,6 +966,7 @@ protected: ...@@ -966,6 +966,7 @@ protected:
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
inline inline
int int
...@@ -1215,4 +1216,6 @@ NdbOperation::setValue(Uint32 anAttrId, double aPar) ...@@ -1215,4 +1216,6 @@ NdbOperation::setValue(Uint32 anAttrId, double aPar)
return setValue(anAttrId, (const char*)&aPar, (Uint32)8); return setValue(anAttrId, (const char*)&aPar, (Uint32)8);
} }
#endif // doxygen
#endif #endif
...@@ -281,6 +281,8 @@ private: ...@@ -281,6 +281,8 @@ private:
const NdbDictionary::Column* m_column; const NdbDictionary::Column* m_column;
}; };
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
inline inline
NdbDictionary::Column::Type NdbDictionary::Column::Type
NdbRecAttr::getType() const { NdbRecAttr::getType() const {
...@@ -457,5 +459,7 @@ NdbRecAttr::isNULL() const ...@@ -457,5 +459,7 @@ NdbRecAttr::isNULL() const
class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &); class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &);
#endif // ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#endif #endif
...@@ -70,7 +70,8 @@ public: ...@@ -70,7 +70,8 @@ public:
* NdbOperation::getValue are updated with values * NdbOperation::getValue are updated with values
* from the scanned tuple. * from the scanned tuple.
* *
* @param fetchAllowed If set to false, then fetching is disabled * @param fetchAllowed If set to false, then fetching is disabled
* @param forceSend If true send will occur immediately (see @ref secAdapt)
* *
* The NDB API will contact the NDB Kernel for more tuples * The NDB API will contact the NDB Kernel for more tuples
* when necessary to do so unless you set the fetchAllowed * when necessary to do so unless you set the fetchAllowed
...@@ -122,6 +123,13 @@ public: ...@@ -122,6 +123,13 @@ public:
* @return an NdbOperation or NULL. * @return an NdbOperation or NULL.
*/ */
NdbOperation* updateCurrentTuple(); NdbOperation* updateCurrentTuple();
/**
* Update current tuple
*
* @param updateTrans Transaction that should perform the update
*
* @return an NdbOperation or NULL.
*/
NdbOperation* updateCurrentTuple(NdbTransaction* updateTrans); NdbOperation* updateCurrentTuple(NdbTransaction* updateTrans);
/** /**
...@@ -129,6 +137,13 @@ public: ...@@ -129,6 +137,13 @@ public:
* @return 0 on success or -1 on failure * @return 0 on success or -1 on failure
*/ */
int deleteCurrentTuple(); int deleteCurrentTuple();
/**
* Delete current tuple
*
* @param takeOverTransaction Transaction that should perform the delete
*
* @return 0 on success or -1 on failure
*/
int deleteCurrentTuple(NdbTransaction* takeOverTransaction); int deleteCurrentTuple(NdbTransaction* takeOverTransaction);
/** /**
......
...@@ -796,6 +796,8 @@ private: ...@@ -796,6 +796,8 @@ private:
void define_scan_op(NdbIndexScanOperation*); void define_scan_op(NdbIndexScanOperation*);
}; };
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
inline inline
Uint32 Uint32
NdbTransaction::get_send_size() NdbTransaction::get_send_size()
...@@ -1034,4 +1036,6 @@ NdbTransaction::ptr2int(){ ...@@ -1034,4 +1036,6 @@ NdbTransaction::ptr2int(){
typedef NdbTransaction NdbConnection; typedef NdbTransaction NdbConnection;
#endif // ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#endif #endif
...@@ -20,39 +20,42 @@ ...@@ -20,39 +20,42 @@
/** /**
* @class Ndb_cluster_connection * @class Ndb_cluster_connection
* @brief Represents a connection to a cluster of storage nodes * @brief Represents a connection to a cluster of storage nodes.
* *
* Always start your application program by creating a * Any NDB application program should begin with the creation of a
* Ndb_cluster_connection object. Your application should contain * single Ndb_cluster_connection object, and should make use of one
* only one Ndb_cluster_connection. Your application connects to * and only one Ndb_cluster_connection. The application connects to
* a cluster management server when method connect() is called. * a cluster management server when this object's connect() method is called.
* With the method wait_until_ready() it is possible to wait * By using the wait_until_ready() method it is possible to wait
* for the connection to one or several storage nodes. * for the connection to reach one or more storage nodes.
*/ */
class Ndb_cluster_connection { class Ndb_cluster_connection {
public: public:
/** /**
* Create a connection to a cluster of storage nodes * Create a connection to a cluster of storage nodes
* *
* @param specify the connectstring for where to find the * @param connectstring The connectstring for where to find the
* management server * management server
*/ */
Ndb_cluster_connection(const char * connect_string = 0); Ndb_cluster_connection(const char * connectstring = 0);
~Ndb_cluster_connection(); ~Ndb_cluster_connection();
/** /**
* Connect to a cluster management server * Connect to a cluster management server
* *
* @param no_retries specifies the number of retries to perform * @param no_retries specifies the number of retries to attempt
* if the connect fails, negative number results in infinite * in the event of connection failure; a negative value
* number of retries * will result in the attempt to connect being repeated
* indefinitely
*
* @param retry_delay_in_seconds specifies how often retries should * @param retry_delay_in_seconds specifies how often retries should
* be performed * be performed
* @param verbose specifies if the method should print progess
* *
* @return 0 if success, * @param verbose specifies if the method should print a report of its progess
* 1 if retriable error, *
* -1 if non-retriable error * @return 0 = success,
* 1 = recoverable error,
* -1 = non-recoverable error
*/ */
int connect(int no_retries=0, int retry_delay_in_seconds=1, int verbose=0); int connect(int no_retries=0, int retry_delay_in_seconds=1, int verbose=0);
...@@ -61,15 +64,15 @@ public: ...@@ -61,15 +64,15 @@ public:
#endif #endif
/** /**
* Wait until one or several storage nodes are connected * Wait until the requested connection with one or more storage nodes is successful
* *
* @param time_out_for_first_alive number of seconds to wait until * @param timeout_for_first_alive Number of seconds to wait until
* first alive node is detected * first live node is detected
* @param timeout_after_first_alive number of seconds to wait after * @param timeout_after_first_alive Number of seconds to wait after
* first alive node is detected * first live node is detected
* *
* @return 0 all nodes alive, * @return = 0 all nodes live,
* > 0 at least one node alive, * > 0 at least one node live,
* < 0 error * < 0 error
*/ */
int wait_until_ready(int timeout_for_first_alive, int wait_until_ready(int timeout_for_first_alive,
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
extern "C" { extern "C" {
#endif #endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
typedef enum typedef enum
{ {
ndberror_st_success = 0, ndberror_st_success = 0,
...@@ -93,6 +95,8 @@ const char *ndberror_classification_message(ndberror_classification); ...@@ -93,6 +95,8 @@ const char *ndberror_classification_message(ndberror_classification);
void ndberror_update(ndberror_struct *); void ndberror_update(ndberror_struct *);
int ndb_error_string(int err_no, char *str, unsigned int size); int ndb_error_string(int err_no, char *str, unsigned int size);
#endif /* doxygen skip internal*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -105,10 +105,6 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = { ...@@ -105,10 +105,6 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
{ EventReport::CreateLogBytes, LogLevel::llInfo, 11, Logger::LL_INFO }, { EventReport::CreateLogBytes, LogLevel::llInfo, 11, Logger::LL_INFO },
{ EventReport::InfoEvent, LogLevel::llInfo, 2, Logger::LL_INFO }, { EventReport::InfoEvent, LogLevel::llInfo, 2, Logger::LL_INFO },
//Global replication
{ EventReport::GrepSubscriptionInfo, LogLevel::llGrep, 7, Logger::LL_INFO},
{ EventReport::GrepSubscriptionAlert, LogLevel::llGrep, 7, Logger::LL_ALERT},
// Backup // Backup
{ EventReport::BackupStarted, LogLevel::llBackup, 7, Logger::LL_INFO }, { EventReport::BackupStarted, LogLevel::llBackup, 7, Logger::LL_INFO },
{ EventReport::BackupCompleted, LogLevel::llBackup, 7, Logger::LL_INFO }, { EventReport::BackupCompleted, LogLevel::llBackup, 7, Logger::LL_INFO },
......
...@@ -916,67 +916,68 @@ ndb_mgm_restart(NdbMgmHandle handle, int no_of_nodes, const int *node_list) ...@@ -916,67 +916,68 @@ ndb_mgm_restart(NdbMgmHandle handle, int no_of_nodes, const int *node_list)
return ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0); return ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0);
} }
static const char *clusterlog_level_names[]= static const char *clusterlog_severity_names[]=
{ "enabled", "debug", "info", "warning", "error", "critical", "alert" }; { "enabled", "debug", "info", "warning", "error", "critical", "alert" };
struct ndb_mgm_clusterlog_levels struct ndb_mgm_event_severities
{ {
const char* name; const char* name;
enum ndb_mgm_clusterlog_level level; enum ndb_mgm_event_severity severity;
} clusterlog_levels[] = { } clusterlog_severities[] = {
{ clusterlog_level_names[0], NDB_MGM_CLUSTERLOG_ON }, { clusterlog_severity_names[0], NDB_MGM_EVENT_SEVERITY_ON },
{ clusterlog_level_names[1], NDB_MGM_CLUSTERLOG_DEBUG }, { clusterlog_severity_names[1], NDB_MGM_EVENT_SEVERITY_DEBUG },
{ clusterlog_level_names[2], NDB_MGM_CLUSTERLOG_INFO }, { clusterlog_severity_names[2], NDB_MGM_EVENT_SEVERITY_INFO },
{ clusterlog_level_names[3], NDB_MGM_CLUSTERLOG_WARNING }, { clusterlog_severity_names[3], NDB_MGM_EVENT_SEVERITY_WARNING },
{ clusterlog_level_names[4], NDB_MGM_CLUSTERLOG_ERROR }, { clusterlog_severity_names[4], NDB_MGM_EVENT_SEVERITY_ERROR },
{ clusterlog_level_names[5], NDB_MGM_CLUSTERLOG_CRITICAL }, { clusterlog_severity_names[5], NDB_MGM_EVENT_SEVERITY_CRITICAL },
{ clusterlog_level_names[6], NDB_MGM_CLUSTERLOG_ALERT }, { clusterlog_severity_names[6], NDB_MGM_EVENT_SEVERITY_ALERT },
{ "all", NDB_MGM_CLUSTERLOG_ALL }, { "all", NDB_MGM_EVENT_SEVERITY_ALL },
{ 0, NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL }, { 0, NDB_MGM_ILLEGAL_EVENT_SEVERITY },
}; };
extern "C" extern "C"
ndb_mgm_clusterlog_level ndb_mgm_event_severity
ndb_mgm_match_clusterlog_level(const char * name) ndb_mgm_match_event_severity(const char * name)
{ {
if(name == 0) if(name == 0)
return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; return NDB_MGM_ILLEGAL_EVENT_SEVERITY;
for(int i = 0; clusterlog_levels[i].name !=0 ; i++) for(int i = 0; clusterlog_severities[i].name !=0 ; i++)
if(strcasecmp(name, clusterlog_levels[i].name) == 0) if(strcasecmp(name, clusterlog_severities[i].name) == 0)
return clusterlog_levels[i].level; return clusterlog_severities[i].severity;
return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; return NDB_MGM_ILLEGAL_EVENT_SEVERITY;
} }
extern "C" extern "C"
const char * const char *
ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level) ndb_mgm_get_event_severity_string(enum ndb_mgm_event_severity severity)
{ {
int i= (int)level; int i= (int)severity;
if (i >= 0 && i < (int)NDB_MGM_CLUSTERLOG_ALL) if (i >= 0 && i < (int)NDB_MGM_EVENT_SEVERITY_ALL)
return clusterlog_level_names[i]; return clusterlog_severity_names[i];
for(i = (int)NDB_MGM_CLUSTERLOG_ALL; clusterlog_levels[i].name != 0; i++) for(i = (int)NDB_MGM_EVENT_SEVERITY_ALL; clusterlog_severities[i].name != 0; i++)
if(clusterlog_levels[i].level == level) if(clusterlog_severities[i].severity == severity)
return clusterlog_levels[i].name; return clusterlog_severities[i].name;
return 0; return 0;
} }
extern "C" extern "C"
unsigned int * const unsigned int *
ndb_mgm_get_logfilter(NdbMgmHandle handle) ndb_mgm_get_clusterlog_severity_filter(NdbMgmHandle handle)
{ {
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_logfilter"); SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_clusterlog_severity_filter");
static Uint32 enabled[(int)NDB_MGM_CLUSTERLOG_ALL] = {0,0,0,0,0,0,0}; static unsigned int enabled[(int)NDB_MGM_EVENT_SEVERITY_ALL]=
{0,0,0,0,0,0,0};
const ParserRow<ParserDummy> getinfo_reply[] = { const ParserRow<ParserDummy> getinfo_reply[] = {
MGM_CMD("clusterlog", NULL, ""), MGM_CMD("clusterlog", NULL, ""),
MGM_ARG(clusterlog_level_names[0], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[0], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[1], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[1], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[2], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[2], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[3], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[3], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[4], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[4], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[5], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[5], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[6], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[6], Int, Mandatory, ""),
}; };
CHECK_HANDLE(handle, NULL); CHECK_HANDLE(handle, NULL);
CHECK_CONNECTED(handle, NULL); CHECK_CONNECTED(handle, NULL);
...@@ -986,20 +987,21 @@ ndb_mgm_get_logfilter(NdbMgmHandle handle) ...@@ -986,20 +987,21 @@ ndb_mgm_get_logfilter(NdbMgmHandle handle)
reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args); reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args);
CHECK_REPLY(reply, NULL); CHECK_REPLY(reply, NULL);
for(int i=0; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { for(int i=0; i < (int)NDB_MGM_EVENT_SEVERITY_ALL; i++) {
reply->get(clusterlog_level_names[i], &enabled[i]); reply->get(clusterlog_severity_names[i], &enabled[i]);
} }
return enabled; return enabled;
} }
extern "C" extern "C"
int int
ndb_mgm_filter_clusterlog(NdbMgmHandle handle, ndb_mgm_set_clusterlog_severity_filter(NdbMgmHandle handle,
enum ndb_mgm_clusterlog_level level, enum ndb_mgm_event_severity severity,
int enable, int enable,
struct ndb_mgm_reply* /*reply*/) struct ndb_mgm_reply* /*reply*/)
{ {
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_filter_clusterlog"); SET_ERROR(handle, NDB_MGM_NO_ERROR,
"Executing: ndb_mgm_set_clusterlog_severity_filter");
const ParserRow<ParserDummy> filter_reply[] = { const ParserRow<ParserDummy> filter_reply[] = {
MGM_CMD("set logfilter reply", NULL, ""), MGM_CMD("set logfilter reply", NULL, ""),
MGM_ARG("result", String, Mandatory, "Error message"), MGM_ARG("result", String, Mandatory, "Error message"),
...@@ -1010,7 +1012,7 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle, ...@@ -1010,7 +1012,7 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
CHECK_CONNECTED(handle, -1); CHECK_CONNECTED(handle, -1);
Properties args; Properties args;
args.put("level", level); args.put("level", severity);
args.put("enable", enable); args.put("enable", enable);
const Properties *reply; const Properties *reply;
...@@ -1045,10 +1047,9 @@ struct ndb_mgm_event_categories ...@@ -1045,10 +1047,9 @@ struct ndb_mgm_event_categories
{ "CHECKPOINT", NDB_MGM_EVENT_CATEGORY_CHECKPOINT }, { "CHECKPOINT", NDB_MGM_EVENT_CATEGORY_CHECKPOINT },
{ "DEBUG", NDB_MGM_EVENT_CATEGORY_DEBUG }, { "DEBUG", NDB_MGM_EVENT_CATEGORY_DEBUG },
{ "INFO", NDB_MGM_EVENT_CATEGORY_INFO }, { "INFO", NDB_MGM_EVENT_CATEGORY_INFO },
{ "WARNING", NDB_MGM_EVENT_CATEGORY_WARNING },
{ "ERROR", NDB_MGM_EVENT_CATEGORY_ERROR }, { "ERROR", NDB_MGM_EVENT_CATEGORY_ERROR },
{ "GREP", NDB_MGM_EVENT_CATEGORY_GREP },
{ "BACKUP", NDB_MGM_EVENT_CATEGORY_BACKUP }, { "BACKUP", NDB_MGM_EVENT_CATEGORY_BACKUP },
{ "CONGESTION", NDB_MGM_EVENT_CATEGORY_CONGESTION },
{ 0, NDB_MGM_ILLEGAL_EVENT_CATEGORY } { 0, NDB_MGM_ILLEGAL_EVENT_CATEGORY }
}; };
...@@ -1080,13 +1081,13 @@ ndb_mgm_get_event_category_string(enum ndb_mgm_event_category status) ...@@ -1080,13 +1081,13 @@ ndb_mgm_get_event_category_string(enum ndb_mgm_event_category status)
extern "C" extern "C"
int int
ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId, ndb_mgm_set_clusterlog_loglevel(NdbMgmHandle handle, int nodeId,
enum ndb_mgm_event_category cat, enum ndb_mgm_event_category cat,
int level, int level,
struct ndb_mgm_reply* /*reply*/) struct ndb_mgm_reply* /*reply*/)
{ {
SET_ERROR(handle, NDB_MGM_NO_ERROR, SET_ERROR(handle, NDB_MGM_NO_ERROR,
"Executing: ndb_mgm_set_loglevel_clusterlog"); "Executing: ndb_mgm_set_clusterlog_loglevel");
const ParserRow<ParserDummy> clusterlog_reply[] = { const ParserRow<ParserDummy> clusterlog_reply[] = {
MGM_CMD("set cluster loglevel reply", NULL, ""), MGM_CMD("set cluster loglevel reply", NULL, ""),
MGM_ARG("result", String, Mandatory, "Error message"), MGM_ARG("result", String, Mandatory, "Error message"),
...@@ -1105,7 +1106,7 @@ ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId, ...@@ -1105,7 +1106,7 @@ ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId,
"set cluster loglevel", &args); "set cluster loglevel", &args);
CHECK_REPLY(reply, -1); CHECK_REPLY(reply, -1);
DBUG_ENTER("ndb_mgm_set_loglevel_clusterlog"); DBUG_ENTER("ndb_mgm_set_clusterlog_loglevel");
DBUG_PRINT("enter",("node=%d, category=%d, level=%d", nodeId, cat, level)); DBUG_PRINT("enter",("node=%d, category=%d, level=%d", nodeId, cat, level));
BaseString result; BaseString result;
...@@ -1157,7 +1158,7 @@ ndb_mgm_set_loglevel_node(NdbMgmHandle handle, int nodeId, ...@@ -1157,7 +1158,7 @@ ndb_mgm_set_loglevel_node(NdbMgmHandle handle, int nodeId,
extern "C" extern "C"
int int
ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]) ndb_mgm_listen_event(NdbMgmHandle handle, const int filter[])
{ {
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_listen_event"); SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_listen_event");
const ParserRow<ParserDummy> stat_reply[] = { const ParserRow<ParserDummy> stat_reply[] = {
...@@ -1195,7 +1196,10 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]) ...@@ -1195,7 +1196,10 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[])
handle->socket = tmp; handle->socket = tmp;
CHECK_REPLY(reply, -1); if(reply == NULL) {
close(sockfd);
CHECK_REPLY(reply, -1);
}
return sockfd; return sockfd;
} }
......
...@@ -1246,7 +1246,7 @@ CommandInterpreter::executeClusterLog(char* parameters) ...@@ -1246,7 +1246,7 @@ CommandInterpreter::executeClusterLog(char* parameters)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; enum ndb_mgm_event_severity severity = NDB_MGM_EVENT_SEVERITY_ALL;
char * tmpString = my_strdup(parameters,MYF(MY_WME)); char * tmpString = my_strdup(parameters,MYF(MY_WME));
My_auto_ptr<char> ap1(tmpString); My_auto_ptr<char> ap1(tmpString);
...@@ -1254,7 +1254,7 @@ CommandInterpreter::executeClusterLog(char* parameters) ...@@ -1254,7 +1254,7 @@ CommandInterpreter::executeClusterLog(char* parameters)
char * item = strtok_r(tmpString, " ", &tmpPtr); char * item = strtok_r(tmpString, " ", &tmpPtr);
int enable; int enable;
Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); const unsigned int *enabled= ndb_mgm_get_logfilter(m_mgmsrv);
if(enabled == NULL) { if(enabled == NULL) {
ndbout << "Couldn't get status" << endl; ndbout << "Couldn't get status" << endl;
printError(); printError();
...@@ -1276,8 +1276,8 @@ CommandInterpreter::executeClusterLog(char* parameters) ...@@ -1276,8 +1276,8 @@ CommandInterpreter::executeClusterLog(char* parameters)
printf("enabled[%d] = %d\n", i, enabled[i]); printf("enabled[%d] = %d\n", i, enabled[i]);
#endif #endif
ndbout << "Severities enabled: "; ndbout << "Severities enabled: ";
for(i = 1; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { for(i = 1; i < (int)NDB_MGM_EVENT_SEVERITY_ALL; i++) {
const char *str= ndb_mgm_get_clusterlog_level_string((ndb_mgm_clusterlog_level)i); const char *str= ndb_mgm_get_event_severity_string((ndb_mgm_event_severity)i);
if (str == 0) if (str == 0)
{ {
DBUG_ASSERT(false); DBUG_ASSERT(false);
...@@ -1311,8 +1311,10 @@ CommandInterpreter::executeClusterLog(char* parameters) ...@@ -1311,8 +1311,10 @@ CommandInterpreter::executeClusterLog(char* parameters)
int res_enable; int res_enable;
item = strtok_r(NULL, " ", &tmpPtr); item = strtok_r(NULL, " ", &tmpPtr);
if (item == NULL) { if (item == NULL) {
res_enable= ndb_mgm_filter_clusterlog(m_mgmsrv, res_enable=
NDB_MGM_CLUSTERLOG_ON, enable, NULL); ndb_mgm_set_clusterlog_severity_filter(m_mgmsrv,
NDB_MGM_EVENT_SEVERITY_ON,
enable, NULL);
if (res_enable < 0) if (res_enable < 0)
{ {
ndbout << "Couldn't set filter" << endl; ndbout << "Couldn't set filter" << endl;
...@@ -1324,32 +1326,33 @@ CommandInterpreter::executeClusterLog(char* parameters) ...@@ -1324,32 +1326,33 @@ CommandInterpreter::executeClusterLog(char* parameters)
} }
do { do {
severity= NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; severity= NDB_MGM_ILLEGAL_EVENT_SEVERITY;
if (strcasecmp(item, "ALL") == 0) { if (strcasecmp(item, "ALL") == 0) {
severity = NDB_MGM_CLUSTERLOG_ALL; severity = NDB_MGM_EVENT_SEVERITY_ALL;
} else if (strcasecmp(item, "ALERT") == 0) { } else if (strcasecmp(item, "ALERT") == 0) {
severity = NDB_MGM_CLUSTERLOG_ALERT; severity = NDB_MGM_EVENT_SEVERITY_ALERT;
} else if (strcasecmp(item, "CRITICAL") == 0) { } else if (strcasecmp(item, "CRITICAL") == 0) {
severity = NDB_MGM_CLUSTERLOG_CRITICAL; severity = NDB_MGM_EVENT_SEVERITY_CRITICAL;
} else if (strcasecmp(item, "ERROR") == 0) { } else if (strcasecmp(item, "ERROR") == 0) {
severity = NDB_MGM_CLUSTERLOG_ERROR; severity = NDB_MGM_EVENT_SEVERITY_ERROR;
} else if (strcasecmp(item, "WARNING") == 0) { } else if (strcasecmp(item, "WARNING") == 0) {
severity = NDB_MGM_CLUSTERLOG_WARNING; severity = NDB_MGM_EVENT_SEVERITY_WARNING;
} else if (strcasecmp(item, "INFO") == 0) { } else if (strcasecmp(item, "INFO") == 0) {
severity = NDB_MGM_CLUSTERLOG_INFO; severity = NDB_MGM_EVENT_SEVERITY_INFO;
} else if (strcasecmp(item, "DEBUG") == 0) { } else if (strcasecmp(item, "DEBUG") == 0) {
severity = NDB_MGM_CLUSTERLOG_DEBUG; severity = NDB_MGM_EVENT_SEVERITY_DEBUG;
} else if (strcasecmp(item, "OFF") == 0 || } else if (strcasecmp(item, "OFF") == 0 ||
strcasecmp(item, "ON") == 0) { strcasecmp(item, "ON") == 0) {
if (enable < 0) // only makes sense with toggle if (enable < 0) // only makes sense with toggle
severity = NDB_MGM_CLUSTERLOG_ON; severity = NDB_MGM_EVENT_SEVERITY_ON;
} }
if (severity == NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL) { if (severity == NDB_MGM_ILLEGAL_EVENT_SEVERITY) {
ndbout << "Invalid severity level: " << item << endl; ndbout << "Invalid severity level: " << item << endl;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
res_enable = ndb_mgm_filter_clusterlog(m_mgmsrv, severity, enable, NULL); res_enable= ndb_mgm_set_clusterlog_severity_filter(m_mgmsrv, severity,
enable, NULL);
if (res_enable < 0) if (res_enable < 0)
{ {
ndbout << "Couldn't set filter" << endl; ndbout << "Couldn't set filter" << endl;
......
...@@ -1105,6 +1105,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1105,6 +1105,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0", "0",
"15" }, "15" },
{
CFG_LOGLEVEL_CONGESTION,
"LogLevelCongestion",
DB_TOKEN,
"Congestion info printed on stdout",
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_INT,
"0",
"0",
"15" },
{ {
CFG_LOGLEVEL_ERROR, CFG_LOGLEVEL_ERROR,
"LogLevelError", "LogLevelError",
......
...@@ -1184,13 +1184,13 @@ MgmApiSession::startAll(Parser<MgmApiSession>::Context &, ...@@ -1184,13 +1184,13 @@ MgmApiSession::startAll(Parser<MgmApiSession>::Context &,
void void
MgmApiSession::setLogFilter(Parser_t::Context &ctx, MgmApiSession::setLogFilter(Parser_t::Context &ctx,
const class Properties &args) { const class Properties &args) {
Uint32 level; Uint32 severity;
Uint32 enable; Uint32 enable;
args.get("level", &level); args.get("level", &severity);
args.get("enable", &enable); args.get("enable", &enable);
int result = m_mgmsrv.setEventLogFilter(level, enable); int result = m_mgmsrv.setEventLogFilter(severity, enable);
m_output->println("set logfilter reply"); m_output->println("set logfilter reply");
m_output->println("result: %d", result); m_output->println("result: %d", result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment