At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3
------------------------------------------------------------
revno: 260
revision-id: mtaylor@stripped
parent: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: telco-6.3
timestamp: Mon 2007-12-03 01:05:38 -0800
message:
Merged in build changes.
added:
testndbapi/OutOfConnectionProblemTest.cpp
outofconnectionprobl-20071128050412-zv5xzn7yfyh3xuhp-1
modified:
Makefile.am makefile.am-20070228020914-u2pk759xg7thauwf-4
acinclude.m4 acinclude.m4-20070228020914-u2pk759xg7thauwf-8
configure.in configure.in-20070228020914-u2pk759xg7thauwf-13
interface/mgmapi/mgmglobals.i mgm.i-20070228021421-qkr4cbpxymyqdrf3-8
java/Makefile.am makefile.am-20070415032352-9dpe6aurqcnuwcrd-1
m4/ac_pkg_swig.m4 ac_pkg_swig.m4-20070414215316-ojjacm446lab2l0c-1
testndbapi/Makefile.am makefile.am-20071026235931-jssnmc2smymhxj0f-1
------------------------------------------------------------
revno: 192.1.25.1.101
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Mon 2007-12-03 01:01:40 -0800
message:
Added a couple of logevent categories.
modified:
interface/mgmapi/mgmglobals.i mgm.i-20070228021421-qkr4cbpxymyqdrf3-8
------------------------------------------------------------
revno: 192.1.25.1.100
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Mon 2007-12-03 00:58:42 -0800
message:
Updated Ndb_logevent_type enum.
modified:
interface/mgmapi/mgmglobals.i mgm.i-20070228021421-qkr4cbpxymyqdrf3-8
------------------------------------------------------------
revno: 192.1.25.1.99
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Fri 2007-11-30 19:11:00 -0800
message:
If the installed version of SWIG is recent enough, use that instead of building our
own.
modified:
Makefile.am makefile.am-20070228020914-u2pk759xg7thauwf-4
configure.in configure.in-20070228020914-u2pk759xg7thauwf-13
m4/ac_pkg_swig.m4 ac_pkg_swig.m4-20070414215316-ojjacm446lab2l0c-1
------------------------------------------------------------
revno: 192.1.25.1.98
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Wed 2007-11-28 14:00:00 -0800
message:
Added OutOfConnectionProblemTest
added:
testndbapi/OutOfConnectionProblemTest.cpp
outofconnectionprobl-20071128050412-zv5xzn7yfyh3xuhp-1
modified:
testndbapi/Makefile.am makefile.am-20071026235931-jssnmc2smymhxj0f-1
------------------------------------------------------------
revno: 192.1.25.1.97
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Wed 2007-11-28 13:58:53 -0800
message:
Added rule for installing jar files.
modified:
java/Makefile.am makefile.am-20070415032352-9dpe6aurqcnuwcrd-1
------------------------------------------------------------
revno: 192.1.25.1.96
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2007-11-27 02:49:07 -0800
message:
Changes to only bail out if we can't find Java if Java has been explicitly
requested. Otherwise, we just don't build it like the other languages.
modified:
acinclude.m4 acinclude.m4-20070228020914-u2pk759xg7thauwf-8
configure.in configure.in-20070228020914-u2pk759xg7thauwf-13
=== added file 'testndbapi/OutOfConnectionProblemTest.cpp'
--- a/testndbapi/OutOfConnectionProblemTest.cpp 1970-01-01 00:00:00 +0000
+++ b/testndbapi/OutOfConnectionProblemTest.cpp 2007-11-28 22:00:00 +0000
@@ -0,0 +1,243 @@
+
+
+
+
+#include <mysql.h>
+#include <NdbApi.hpp>
+
+// Used for cout
+#include <stdio.h>
+#include <iostream>
+#include <time.h>
+
+
+#define NUMBER_OF_TEST_ITERATIONS 1000000
+#define NUMBER_OF_ELEMENT_INSERTIONS 25
+
+#define NUM_TRANSACTIONS 500
+#define TRANSACTIONS_TIMEOUT 10
+#define FORCE_SEND 1
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // TABLE METADATA
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define PROBTABLE "OutOfConnectionProblemTable"
+
+int PROBTABLE_FIELD1;
+
+int myTransactionCount = 0;
+int myTotalTransactionCount = 0;
+
+
+#define PRINT_ERROR(code,msg) \
+ std::cout << "Error in " << __FILE__ << ", line: " << __LINE__
\
+ << ", code: " << code \
+ << ", msg: " << msg << "." << std::endl
+#define MYSQLERROR(mysql) { \
+ PRINT_ERROR(mysql_errno(&mysql),mysql_error(&mysql)); \
+ exit(-1); }
+#define APIERROR(error) { \
+ PRINT_ERROR(error.code,error.message); \
+ exit(-1); }
+
+int random_id = 0;
+
+#define NUM_ITER 1000
+#define INSERT_NUM 1000
+
+typedef struct
+async_callback_t
+{
+ Ndb *ndb;
+ int cnt;
+};
+static void callBack(int result,
+ NdbTransaction *trans,
+ void *aObject)
+{
+ async_callback_t *cbData((async_callback_t *)aObject);
+ int tid= cbData->cnt;
+ myTransactionCount--;
+ if (result < 0)
+ {
+ if(trans!=0)
+ {
+ std::cout << "error!! Error code: " << trans->getNdbError().code
+ << "Err message: " << trans->getNdbError().message
+ << std::endl;
+ trans->close();
+ return;
+ }
+ }
+ if(trans!=0)
+ {
+ trans->close();
+ }
+ free(cbData);
+}
+
+int cnt=0;
+Ndb * ndb = NULL;
+
+NdbTransaction * startCountedTransaction() {
+ myTransactionCount++;
+ myTotalTransactionCount++;
+
+ return ndb->startTransaction();
+}
+
+int pollNdb(int aMillisecondNumber, int minNoOfEventsToWakeup) {
+ int numberOfCallbacks = ndb->pollNdb(aMillisecondNumber, minNoOfEventsToWakeup);
+
+ std::cout << "Poll produced " << numberOfCallbacks << " callbacks ("
<< myTransactionCount;
+ std::cout << " txs outstanding) [Total " << myTotalTransactionCount
<< "]" <<std::endl;
+
+ return numberOfCallbacks;
+}
+
+int sendPollNdb(int aMillisecondNumber, int minNoOfEventsToWakeup, int forceSend) {
+ ndb->sendPreparedTransactions(forceSend);
+
+ return pollNdb(aMillisecondNumber, minNoOfEventsToWakeup);
+}
+
+void generateRequestTxs(int theLastBatch) {
+
+ bool success = false;
+
+ NdbOperation * orderOp;
+ async_callback_t * callback_data;
+
+
+ for (int elementCount = 1;
+ elementCount < (NUMBER_OF_ELEMENT_INSERTIONS) + 1;
+ elementCount++) {
+
+ cnt++;
+ NdbTransaction * trans = startCountedTransaction();
+
+ orderOp = trans->getNdbOperation(PROBTABLE);
+
+ orderOp->insertTuple();
+
+ orderOp->equal(PROBTABLE_FIELD1, cnt);
+ orderOp->setValue("a", cnt);
+ orderOp->setValue("b", cnt);
+ orderOp->setValue("c", cnt);
+ orderOp->setValue("d", cnt);
+ orderOp->setValue("e", cnt);
+ orderOp->setValue("f", cnt);
+ orderOp->setValue("g", cnt);
+
+ callback_data = (async_callback_t *)malloc(sizeof(async_callback_t));
+
+
+ callback_data->ndb=ndb;
+ callback_data->cnt=cnt;
+
+
+ trans->executeAsynchPrepare(NdbTransaction::Commit,&callBack,
+ (void *)callback_data,
+ NdbOperation::AbortOnError);
+
+
+
+ success = true;
+
+ }
+
+}
+
+
+int main()
+{
+ ndb_init();
+ MYSQL mysql;
+
+ /**************************************************************
+ * Connect to mysql server and create table *
+ **************************************************************/
+
+ {
+ if ( !mysql_init(&mysql) ) {
+ std::cout << "mysql_init failed\n";
+ exit(-1);
+ }
+ mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"client");
+ if ( !mysql_real_connect(&mysql, "localhost", "root", "", "",
+ 3306, NULL, 0) )
+ MYSQLERROR(mysql);
+
+ if (mysql_query(&mysql, "USE test") != 0) MYSQLERROR(mysql);
+
+ if (mysql_query(&mysql,
+ "CREATE TABLE if not exists "
+ PROBTABLE
+ " (field1 INT UNSIGNED NOT NULL, "
+ "a integer, "
+ "b integer, "
+ "c integer, "
+ "d integer, "
+ "e int, "
+ "f integer, "
+ "g integer, "
+ "PRIMARY KEY(field1)) ENGINE=ndb "
+ "PARTITION BY KEY (field1);"))
+ MYSQLERROR(mysql);
+ }
+
+ /**************************************************************
+ * Connect to ndb cluster *
+ **************************************************************/
+
+ Ndb_cluster_connection *cluster_connection=
+ new Ndb_cluster_connection(); // Object representing the cluster
+
+ if (cluster_connection->connect(5,3,1))
+ {
+ std::cout << "Connect to cluster management server failed.\n";
+ exit(-1);
+ }
+
+ if (cluster_connection->wait_until_ready(30,30))
+ {
+ std::cout << "Cluster was not ready within 30 secs.\n";
+ exit(-1);
+ }
+
+
+ ndb = new Ndb( cluster_connection,
+ "test" ); // Object representing the database
+ if (ndb->init(1000) == -1) {
+ APIERROR(ndb->getNdbError());
+ exit(-1);
+ }
+
+ const NdbDictionary::Dictionary* myDict= ndb->getDictionary();
+ const NdbDictionary::Table *myTable= myDict->getTable(PROBTABLE);
+ PROBTABLE_FIELD1 = myTable->getColumn("field1")->getColumnNo();
+
+ if (myTable == NULL)
+ APIERROR(myDict->getNdbError());
+
+
+
+ for (int iteration = 0;
+ iteration < NUMBER_OF_TEST_ITERATIONS;
+ iteration++) {
+ generateRequestTxs(iteration);
+
+ sendPollNdb(TRANSACTIONS_TIMEOUT, NUM_TRANSACTIONS, FORCE_SEND);
+ }
+
+ std::cout << "Performing cooldown" << std::endl;
+
+ pollNdb(100000, myTransactionCount);
+
+
+ std::cout << "Test completed with no exceptions" << std::endl;
+
+
+
+}
=== modified file 'Makefile.am'
--- a/Makefile.am 2007-11-26 09:56:22 +0000
+++ b/Makefile.am 2007-12-01 03:11:00 +0000
@@ -1,5 +1,8 @@
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
+if BUILD_SWIG_SUBDIR
+ d_swig = swig
+endif
if BUILD_LUA_SUBDIR
d_lua = lua
endif
@@ -21,7 +24,7 @@
if BUILD_PHP_SUBDIR
d_php = php
endif
-SUBDIRS = swig $(d_java) $(d_python) $(d_perl) $(d_csharp) $(d_ruby) $(d_php) $(d_lua)
+SUBDIRS = $(d_swig) $(d_java) $(d_python) $(d_perl) $(d_csharp) $(d_ruby) $(d_php)
$(d_lua)
EXTRA_DIST = testndbapi interface autogen.sh
distclean-local:
=== modified file 'acinclude.m4'
--- a/acinclude.m4 2007-11-26 10:18:23 +0000
+++ b/acinclude.m4 2007-11-27 10:49:07 +0000
@@ -108,6 +108,14 @@
AS_IF([test "x$ANT" = "x"],AC_MSG_ERROR([Couldn't find ant.]))
AC_CHECK_JUNIT()
AC_CHECK_JAVA_CXXFLAGS()
+
+ AS_IF([test "x$JAVAC" = "xno"],[
+ AS_IF([test "w$with_java" = "xyes"],[
+ AC_MSG_ERROR([Unknown or unsupported JDK])
+ ],[
+ with_java=no
+ ])
+ ])
])
])
@@ -115,7 +123,7 @@
AC_ARG_WITH([csharp],
[AS_HELP_STRING([--with-csharp],
- [BULD NDB/.NET @<:@default=no@:>@])],
+ [BULD NDB/.NET @<:@default=yes@:>@])],
[with_csharp=$withval],
[with_csharp=yes])
=== modified file 'configure.in'
--- a/configure.in 2007-11-27 10:00:50 +0000
+++ b/configure.in 2007-12-03 09:05:38 +0000
@@ -1,4 +1,4 @@
-AC_INIT([ndb-connectors], [0.5.6.3.6.1])
+AC_INIT([ndb-connectors], [0.5.6.3.6.2])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
@@ -36,9 +36,15 @@
fi
fi
-
-SWIG_LIB="\${top_srcdir}/swig/SWIG/Lib"
-SWIG="SWIG_LIB=${SWIG_LIB} \${top_builddir}/swig/SWIG/swig -c++"
+AC_PROG_SWIG(1.3.32)
+AS_IF([test "x$SWIG" = "xno"],[
+ SWIG_LIB="\${top_srcdir}/swig/SWIG/Lib"
+ SWIG="SWIG_LIB=${SWIG_LIB} \${top_builddir}/swig/SWIG/swig"
+ build_swig=yes
+],[
+ build_swig=no
+])
+SWIG_ENABLE_CXX()
AC_SUBST(SWIG)
AC_SUBST(SWIG_LIB)
@@ -55,7 +61,6 @@
WITH_JAVA()
-AS_IF([test "x$JAVAC" = "xno"],AC_MSG_ERROR([Unknown or unsupported JDK]))
WITH_CSHARP()
@@ -90,6 +95,7 @@
CXXFLAGS="-I\$(top_srcdir) ${CXXFLAGS}"
+AM_CONDITIONAL(BUILD_SWIG_SUBDIR, test "$build_swig" = "yes")
AM_CONDITIONAL(BUILD_PYTHON_SUBDIR, test "$with_python" != "no")
AM_CONDITIONAL(BUILD_PHP_SUBDIR, test "$with_php" != "no")
AM_CONDITIONAL(BUILD_PERL_SUBDIR, test "$with_perl" != "no")
=== modified file 'interface/mgmapi/mgmglobals.i'
--- a/interface/mgmapi/mgmglobals.i 2007-11-20 01:08:15 +0000
+++ b/interface/mgmapi/mgmglobals.i 2007-12-03 09:01:40 +0000
@@ -203,6 +203,10 @@
*/
NDB_MGM_EVENT_CATEGORY_CONGESTION = CFG_LOGLEVEL_CONGESTION,
/**
+ * Loglevel debug
+ */
+ NDB_MGM_EVENT_CATEGORY_DEBUG = CFG_LOGLEVEL_DEBUG,
+ /**
* Uncategorized log events (severity info)
*/
NDB_MGM_EVENT_CATEGORY_INFO = CFG_LOGLEVEL_INFO,
@@ -210,6 +214,8 @@
* Uncategorized log events (severity warning or higher)
*/
NDB_MGM_EVENT_CATEGORY_ERROR = CFG_LOGLEVEL_ERROR,
+ NDB_MGM_MIN_EVENT_CATEGORY = CFG_MIN_LOGLEVEL,
+ NDB_MGM_MAX_EVENT_CATEGORY = CFG_MAX_LOGLEVEL
};
@@ -318,7 +324,6 @@
NDB_LE_TransReportCounters = 35,
/** NDB_MGM_EVENT_CATEGORY_STATISTIC */
NDB_LE_OperationReportCounters = 36,
-
/** NDB_MGM_EVENT_CATEGORY_STATISTIC */
NDB_LE_TableCreated = 37,
/** NDB_MGM_EVENT_CATEGORY_STATISTIC */
@@ -331,6 +336,8 @@
NDB_LE_ReceiveBytesStatistic = 41,
/** NDB_MGM_EVENT_CATEGORY_STATISTIC */
NDB_LE_MemoryUsage = 50,
+ /** NDB_MGM_EVENT_CATEGORY_STATISTIC */
+ NDB_LE_ThreadConfigLoop = 68,
/** NDB_MGM_EVENT_CATEGORY_ERROR */
NDB_LE_TransporterError = 42,
@@ -362,10 +369,21 @@
/** NDB_MGM_EVENT_CATEGORY_BACKUP */
NDB_LE_BackupFailedToStart = 55,
/** NDB_MGM_EVENT_CATEGORY_BACKUP */
+ NDB_LE_BackupStatus = 62,
+ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
NDB_LE_BackupCompleted = 56,
/** NDB_MGM_EVENT_CATEGORY_BACKUP */
NDB_LE_BackupAborted = 57,
-
+ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
+ NDB_LE_RestoreMetaData = 63,
+ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
+ NDB_LE_RestoreData = 64,
+ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
+ NDB_LE_RestoreLog = 65,
+ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
+ NDB_LE_RestoreStarted = 66,
+ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
+ NDB_LE_RestoreCompleted = 67,
/** NDB_MGM_EVENT_CATEGORY_INFO */
NDB_LE_EventBufferStatus = 58,
@@ -375,9 +393,9 @@
/** NDB_MGM_EVENT_CATEGORY_STARTUP */
NDB_LE_StartReport = 60
- /* 60 unused */
- /* 61 unused */
- /* 62 unused */
+ /* 61 (used in upcoming patch) */
+ /* 62-68 used */
+ /* 69 unused */
};
=== modified file 'java/Makefile.am'
--- a/java/Makefile.am 2007-11-27 09:56:10 +0000
+++ b/java/Makefile.am 2007-11-28 21:58:53 +0000
@@ -333,3 +333,9 @@
check-local: all-am
$(JAVA) -Djava.library.path=$(builddir)/.libs
-Dcom.mysql.jdbc.testsuite.url=jdbc:mysql://localhost/test -classpath
$(builddir):$(builddir)/lib/mysql-connector-java-5.0.4-bin.jar:$(builddir)/lib/junit.jar
junit.textui.TestRunner testsuite.ndbj.AllTests
+
+install-exec-local: ndbj.jar mgmj.jar
+ mkdir -p $(DESTDIR)$(datadir)/java
+ cp ndbj.jar $(DESTDIR)$(datadir)/java/ndbj-$(PACKAGE_VERSION).jar
+ cp mgmj.jar $(DESTDIR)$(datadir)/java/mgmj-$(PACKAGE_VERSION).jar
+ ( cd $(DESTDIR)$(datadir)/java ; ln -s ndbj-$(PACKAGE_VERSION).jar ndbj.jar ; ln -sf
mgmj-$(PACKAGE_VERSION).jar mgmj.jar )
=== modified file 'm4/ac_pkg_swig.m4'
--- a/m4/ac_pkg_swig.m4 2007-05-04 20:58:35 +0000
+++ b/m4/ac_pkg_swig.m4 2007-12-01 03:11:00 +0000
@@ -28,8 +28,8 @@
AC_DEFUN([AC_PROG_SWIG],[
AC_PATH_PROG([SWIG],[swig])
if test -z "$SWIG" ; then
- AC_MSG_WARN([cannot find 'swig' program. You should look at
http://www.swig.org])
- SWIG='echo "Error: SWIG is not installed. You should look at
http://www.swig.org" ; false'
+ AC_MSG_WARN([cannot find 'swig' program installed, using bundled
version])
+ SWIG=no
elif test -n "$1" ; then
AC_MSG_CHECKING([for SWIG version])
[swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed
's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
@@ -70,16 +70,16 @@
if test $available_major -ne $required_major \
-o $available_minor -ne $required_minor \
-o $available_patch -lt $required_patch ; then
- AC_MSG_WARN([SWIG version >= $1 is required. You have
$swig_version. You should look at http://www.swig.org])
- SWIG=false
+ AC_MSG_WARN([SWIG version >= $1 is required. Using
bundled version])
+ SWIG=no
else
AC_MSG_NOTICE([SWIG executable is '$SWIG'])
SWIG_LIB=`$SWIG -swiglib`
AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
fi
else
- AC_MSG_WARN([cannot determine SWIG version])
- SWIG='echo "Error: Cannot determine SWIG version. You should
look at http://www.swig.org" ; false'
+ AC_MSG_WARN([cannot determine SWIG version. using bundled])
+ SWIG=no
fi
fi
AC_SUBST([SWIG_LIB])
=== modified file 'testndbapi/Makefile.am'
--- a/testndbapi/Makefile.am 2007-11-03 14:53:09 +0000
+++ b/testndbapi/Makefile.am 2007-12-03 09:05:38 +0000
@@ -3,7 +3,8 @@
teststrins \
ndbfoo \
testdateins \
- QuickJavaCPPTest
+ QuickJavaCPPTest \
+ OutOfConnectionProblemTest
ndbapi_simple_index_SOURCES = ndbapi_simple_index.cpp
testchars_SOURCES = testchars.cpp
@@ -11,3 +12,4 @@
ndbfoo_SOURCES = ndbfoo.cpp
testdateins_SOURCES = testdateins.cpp
QuickJavaCPPTest_SOURCES = QuickJavaCPPTest.cpp
+OutOfConnectionProblemTest_SOURCES = OutOfConnectionProblemTest.cpp
| Thread |
|---|
| • Rev 260: Merged in build changes. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3 | Monty Taylor | 3 Dec |