Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
53a8d33b
Commit
53a8d33b
authored
Sep 04, 2006
by
lzhou/root@dev3-138.dev.cn.tlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#BUG21128 add function of get_cluster_loglever().
parent
dbd808ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
0 deletions
+82
-0
ndb/include/mgmapi/mgmapi.h
ndb/include/mgmapi/mgmapi.h
+14
-0
ndb/src/mgmapi/mgmapi.cpp
ndb/src/mgmapi/mgmapi.cpp
+39
-0
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+27
-0
ndb/src/mgmsrv/Services.hpp
ndb/src/mgmsrv/Services.hpp
+2
-0
No files found.
ndb/include/mgmapi/mgmapi.h
View file @
53a8d33b
...
...
@@ -862,6 +862,15 @@ extern "C" {
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 @@ extern "C" {
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
...
...
ndb/src/mgmapi/mgmapi.cpp
View file @
53a8d33b
...
...
@@ -1300,6 +1300,45 @@ ndb_mgm_get_event_category_string(enum ndb_mgm_event_category status)
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
,
...
...
ndb/src/mgmsrv/Services.cpp
View file @
53a8d33b
...
...
@@ -147,6 +147,7 @@ ParserRow<MgmApiSession> commands[] = {
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"
),
...
...
@@ -803,6 +804,32 @@ MgmApiSession::endSession(Parser<MgmApiSession>::Context &,
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
MgmApiSession
::
setClusterLogLevel
(
Parser
<
MgmApiSession
>::
Context
&
,
Properties
const
&
args
)
{
...
...
ndb/src/mgmsrv/Services.hpp
View file @
53a8d33b
...
...
@@ -87,6 +87,8 @@ public:
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment