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
da82e8ff
Commit
da82e8ff
authored
Nov 23, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated ndb listen_event to print more info, and to give immediate respose
parent
38961d02
Changes
1
Show 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 @
da82e8ff
...
@@ -64,7 +64,6 @@ main(int argc, const char** argv){
...
@@ -64,7 +64,6 @@ main(int argc, const char** argv){
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
int
result
=
0
;
int
result
=
0
;
Uint64
last_gci
=
0
,
cnt
=
0
;
NdbDictionary
::
Dictionary
*
myDict
=
MyNdb
.
getDictionary
();
NdbDictionary
::
Dictionary
*
myDict
=
MyNdb
.
getDictionary
();
Vector
<
NdbDictionary
::
Event
*>
events
;
Vector
<
NdbDictionary
::
Event
*>
events
;
...
@@ -91,7 +90,7 @@ main(int argc, const char** argv){
...
@@ -91,7 +90,7 @@ main(int argc, const char** argv){
{
{
if
(
myDict
->
getNdbError
().
classification
==
NdbError
::
SchemaObjectExists
)
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
()))
if
(
myDict
->
dropEvent
(
name
.
c_str
()))
{
{
g_err
<<
"Failed to drop event: "
<<
myDict
->
getNdbError
()
<<
endl
;
g_err
<<
"Failed to drop event: "
<<
myDict
->
getNdbError
()
<<
endl
;
...
@@ -146,19 +145,31 @@ main(int argc, const char** argv){
...
@@ -146,19 +145,31 @@ main(int argc, const char** argv){
{
{
while
(
MyNdb
.
pollEvents
(
100
)
==
0
);
while
(
MyNdb
.
pollEvents
(
100
)
==
0
);
NdbEventOperation
*
pOp
;
NdbEventOperation
*
pOp
=
MyNdb
.
nextEvent
()
;
while
(
(
pOp
=
MyNdb
.
nextEvent
())
!=
0
)
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
);
switch
(
pOp
->
getEventType
())
cnt
=
1
;
last_gci
=
pOp
->
getGCI
();
}
else
{
{
cnt
++
;
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:
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