Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-04-10 10:25:12+02:00, jonas@stripped +2 -0
ndb - Add event listener test tool
storage/ndb/test/tools/Makefile.am@stripped, 2007-04-10 10:25:11+02:00,
jonas@stripped +2 -1
Add event listener test tool
storage/ndb/test/tools/log_listner.cpp@stripped, 2007-04-10 10:25:11+02:00,
jonas@stripped +88 -0
Add event listener test tool
storage/ndb/test/tools/log_listner.cpp@stripped, 2007-04-10 10:25:11+02:00,
jonas@stripped +0 -0
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jonas
# Host: perch.ndb.mysql.com
# Root: /home/jonas/src/drop5
--- New file ---
+++ storage/ndb/test/tools/log_listner.cpp 07/04/10 10:25:11
#include <mgmapi.h>
#include <ndb_global.h>
#include <ndb_opts.h>
#include <NDBT.hpp>
NDB_STD_OPTS_VARS;
static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_logevent_listen"),
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void usage()
{
char desc[] =
"tabname\n"\
"This program list all properties of table(s) in NDB Cluster.\n"\
" ex: desc T1 T2 T4\n";
ndb_std_print_version();
my_print_help(my_long_options);
my_print_variables(my_long_options);
}
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP,
15, NDB_MGM_EVENT_CATEGORY_CONNECTION,
15, NDB_MGM_EVENT_CATEGORY_NODE_RESTART,
15, NDB_MGM_EVENT_CATEGORY_STARTUP,
15, NDB_MGM_EVENT_CATEGORY_SHUTDOWN,
15, NDB_MGM_EVENT_CATEGORY_STATISTIC,
15, NDB_MGM_EVENT_CATEGORY_ERROR,
15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT,
15, NDB_MGM_EVENT_CATEGORY_CONGESTION,
0 };
int
main(int argc, char** argv)
{
NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv);
int ho_error;
#ifndef DBUG_OFF
opt_debug= "d:t:O,/tmp/ndb_desc.trace";
#endif
if ((ho_error=handle_options(&argc, &argv, my_long_options,
ndb_std_get_one_option)))
return NDBT_ProgramExit(NDBT_WRONGARGS);
NdbMgmHandle handle= ndb_mgm_create_handle();
ndb_mgm_set_connectstring(handle, opt_connect_str);
while (true)
{
if (ndb_mgm_connect(handle,0,0,0) == -1)
{
ndbout_c("Failed to connect");
exit(0);
}
NdbLogEventHandle le = ndb_mgm_create_logevent_handle(handle, filter);
if (le == 0)
{
ndbout_c("Failed to create logevent handle");
exit(0);
}
struct ndb_logevent event;
while (true)
{
int r= ndb_logevent_get_next(le, &event,5000);
if (r < 0)
{
ndbout_c("Error while getting next event");
break;
}
if (r == 0)
{
continue;
}
ndbout_c("Got event: %d", event.type);
}
ndb_mgm_destroy_logevent_handle(&le);
ndb_mgm_disconnect(handle);
}
return 0;
}
--- 1.15/storage/ndb/test/tools/Makefile.am 2007-04-10 10:25:15 +02:00
+++ 1.16/storage/ndb/test/tools/Makefile.am 2007-04-10 10:25:15 +02:00
@@ -1,5 +1,5 @@
-ndbtest_PROGRAMS = hugoLoad hugoFill hugoLockRecords hugoPkDelete hugoPkRead
hugoPkReadRecord hugoPkUpdate hugoScanRead hugoScanUpdate restart verify_index copy_tab
create_index ndb_cpcc listen_event
+ndbtest_PROGRAMS = hugoLoad hugoFill hugoLockRecords hugoPkDelete hugoPkRead
hugoPkReadRecord hugoPkUpdate hugoScanRead hugoScanUpdate restart verify_index copy_tab
create_index ndb_cpcc listen_event eventlog
# transproxy
@@ -19,6 +19,7 @@
create_index_SOURCES = create_index.cpp
ndb_cpcc_SOURCES = cpcc.cpp
listen_event_SOURCES = listen.cpp
+eventlog_SOURCES = log_listner.cpp
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapitest.mk.am
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2139) | jonas | 10 Apr |