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
4f956794
Commit
4f956794
authored
Nov 23, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated ndb listen_event to print more info, and to give immediate respose
parent
6fc48d92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
storage/ndb/test/tools/listen.cpp
storage/ndb/test/tools/listen.cpp
+24
-13
No files found.
storage/ndb/test/tools/listen.cpp
View file @
4f956794
...
...
@@ -64,7 +64,6 @@ main(int argc, const char** argv){
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
int
result
=
0
;
Uint64
last_gci
=
0
,
cnt
=
0
;
NdbDictionary
::
Dictionary
*
myDict
=
MyNdb
.
getDictionary
();
Vector
<
NdbDictionary
::
Event
*>
events
;
...
...
@@ -91,7 +90,7 @@ main(int argc, const char** argv){
{
if
(
myDict
->
getNdbError
().
classification
==
NdbError
::
SchemaObjectExists
)
{
g_info
<<
"Event creation failed event exists
\n
"
;
g_info
<<
"Event creation failed event exists
. Removing...
\n
"
;
if
(
myDict
->
dropEvent
(
name
.
c_str
()))
{
g_err
<<
"Failed to drop event: "
<<
myDict
->
getNdbError
()
<<
endl
;
...
...
@@ -146,19 +145,31 @@ main(int argc, const char** argv){
{
while
(
MyNdb
.
pollEvents
(
100
)
==
0
);
NdbEventOperation
*
pOp
;
while
(
(
pOp
=
MyNdb
.
nextEvent
())
!=
0
)
NdbEventOperation
*
pOp
=
MyNdb
.
nextEvent
()
;
while
(
pOp
)
{
if
(
pOp
->
getGCI
()
!=
last_gci
)
Uint64
gci
=
pOp
->
getGCI
();
Uint64
cnt_i
=
0
,
cnt_u
=
0
,
cnt_d
=
0
;
do
{
if
(
cnt
)
ndbout_c
(
"GCI: %lld events: %lld"
,
last_gci
,
cnt
);
cnt
=
1
;
last_gci
=
pOp
->
getGCI
();
}
else
{
cnt
++
;
}
switch
(
pOp
->
getEventType
())
{
case
NdbDictionary
:
:
Event
::
TE_INSERT
:
cnt_i
++
;
break
;
case
NdbDictionary
:
:
Event
::
TE_DELETE
:
cnt_d
++
;
break
;
case
NdbDictionary
:
:
Event
::
TE_UPDATE
:
cnt_u
++
;
break
;
default:
/* We should REALLY never get here. */
ndbout_c
(
"Error: unknown event type"
);
abort
();
}
}
while
((
pOp
=
MyNdb
.
nextEvent
())
&&
gci
==
pOp
->
getGCI
());
ndbout_c
(
"GCI: %lld events: %lld(I) %lld(U) %lld(D)"
,
gci
,
cnt_i
,
cnt_u
,
cnt_d
);
}
}
end:
...
...
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