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
3cb410b8
Commit
3cb410b8
authored
Sep 17, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New mgmapi call - ndb_mtm_listen_event
parent
07c7e1f5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
0 deletions
+54
-0
ndb/include/mgmapi/mgmapi.h
ndb/include/mgmapi/mgmapi.h
+9
-0
ndb/src/mgmapi/mgmapi.cpp
ndb/src/mgmapi/mgmapi.cpp
+42
-0
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+2
-0
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+1
-0
No files found.
ndb/include/mgmapi/mgmapi.h
View file @
3cb410b8
...
...
@@ -668,6 +668,15 @@ extern "C" {
int
ndb_mgm_exit_single_user
(
NdbMgmHandle
handle
,
struct
ndb_mgm_reply
*
reply
);
/**
* Listen event
*
* @param filter pairs of { level, category } that will be
* pushed to fd, level=0 ends lists
* @return fd which events will be pushed to
*/
int
ndb_mgm_listen_event
(
NdbMgmHandle
handle
,
int
filter
[]);
/**
* Get configuration
* @param handle NDB management handle.
...
...
ndb/src/mgmapi/mgmapi.cpp
View file @
3cb410b8
...
...
@@ -1069,6 +1069,48 @@ ndb_mgm_set_loglevel_node(NdbMgmHandle handle, int nodeId,
return
0
;
}
extern
"C"
int
ndb_mgm_listen_event
(
NdbMgmHandle
handle
,
int
filter
[])
{
SET_ERROR
(
handle
,
NDB_MGM_NO_ERROR
,
"Executing: ndb_mgm_listen_event"
);
const
ParserRow
<
ParserDummy
>
stat_reply
[]
=
{
MGM_CMD
(
"listen event"
,
NULL
,
""
),
MGM_ARG
(
"result"
,
Int
,
Mandatory
,
"Error message"
),
MGM_ARG
(
"msg"
,
String
,
Optional
,
"Error message"
),
MGM_END
()
};
CHECK_HANDLE
(
handle
,
-
1
);
SocketClient
s
(
handle
->
hostname
,
handle
->
port
);
const
NDB_SOCKET_TYPE
sockfd
=
s
.
connect
();
if
(
sockfd
<
0
)
{
setError
(
handle
,
NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET
,
__LINE__
,
"Unable to connect to"
);
return
-
1
;
}
Properties
args
;
{
BaseString
tmp
;
for
(
int
i
=
0
;
filter
[
i
]
!=
0
;
i
+=
2
){
tmp
.
appfmt
(
"%d=%d "
,
filter
[
i
+
1
],
filter
[
i
]);
}
args
.
put
(
"filter"
,
tmp
.
c_str
());
}
int
tmp
=
handle
->
socket
;
handle
->
socket
=
sockfd
;
const
Properties
*
reply
;
reply
=
ndb_mgm_call
(
handle
,
stat_reply
,
"listen event"
,
&
args
);
handle
->
socket
=
tmp
;
CHECK_REPLY
(
reply
,
-
1
);
return
sockfd
;
}
extern
"C"
int
ndb_mgm_get_stat_port
(
NdbMgmHandle
handle
,
struct
ndb_mgm_reply
*
/*reply*/
)
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
3cb410b8
...
...
@@ -2419,6 +2419,8 @@ MgmtSrvr::abortBackup(Uint32 backupId)
void
MgmtSrvr
::
backupCallback
(
BackupEvent
&
event
)
{
m_lastBackupEvent
=
event
;
theWaitState
=
NO_WAIT
;
}
...
...
ndb/src/mgmsrv/Services.cpp
View file @
3cb410b8
...
...
@@ -1391,6 +1391,7 @@ MgmApiSession::listen_event(Parser<MgmApiSession>::Context & ctx,
result
=
-
1
;
goto
done
;
}
category
-=
CFG_MIN_LOGLEVEL
;
le
.
m_logLevel
.
setLogLevel
((
LogLevel
::
EventCategory
)
category
,
level
);
}
...
...
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