Commit d7a066ab authored by tomas@poseidon.ndb.mysql.com's avatar tomas@poseidon.ndb.mysql.com

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

into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
parents b4c25113 d42f92d2
......@@ -26,17 +26,17 @@ CONNECT [<connectstring>] Connect to management server (reconnect i
QUIT Quit management client
<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
<id> = ALL | Any database node id
Connected to Management Server at: localhost:1186
Node 1: started (Version 4.1.9)
Node 2: started (Version 4.1.9)
Node 1: started (Version 5.0.3)
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 2 OK!
......
......@@ -8,5 +8,5 @@ sleep 5
all clusterlog connection=8
sleep 1
1 restart
sleep 5
sleep 10
clusterlog on all
......@@ -14,6 +14,8 @@
# General configuration options
#---------------------------------------------------------------------------
DETAILS_AT_TOP = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
......
......@@ -13,8 +13,8 @@
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
DETAILS_AT_TOP = yes
HIDE_FRIEND_COMPOUNDS = yes
DETAILS_AT_TOP = YES
HIDE_FRIEND_COMPOUNDS = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
......
......@@ -14,6 +14,8 @@
# General configuration options
#---------------------------------------------------------------------------
DETAILS_AT_TOP = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
......
......@@ -14,6 +14,8 @@
# General configuration options
#---------------------------------------------------------------------------
DETAILS_AT_TOP = YES
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
......
......@@ -145,9 +145,6 @@ int create_table(Ndb * myNdb);
int tempErrors = 0;
int permErrors = 0;
/**
* Helper function for callback(...)
*/
void
closeTransaction(Ndb * ndb , async_callback_t * cb)
{
......
......@@ -57,7 +57,7 @@ public:
llInfo = CFG_LOGLEVEL_INFO - CFG_MIN_LOGLEVEL,
llWarning = CFG_LOGLEVEL_WARNING - 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
,llBackup = CFG_LOGLEVEL_BACKUP - CFG_MIN_LOGLEVEL
};
......
This diff is collapsed.
......@@ -94,7 +94,7 @@
#define CFG_LOGLEVEL_INFO 256
#define CFG_LOGLEVEL_WARNING 257
#define CFG_LOGLEVEL_ERROR 258
#define CFG_LOGLEVEL_GREP 259
#define CFG_LOGLEVEL_CONGESTION 259
#define CFG_LOGLEVEL_DEBUG 260
#define CFG_LOGLEVEL_BACKUP 261
#define CFG_MAX_LOGLEVEL 261
......
This diff is collapsed.
......@@ -107,6 +107,9 @@ public:
Closed = 3,
Invalid = 9
};
/**
* Get the state of a NdbBlob object.
*/
State getState();
/**
* Inline blob header.
......@@ -116,7 +119,7 @@ public:
};
/**
* 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
* after the data read.
*/
......@@ -129,10 +132,10 @@ public:
*/
int setValue(const void* data, Uint32 bytes);
/**
* Callback for setActiveHook. Invoked immediately when the prepared
* operation has been executed (but not committed). Any getValue 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
* Callback for setActiveHook(). Invoked immediately when the prepared
* operation has been executed (but not committed). Any getValue() 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
* argument is passed along. Returns non-zero on error.
*/
typedef int ActiveHook(NdbBlob* me, void* arg);
......@@ -195,10 +198,15 @@ public:
const NdbError& getNdbError() const;
/**
* Return info about all blobs in this operation.
*
* Get first blob in list.
*/
// Get first blob in list
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();
private:
......
......@@ -631,7 +631,7 @@ public:
* Assignment operator, deep copy
* @param table Table to be copied
*/
Table& operator=(const Table&);
Table& operator=(const Table& table);
/**
* Name of table
......@@ -946,12 +946,12 @@ public:
#endif
};
/*
/**
* Constructor
* @param name Name of event
*/
Event(const char *name);
/*
/**
* Constructor
* @param name Name of event
* @param table Reference retrieved from NdbDictionary
......@@ -994,9 +994,12 @@ public:
*/
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;
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
void addColumn(const Column &c);
......@@ -1116,6 +1119,13 @@ public:
/**
* 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,
......@@ -1168,10 +1178,10 @@ public:
/**
* Create event given defined Event instance
* @param Event to create
* @param event Event to create
* @return 0 if successful otherwise -1.
*/
int createEvent(const Event &);
int createEvent(const Event &event);
/**
* Drop event with given name
......@@ -1199,17 +1209,17 @@ public:
/**
* Create defined table given defined Table instance
* @param Table Table to create
* @param table Table to create
* @return 0 if successful otherwise -1.
*/
int createTable(const Table &);
int createTable(const Table &table);
/**
* Drop table given retrieved Table instance
* @param Table Table to drop
* @param table Table to drop
* @return 0 if successful otherwise -1.
*/
int dropTable(Table &);
int dropTable(Table & table);
/**
* Drop table given table name
......@@ -1220,12 +1230,12 @@ public:
/**
* Alter defined table given defined Table instance
* @param Table Table to alter
* @param table Table to alter
* @return -2 (incompatible version) <br>
* -1 general error <br>
* 0 success
*/
int alterTable(const Table &);
int alterTable(const Table &table);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
......@@ -1257,10 +1267,10 @@ public:
/**
* Create index given defined Index instance
* @param Index to create
* @param index Index to create
* @return 0 if successful otherwise -1.
*/
int createIndex(const Index &);
int createIndex(const Index &index);
/**
* Drop index with given name
......
......@@ -204,6 +204,7 @@ struct NdbError {
*/
char * details;
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
NdbError(){
status = UnknownResult;
classification = NoError;
......@@ -227,6 +228,7 @@ struct NdbError {
ndberror.details = details;
return ndberror;
}
#endif
};
class NdbOut& operator <<(class NdbOut&, const NdbError &);
......
......@@ -132,7 +132,7 @@ public:
* next() has returned a value greater than
* zero. If a specific attribute has not changed the corresponding
* 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 aValue If this is non-NULL, then the attribute value
......@@ -144,6 +144,9 @@ public:
* (indicating error).
*/
NdbRecAttr *getValue(const char *anAttrName, char *aValue = 0);
/**
* See getValue().
*/
NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = 0);
/**
......
......@@ -45,7 +45,7 @@ public:
* @returns 0 for success and -1 for failure
* @see NdbScanOperation::readTuples
*/
int readTuples(LockMode = LM_Read,
int readTuples(LockMode lock_mode = LM_Read,
Uint32 batch = 0,
Uint32 parallel = 0,
bool order_by = false,
......@@ -90,15 +90,14 @@ public:
* An index stores also all-NULL keys. Doing index scan with empty
* bound set returns all table tuples.
*
* @param attrName Attribute name, alternatively:
* @param anAttrId Index column id (starting from 0)
* @param attr Attribute name, alternatively:
* @param type Type of bound
* @param value Pointer to bound value, 0 for NULL
* @param len Value length in bytes.
* Fixed per datatype and can be omitted
* @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.
......
......@@ -966,6 +966,7 @@ protected:
#include <stdlib.h>
#endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
inline
int
......@@ -1215,4 +1216,6 @@ NdbOperation::setValue(Uint32 anAttrId, double aPar)
return setValue(anAttrId, (const char*)&aPar, (Uint32)8);
}
#endif // doxygen
#endif
......@@ -281,6 +281,8 @@ private:
const NdbDictionary::Column* m_column;
};
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
inline
NdbDictionary::Column::Type
NdbRecAttr::getType() const {
......@@ -457,5 +459,7 @@ NdbRecAttr::isNULL() const
class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &);
#endif // ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#endif
......@@ -71,6 +71,7 @@ public:
* from the scanned tuple.
*
* @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
* when necessary to do so unless you set the fetchAllowed
......@@ -122,6 +123,13 @@ public:
* @return an NdbOperation or NULL.
*/
NdbOperation* updateCurrentTuple();
/**
* Update current tuple
*
* @param updateTrans Transaction that should perform the update
*
* @return an NdbOperation or NULL.
*/
NdbOperation* updateCurrentTuple(NdbTransaction* updateTrans);
/**
......@@ -129,6 +137,13 @@ public:
* @return 0 on success or -1 on failure
*/
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);
/**
......
......@@ -796,6 +796,8 @@ private:
void define_scan_op(NdbIndexScanOperation*);
};
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
inline
Uint32
NdbTransaction::get_send_size()
......@@ -1034,4 +1036,6 @@ NdbTransaction::ptr2int(){
typedef NdbTransaction NdbConnection;
#endif // ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#endif
......@@ -20,39 +20,42 @@
/**
* @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
* Ndb_cluster_connection object. Your application should contain
* only one Ndb_cluster_connection. Your application connects to
* a cluster management server when method connect() is called.
* With the method wait_until_ready() it is possible to wait
* for the connection to one or several storage nodes.
* Any NDB application program should begin with the creation of a
* single Ndb_cluster_connection object, and should make use of one
* and only one Ndb_cluster_connection. The application connects to
* a cluster management server when this object's connect() method is called.
* By using the wait_until_ready() method it is possible to wait
* for the connection to reach one or more storage nodes.
*/
class Ndb_cluster_connection {
public:
/**
* 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
*/
Ndb_cluster_connection(const char * connect_string = 0);
Ndb_cluster_connection(const char * connectstring = 0);
~Ndb_cluster_connection();
/**
* Connect to a cluster management server
*
* @param no_retries specifies the number of retries to perform
* if the connect fails, negative number results in infinite
* number of retries
* @param no_retries specifies the number of retries to attempt
* in the event of connection failure; a negative value
* will result in the attempt to connect being repeated
* indefinitely
*
* @param retry_delay_in_seconds specifies how often retries should
* be performed
* @param verbose specifies if the method should print progess
*
* @return 0 if success,
* 1 if retriable error,
* -1 if non-retriable error
* @param verbose specifies if the method should print a report of its progess
*
* @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);
......@@ -61,15 +64,15 @@ public:
#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
* first alive node is detected
* @param timeout_after_first_alive number of seconds to wait after
* first alive node is detected
* @param timeout_for_first_alive Number of seconds to wait until
* first live node is detected
* @param timeout_after_first_alive Number of seconds to wait after
* first live node is detected
*
* @return 0 all nodes alive,
* > 0 at least one node alive,
* @return = 0 all nodes live,
* > 0 at least one node live,
* < 0 error
*/
int wait_until_ready(int timeout_for_first_alive,
......
......@@ -21,6 +21,8 @@
extern "C" {
#endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
typedef enum
{
ndberror_st_success = 0,
......@@ -93,6 +95,8 @@ const char *ndberror_classification_message(ndberror_classification);
void ndberror_update(ndberror_struct *);
int ndb_error_string(int err_no, char *str, unsigned int size);
#endif /* doxygen skip internal*/
#ifdef __cplusplus
}
#endif
......
......@@ -105,10 +105,6 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
{ EventReport::CreateLogBytes, LogLevel::llInfo, 11, 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
{ EventReport::BackupStarted, 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)
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" };
struct ndb_mgm_clusterlog_levels
struct ndb_mgm_event_severities
{
const char* name;
enum ndb_mgm_clusterlog_level level;
} clusterlog_levels[] = {
{ clusterlog_level_names[0], NDB_MGM_CLUSTERLOG_ON },
{ clusterlog_level_names[1], NDB_MGM_CLUSTERLOG_DEBUG },
{ clusterlog_level_names[2], NDB_MGM_CLUSTERLOG_INFO },
{ clusterlog_level_names[3], NDB_MGM_CLUSTERLOG_WARNING },
{ clusterlog_level_names[4], NDB_MGM_CLUSTERLOG_ERROR },
{ clusterlog_level_names[5], NDB_MGM_CLUSTERLOG_CRITICAL },
{ clusterlog_level_names[6], NDB_MGM_CLUSTERLOG_ALERT },
{ "all", NDB_MGM_CLUSTERLOG_ALL },
{ 0, NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL },
enum ndb_mgm_event_severity severity;
} clusterlog_severities[] = {
{ clusterlog_severity_names[0], NDB_MGM_EVENT_SEVERITY_ON },
{ clusterlog_severity_names[1], NDB_MGM_EVENT_SEVERITY_DEBUG },
{ clusterlog_severity_names[2], NDB_MGM_EVENT_SEVERITY_INFO },
{ clusterlog_severity_names[3], NDB_MGM_EVENT_SEVERITY_WARNING },
{ clusterlog_severity_names[4], NDB_MGM_EVENT_SEVERITY_ERROR },
{ clusterlog_severity_names[5], NDB_MGM_EVENT_SEVERITY_CRITICAL },
{ clusterlog_severity_names[6], NDB_MGM_EVENT_SEVERITY_ALERT },
{ "all", NDB_MGM_EVENT_SEVERITY_ALL },
{ 0, NDB_MGM_ILLEGAL_EVENT_SEVERITY },
};
extern "C"
ndb_mgm_clusterlog_level
ndb_mgm_match_clusterlog_level(const char * name)
ndb_mgm_event_severity
ndb_mgm_match_event_severity(const char * name)
{
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++)
if(strcasecmp(name, clusterlog_levels[i].name) == 0)
return clusterlog_levels[i].level;
for(int i = 0; clusterlog_severities[i].name !=0 ; i++)
if(strcasecmp(name, clusterlog_severities[i].name) == 0)
return clusterlog_severities[i].severity;
return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL;
return NDB_MGM_ILLEGAL_EVENT_SEVERITY;
}
extern "C"
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;
if (i >= 0 && i < (int)NDB_MGM_CLUSTERLOG_ALL)
return clusterlog_level_names[i];
for(i = (int)NDB_MGM_CLUSTERLOG_ALL; clusterlog_levels[i].name != 0; i++)
if(clusterlog_levels[i].level == level)
return clusterlog_levels[i].name;
int i= (int)severity;
if (i >= 0 && i < (int)NDB_MGM_EVENT_SEVERITY_ALL)
return clusterlog_severity_names[i];
for(i = (int)NDB_MGM_EVENT_SEVERITY_ALL; clusterlog_severities[i].name != 0; i++)
if(clusterlog_severities[i].severity == severity)
return clusterlog_severities[i].name;
return 0;
}
extern "C"
unsigned int *
ndb_mgm_get_logfilter(NdbMgmHandle handle)
const unsigned int *
ndb_mgm_get_clusterlog_severity_filter(NdbMgmHandle handle)
{
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_logfilter");
static Uint32 enabled[(int)NDB_MGM_CLUSTERLOG_ALL] = {0,0,0,0,0,0,0};
SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_clusterlog_severity_filter");
static unsigned int enabled[(int)NDB_MGM_EVENT_SEVERITY_ALL]=
{0,0,0,0,0,0,0};
const ParserRow<ParserDummy> getinfo_reply[] = {
MGM_CMD("clusterlog", NULL, ""),
MGM_ARG(clusterlog_level_names[0], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[1], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[2], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[3], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[4], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[5], Int, Mandatory, ""),
MGM_ARG(clusterlog_level_names[6], Int, Mandatory, ""),
MGM_ARG(clusterlog_severity_names[0], Int, Mandatory, ""),
MGM_ARG(clusterlog_severity_names[1], Int, Mandatory, ""),
MGM_ARG(clusterlog_severity_names[2], Int, Mandatory, ""),
MGM_ARG(clusterlog_severity_names[3], Int, Mandatory, ""),
MGM_ARG(clusterlog_severity_names[4], Int, Mandatory, ""),
MGM_ARG(clusterlog_severity_names[5], Int, Mandatory, ""),
MGM_ARG(clusterlog_severity_names[6], Int, Mandatory, ""),
};
CHECK_HANDLE(handle, NULL);
CHECK_CONNECTED(handle, NULL);
......@@ -986,20 +987,21 @@ ndb_mgm_get_logfilter(NdbMgmHandle handle)
reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args);
CHECK_REPLY(reply, NULL);
for(int i=0; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) {
reply->get(clusterlog_level_names[i], &enabled[i]);
for(int i=0; i < (int)NDB_MGM_EVENT_SEVERITY_ALL; i++) {
reply->get(clusterlog_severity_names[i], &enabled[i]);
}
return enabled;
}
extern "C"
int
ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
enum ndb_mgm_clusterlog_level level,
ndb_mgm_set_clusterlog_severity_filter(NdbMgmHandle handle,
enum ndb_mgm_event_severity severity,
int enable,
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[] = {
MGM_CMD("set logfilter reply", NULL, ""),
MGM_ARG("result", String, Mandatory, "Error message"),
......@@ -1010,7 +1012,7 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
CHECK_CONNECTED(handle, -1);
Properties args;
args.put("level", level);
args.put("level", severity);
args.put("enable", enable);
const Properties *reply;
......@@ -1045,10 +1047,9 @@ struct ndb_mgm_event_categories
{ "CHECKPOINT", NDB_MGM_EVENT_CATEGORY_CHECKPOINT },
{ "DEBUG", NDB_MGM_EVENT_CATEGORY_DEBUG },
{ "INFO", NDB_MGM_EVENT_CATEGORY_INFO },
{ "WARNING", NDB_MGM_EVENT_CATEGORY_WARNING },
{ "ERROR", NDB_MGM_EVENT_CATEGORY_ERROR },
{ "GREP", NDB_MGM_EVENT_CATEGORY_GREP },
{ "BACKUP", NDB_MGM_EVENT_CATEGORY_BACKUP },
{ "CONGESTION", NDB_MGM_EVENT_CATEGORY_CONGESTION },
{ 0, NDB_MGM_ILLEGAL_EVENT_CATEGORY }
};
......@@ -1080,13 +1081,13 @@ ndb_mgm_get_event_category_string(enum ndb_mgm_event_category status)
extern "C"
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,
int level,
struct ndb_mgm_reply* /*reply*/)
{
SET_ERROR(handle, NDB_MGM_NO_ERROR,
"Executing: ndb_mgm_set_loglevel_clusterlog");
"Executing: ndb_mgm_set_clusterlog_loglevel");
const ParserRow<ParserDummy> clusterlog_reply[] = {
MGM_CMD("set cluster loglevel reply", NULL, ""),
MGM_ARG("result", String, Mandatory, "Error message"),
......@@ -1105,7 +1106,7 @@ ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId,
"set cluster loglevel", &args);
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));
BaseString result;
......@@ -1157,7 +1158,7 @@ ndb_mgm_set_loglevel_node(NdbMgmHandle handle, int nodeId,
extern "C"
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");
const ParserRow<ParserDummy> stat_reply[] = {
......@@ -1195,7 +1196,10 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[])
handle->socket = tmp;
if(reply == NULL) {
close(sockfd);
CHECK_REPLY(reply, -1);
}
return sockfd;
}
......
......@@ -1246,7 +1246,7 @@ CommandInterpreter::executeClusterLog(char* parameters)
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));
My_auto_ptr<char> ap1(tmpString);
......@@ -1254,7 +1254,7 @@ CommandInterpreter::executeClusterLog(char* parameters)
char * item = strtok_r(tmpString, " ", &tmpPtr);
int enable;
Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv);
const unsigned int *enabled= ndb_mgm_get_logfilter(m_mgmsrv);
if(enabled == NULL) {
ndbout << "Couldn't get status" << endl;
printError();
......@@ -1276,8 +1276,8 @@ CommandInterpreter::executeClusterLog(char* parameters)
printf("enabled[%d] = %d\n", i, enabled[i]);
#endif
ndbout << "Severities enabled: ";
for(i = 1; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) {
const char *str= ndb_mgm_get_clusterlog_level_string((ndb_mgm_clusterlog_level)i);
for(i = 1; i < (int)NDB_MGM_EVENT_SEVERITY_ALL; i++) {
const char *str= ndb_mgm_get_event_severity_string((ndb_mgm_event_severity)i);
if (str == 0)
{
DBUG_ASSERT(false);
......@@ -1311,8 +1311,10 @@ CommandInterpreter::executeClusterLog(char* parameters)
int res_enable;
item = strtok_r(NULL, " ", &tmpPtr);
if (item == NULL) {
res_enable= ndb_mgm_filter_clusterlog(m_mgmsrv,
NDB_MGM_CLUSTERLOG_ON, enable, NULL);
res_enable=
ndb_mgm_set_clusterlog_severity_filter(m_mgmsrv,
NDB_MGM_EVENT_SEVERITY_ON,
enable, NULL);
if (res_enable < 0)
{
ndbout << "Couldn't set filter" << endl;
......@@ -1324,32 +1326,33 @@ CommandInterpreter::executeClusterLog(char* parameters)
}
do {
severity= NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL;
severity= NDB_MGM_ILLEGAL_EVENT_SEVERITY;
if (strcasecmp(item, "ALL") == 0) {
severity = NDB_MGM_CLUSTERLOG_ALL;
severity = NDB_MGM_EVENT_SEVERITY_ALL;
} else if (strcasecmp(item, "ALERT") == 0) {
severity = NDB_MGM_CLUSTERLOG_ALERT;
severity = NDB_MGM_EVENT_SEVERITY_ALERT;
} else if (strcasecmp(item, "CRITICAL") == 0) {
severity = NDB_MGM_CLUSTERLOG_CRITICAL;
severity = NDB_MGM_EVENT_SEVERITY_CRITICAL;
} else if (strcasecmp(item, "ERROR") == 0) {
severity = NDB_MGM_CLUSTERLOG_ERROR;
severity = NDB_MGM_EVENT_SEVERITY_ERROR;
} else if (strcasecmp(item, "WARNING") == 0) {
severity = NDB_MGM_CLUSTERLOG_WARNING;
severity = NDB_MGM_EVENT_SEVERITY_WARNING;
} else if (strcasecmp(item, "INFO") == 0) {
severity = NDB_MGM_CLUSTERLOG_INFO;
severity = NDB_MGM_EVENT_SEVERITY_INFO;
} else if (strcasecmp(item, "DEBUG") == 0) {
severity = NDB_MGM_CLUSTERLOG_DEBUG;
severity = NDB_MGM_EVENT_SEVERITY_DEBUG;
} else if (strcasecmp(item, "OFF") == 0 ||
strcasecmp(item, "ON") == 0) {
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;
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)
{
ndbout << "Couldn't set filter" << endl;
......
......@@ -1105,6 +1105,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0",
"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,
"LogLevelError",
......
......@@ -1184,13 +1184,13 @@ MgmApiSession::startAll(Parser<MgmApiSession>::Context &,
void
MgmApiSession::setLogFilter(Parser_t::Context &ctx,
const class Properties &args) {
Uint32 level;
Uint32 severity;
Uint32 enable;
args.get("level", &level);
args.get("level", &severity);
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("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