At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3
------------------------------------------------------------
revno: 310
revision-id:mtaylor@stripped
parent: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: telco-6.3
timestamp: Wed 2008-01-23 01:58:02 -0500
message:
Merged in devel changes.
removed:
python/MANIFEST.in
svn-v2:1@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-python%2fMANIFEST.in
python/PKG-INFO
svn-v2:1@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-python%2fPKG%2dINFO
python/ez_setup.py
svn-v2:1@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-python%2fez_setup.py
python/setup.py setup.py-20071027082659-u3uu8u83f54jtbn4-1
added:
TODO todo-20080123002932-s73epptnq03oibph-1
modified:
.bzrignore bzrignore-20070227185147-qqkzlz6d3jh97cex-1
configure.in configure.in-20070228020914-u2pk759xg7thauwf-13
csharp/Makefile.am makefile.in-20070228073157-gkwqutuh9f3nq7s2-1
interface/mgmapi/NdbLogEventManager.i
ndbmgmlogeventhandle-20070906065939-pj4qrhof8kkzg3d1-1
java/.project project-20070521182648-uuhans84tln3f4b6-1
java/Makefile.am makefile.am-20070415032352-9dpe6aurqcnuwcrd-1
java/com/mysql/cluster/mgmj/examples/SampleMGMJ.java
samplemgmj.java-20071119093428-2f2zw02dpk5jlq9f-2
perl/Makefile.am makefile.am-20070228070325-lv4v4ey3018yr147-1
python/Makefile.am makefile.am-20070925115907-x2wrdte5kicyfrrw-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.101
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Wed 2008-01-23 01:57:26 -0500
message:
More changes for make distcheck.
modified:
csharp/Makefile.am makefile.in-20070228073157-gkwqutuh9f3nq7s2-1
perl/Makefile.am makefile.am-20070228070325-lv4v4ey3018yr147-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.100
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Wed 2008-01-23 00:25:37 -0500
message:
Fixed perl for make distcheck
modified:
perl/Makefile.am makefile.am-20070228070325-lv4v4ey3018yr147-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.99
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 20:27:15 -0500
message:
Removed unneeded files from EXTRA_DIST in python.
modified:
python/Makefile.am makefile.am-20070925115907-x2wrdte5kicyfrrw-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.98
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:31:54 -0500
message:
Added missing java files to dist file list.
modified:
java/Makefile.am makefile.am-20070415032352-9dpe6aurqcnuwcrd-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.97
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:31:33 -0500
message:
Removed external tool builder from Eclipse project.
modified:
java/.project project-20070521182648-uuhans84tln3f4b6-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.96
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:30:38 -0500
message:
Added TODO file.
Added ChangeLog to .bzrignore.
added:
TODO todo-20080123002932-s73epptnq03oibph-1
modified:
.bzrignore bzrignore-20070227185147-qqkzlz6d3jh97cex-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.95
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:30:13 -0500
message:
From johan: "I have also updated the SampleMGMJ to show how to code it for
"redundancy" so it can handle multiple management servers. Basically, whenever an
exception is thrown then the sampleMGMJ reconnects to the management server (next on the
connect string). "
modified:
java/com/mysql/cluster/mgmj/examples/SampleMGMJ.java
samplemgmj.java-20071119093428-2f2zw02dpk5jlq9f-2
------------------------------------------------------------
revno: 192.1.25.1.107.1.94
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:28:16 -0500
message:
Removed some old comments. Added object files to clean target.
modified:
python/Makefile.am makefile.am-20070925115907-x2wrdte5kicyfrrw-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.93
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:24:21 -0500
message:
Removed distutils. Added automake for Python. Still need to do debug lib split and
install.
removed:
python/MANIFEST.in
svn-v2:1@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-python%2fMANIFEST.in
python/PKG-INFO
svn-v2:1@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-python%2fPKG%2dINFO
python/ez_setup.py
svn-v2:1@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-python%2fez_setup.py
python/setup.py setup.py-20071027082659-u3uu8u83f54jtbn4-1
modified:
python/Makefile.am makefile.am-20070925115907-x2wrdte5kicyfrrw-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.92
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:22:42 -0500
message:
Stupid distutils. Added more methods and I still can't get make distcheck to work.
86ing distutils, but I thought I'd check this in in case we wanted to go backand look at
it later.
modified:
python/Makefile.am makefile.am-20070925115907-x2wrdte5kicyfrrw-1
python/setup.py setup.py-20071027082659-u3uu8u83f54jtbn4-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.91
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:22:05 -0500
message:
Added ac_top_srcdir to a couple of statements to help in out-of-tree builds.
modified:
configure.in configure.in-20070228020914-u2pk759xg7thauwf-13
------------------------------------------------------------
revno: 192.1.25.1.107.1.90
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:20:13 -0500
message:
Removed GNU Make extension
Added depend on ${SWIG_BIN}, along with a rule to build it.
modified:
csharp/Makefile.am makefile.in-20070228073157-gkwqutuh9f3nq7s2-1
------------------------------------------------------------
revno: 192.1.25.1.107.1.89
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2008-01-22 19:19:37 -0500
message:
Throw NdbMgmException instead of NdbApiException.
-------------- This line and the followin will be ignored --------------
modified:
interface/mgmapi/NdbLogEventManager.i
modified:
interface/mgmapi/NdbLogEventManager.i
ndbmgmlogeventhandle-20070906065939-pj4qrhof8kkzg3d1-1
=== modified file '.bzrignore'
--- a/.bzrignore 2007-10-27 00:01:05 +0000
+++ b/.bzrignore 2008-01-23 00:30:38 +0000
@@ -132,3 +132,4 @@
php/.deps
testndbapi/.deps
stamp-h1
+ChangeLog
=== added file 'TODO'
--- a/TODO 1970-01-01 00:00:00 +0000
+++ b/TODO 2008-01-23 00:30:38 +0000
@@ -0,0 +1,45 @@
+version 1:
+
+ port hugo tests from ndbapi to ndb/j
+
+ fully document ndb/j (move ndbapi docs to DynamicDocs)
+
+ Finish implementing java.sql.ResultSet vJDBC3
+
+ change NdbResultSet.get* impl to get the right kind of object from
+ the cluster
+
+ finish build system make distcheck
+
+version 2 (all languages mgmapi released)
+
+ finish implementing ResultSet JDBC4
+
+ implement java.sql.Transaction (XA support in NDB kernel)
+
+ implement jcache
+
+ implement NdbRecord
+
+ push mgmpp and other C++ code into NDB API
+
+All languages v1:
+
+ port and pass hugo tests
+
+ language differences documented
+
+C# v1:
+
+ implement mgmapi events as events/delegates
+
+
+Assumptions:
+
+ it is good to support more than one language
+
+ when swig produces code that isn't what we want, we should fix swig and
+ send in patches
+
+ ndb/connectors already exists as a community product, we don't want to
+ change workflow in anyway that will cause it to be less so
=== modified file 'configure.in'
--- a/configure.in 2008-01-11 23:19:21 +0000
+++ b/configure.in 2008-01-23 06:58:02 +0000
@@ -84,10 +84,10 @@
SWIG_NDB_SOURCES="\${top_srcdir}/interface/globals.i "
SWIG_MGM_SOURCES="\${top_srcdir}/interface/globals.i "
-for f in `find interface/ndbapi | grep -v '\#' | grep -v '~'` ; do
+for f in `find ${ac_top_srcdir}/interface/ndbapi | grep -v '\#' | grep -v '~'` ; do
SWIG_NDB_SOURCES="\${top_srcdir}/$f ${SWIG_NDB_SOURCES} "
done
-for f in `find interface/mgmapi | grep -v '\#' | grep -v '~'` ; do
+for f in `find ${ac_top_srcdir}/interface/mgmapi | grep -v '\#' | grep -v '~'` ; do
SWIG_MGM_SOURCES="\${top_srcdir}/$f ${SWIG_MGM_SOURCES} "
done
=== modified file 'csharp/Makefile.am'
--- a/csharp/Makefile.am 2008-01-03 00:04:44 +0000
+++ b/csharp/Makefile.am 2008-01-23 06:57:26 +0000
@@ -1,6 +1,7 @@
-NDBAPI_SOURCE = $(shell ls ndbapi/*cs)
+NDBAPI_SOURCE = $(srcdir)/ndbapi/*.cs
+MGMAPI_SOURCE = $(srcdir)/mgmapi/*.cs
NDBAPI_BUILT_SRC=AbortOption.cs NdbScanOperation.cs ExecType.cs
NdbTransaction.cs Ndb_cluster_connection.cs SWIGTYPE*cs ndb.cs
Ndb.cs NdbOperation.cs ndbPINVOKE.cs
NdbRecAttr.cs NdbError.cs NdbFactory.cs
-MYSQL_DLL = MySql.Data.dll
+MYSQL_DLL = $(srcdir)/MySql.Data.dll
CLEANFILES = ndbapi.dll *exe test/*exe ndbapi.cpp MySql.Cluster.NdbApi.dll
ndbapi/generated/* mgmapi/generated/* mgmapi.cpp MySql.Cluster.MgmApi.dll
lib_LTLIBRARIES = libndbcli.la libmgmcli.la
@@ -13,22 +14,23 @@
libmgmcli_la_CPPFLAGS = $(PTHREAD_CFLAGS)
libmgmcli_la_DEPENDENCIES = MySql.Cluster.MgmApi.dll
-EXTRA_DIST = ndbapi.i mgmapi.i ndbapi/NdbExceptions.cs mgmapi/MgmExceptions.cs test/*cs
connectors.snk *.dll.config
+EXTRA_DIST = ndbapi.i mgmapi.i $(NDBAPI_SOURCE) mgmapi/*.cs test/*cs connectors.snk
*.dll.config
clean-local:
- @rm -rf ndbapi/generated mgmapi/generated
+ @rm -rf $(builddir)/ndbapi/generated $(builddir)/mgmapi/generated
test: test/test.exe test/test2.exe
SUFFIXES = .exe .cs .i .cpp
.cs.exe: MySql.Cluster.NdbApi.dll ndbapi.cpp
- $(MCS) -r:MySql.Cluster.NdbApi.dll -r:$(MYSQL_DLL) $<
+ $(MCS) -r:$(builddir)/MySql.Cluster.NdbApi.dll -r:$(MYSQL_DLL) $<
-MySql.Cluster.MgmApi.dll:
- $(MCS) -target:library -out:$@ mgmapi/*.cs mgmapi/generated/*.cs
+MySql.Cluster.MgmApi.dll: $(MGMAPI_SOURCE)
+ @cp -f $(srcdir)/connectors.snk $(builddir)/connectors.snk
+ $(MCS) -target:library -out:$(builddir)/$@ $(srcdir)/mgmapi/*.cs
$(builddir)/mgmapi/generated/*.cs
MySql.Cluster.NdbApi.dll: $(NDBAPI_SOURCE)
- $(MCS) -target:library -out:$@ ndbapi/*.cs ndbapi/generated/*.cs
+ $(MCS) -target:library -out:$(builddir)/$@ $(srcdir)/ndbapi/*.cs
$(builddir)/ndbapi/generated/*.cs
#$(CSHARP_SOURCES)
#.PRECIOUS: %.cpp %.so %.dll
@@ -38,14 +40,22 @@
mgmapi.cpp: ${SWIG_MGM_SOURCES}
-mgmapi.cpp: mgmapi.i ${SWIG_SOURCES}
- @mkdir -p $*/generated
+${SWIG_BIN}:
+ ( cd $(top_builddir)/swig && $(MAKE) $(AM_MAKEFLAGS) )
+
+mgmapi.cpp: mgmapi.i ${SWIG_SOURCES} ${SWIG_BIN}
+ @mkdir -p $(builddir)/$*/generated
${SWIG} -csharp -dllimport libmgmcli -namespace MySql.Cluster.MgmApi \
- -I$(top_srcdir) -I$(SWIG_DIR) $(MYSQL_INCLUDES) -outdir $*/generated -o $@ $<
-ndbapi.cpp: ndbapi.i ${SWIG_SOURCES}
- @mkdir -p $*/generated
+ -I$(top_builddir) -I$(top_srcdir) -I$(SWIG_DIR) \
+ $(MYSQL_INCLUDES) -outdir $(builddir)/$*/generated \
+ -o ${builddir}/$@ $<
+
+ndbapi.cpp: ndbapi.i ${SWIG_SOURCES} ${SWIG_BIN}
+ @mkdir -p $(builddir)/$*/generated
${SWIG} -csharp -dllimport libndbcli -namespace MySql.Cluster.NdbApi \
- -I$(top_srcdir) -I$(SWIG_DIR) $(MYSQL_INCLUDES) -outdir $*/generated -o $@ $<
+ -I$(top_builddir) -I$(top_srcdir) -I$(SWIG_DIR) \
+ $(MYSQL_INCLUDES) -outdir $(builddir)/$*/generated \
+ -o ${builddir}/$@ $<
install-exec-local: MySql.Cluster.NdbApi.dll MySql.Cluster.MgmApi.dll
mkdir -p $(DESTDIR)$(datadir)/cli
=== modified file 'interface/mgmapi/NdbLogEventManager.i'
--- a/interface/mgmapi/NdbLogEventManager.i 2007-12-06 08:07:23 +0000
+++ b/interface/mgmapi/NdbLogEventManager.i 2008-01-23 00:19:37 +0000
@@ -60,7 +60,7 @@
%ndbexception("NdbMgmException") {
$action
if (result < 0) {
- NDB_exception(NdbApiException,"Must deregister handler before adding a new one");
+ NDB_exception(NdbMgmException,"Must deregister handler before adding a new one");
}
}
int registerListener(NdbLogEventTypeListener * listener);
@@ -70,7 +70,7 @@
%ndbexception("NdbMgmException") {
$action
if (result->ret < 0) {
- NDB_exception(NdbApiException,arg1->getMgmError());
+ NDB_exception(NdbMgmException,arg1->getMgmError());
}
}
BaseEventWrapper * getLogEvent(unsigned timeout_in_milliseconds);
@@ -78,7 +78,7 @@
%ndbexception("NdbMgmException") {
$action
if (result < 0) {
- NDB_exception(NdbApiException,arg1->getMgmError());
+ NDB_exception(NdbMgmException,arg1->getMgmError());
}
}
int pollEvents(unsigned timeout_in_milliseconds);
=== modified file 'java/.project'
--- a/java/.project 2007-12-18 22:19:47 +0000
+++ b/java/.project 2008-01-23 06:58:02 +0000
@@ -6,16 +6,6 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/SWIG.launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
=== modified file 'java/Makefile.am'
--- a/java/Makefile.am 2007-12-27 18:25:25 +0000
+++ b/java/Makefile.am 2008-01-23 06:58:02 +0000
@@ -159,6 +159,8 @@
${package_srcdir}/ndbj/NdbIndexScanOperation.java \
${package_srcdir}/ndbj/NdbInterpretedOperation.java \
${package_srcdir}/ndbj/NdbOperation.java \
+ ${package_srcdir}/ndbj/NdbOperationFactory.java \
+ ${package_srcdir}/ndbj/NdbOperationFactoryImpl.java \
${package_srcdir}/ndbj/NdbBaseOperationResults.java \
${package_srcdir}/ndbj/NdbBaseOperationResultsImpl.java \
${package_srcdir}/ndbj/NdbRecAttr.java \
@@ -247,6 +249,8 @@
${package_builddir}/ndbj/NdbIndexScanOperation.class \
${package_builddir}/ndbj/NdbInterpretedOperation.class \
${package_builddir}/ndbj/NdbOperation.class \
+ ${package_builddir}/ndbj/NdbOperationFactory.class \
+ ${package_builddir}/ndbj/NdbOperationFactoryImpl.class \
${package_builddir}/ndbj/NdbBaseOperationResults.class \
${package_builddir}/ndbj/NdbBaseOperationResultsImpl.class \
${package_builddir}/ndbj/NdbRecAttr.class \
=== modified file 'java/com/mysql/cluster/mgmj/examples/SampleMGMJ.java'
--- a/java/com/mysql/cluster/mgmj/examples/SampleMGMJ.java 2007-12-10 07:39:46 +0000
+++ b/java/com/mysql/cluster/mgmj/examples/SampleMGMJ.java 2008-01-23 00:30:13 +0000
@@ -5,51 +5,86 @@
import com.mysql.cluster.mgmj.listeners.*;
public class SampleMGMJ {
+
+ /**
+ * SampleMGMJ demonstrates how to monitor events taking place
+ * inside MySQL Cluster.
+ * <br>
+ * SampleMGMJ connects to one or more (for redundancy) management servers
+ * as specified by the connectString as an argument, and then starts to
+ * subscribe to a number of events.
+ * <br>
+ * E.g, sampleMGMJ "host1:1186;host2:1186"
+ * would connect sampleMGMJ to host1:1186. If host1 fails,
+ * then sampleMGMJ will reconnect to the management server on host2:1186
+ * and continue subscribing to events.
+ */
- /**
- * @param args
+ public static void main(String[] args) throws NdbMgmException {
+
+ if(args.length < 1)
+ {
+ System.out.println("Usage: SampleMGMJ \"connectstring\"");
+ return;
+ }
+ String connectString=args[0];
+
+ /*
+ * start monitoring forever..
*/
-
-
- public static void main(String[] args) throws NdbMgmException {
-
- NdbMgm mgm = NdbMgmFactory.createNdbMgm("localhost");
-
- mgm.setConnectTimeout(4000);
- mgm.connect(5, 3, true);
-
- NdbFilterList theList = new NdbFilterList();
- NdbFilterItem theItem1 = new
NdbFilterItem(15,NdbLogEventCategory.NDB_MGM_EVENT_CATEGORY_STATISTIC);
- NdbFilterItem theItem2 = new
NdbFilterItem(15,NdbLogEventCategory.NDB_MGM_EVENT_CATEGORY_CONNECTION);
- NdbFilterItem theItem3 = new
NdbFilterItem(15,NdbLogEventCategory.NDB_MGM_EVENT_CATEGORY_NODE_RESTART);
-
- theList.add(theItem1);
- theList.add(theItem2);
- theList.add(theItem3);
-
-
- NdbLogEventManager manager = mgm.createNdbLogEventManager(theList);
- TransReportListener theListener1 = new TransReportListener();
- ConnectedListener theListener2 = new ConnectedListener();
- DisconnectListener theListener3 = new DisconnectListener();
- NodeFailReportedListener theListener4 = new NodeFailReportedListener();
- CommunicationOpenedListener theListener5 = new CommunicationOpenedListener();
- CommunicationClosedListener theListener6 = new CommunicationClosedListener();
- StartPhaseListener theListener7 = new StartPhaseListener();
-
- System.out.println("Registering listener");
- manager.registerListener(theListener1);
- manager.registerListener(theListener2);
- manager.registerListener(theListener3);
- manager.registerListener(theListener4);
- manager.registerListener(theListener5);
- manager.registerListener(theListener6);
- manager.registerListener(theListener7);
- System.out.println("Done");
-
- ClusterState cs = mgm.getStatus();
- for(int i=0; i< cs.getNoOfNodes(); i++)
- {
+ while(true) {
+ try {
+
+ /*
+ * A short sleep before trying to reconnect if there
+ * has been a failure (exception)
+ */
+ try {
+ Thread.sleep(50);
+
+ } catch(InterruptedException ie){
+
+ break;
+ }
+ NdbMgm mgm = NdbMgmFactory.createNdbMgm(connectString);
+
+ mgm.setConnectTimeout(4000);
+ mgm.connect(5, 3, true);
+
+ NdbFilterList theList = new NdbFilterList();
+ NdbFilterItem theItem1 = new
NdbFilterItem(15,NdbLogEventCategory.NDB_MGM_EVENT_CATEGORY_STATISTIC);
+ NdbFilterItem theItem2 = new
NdbFilterItem(15,NdbLogEventCategory.NDB_MGM_EVENT_CATEGORY_CONNECTION);
+ NdbFilterItem theItem3 = new
NdbFilterItem(15,NdbLogEventCategory.NDB_MGM_EVENT_CATEGORY_NODE_RESTART);
+
+ theList.add(theItem1);
+ theList.add(theItem2);
+ theList.add(theItem3);
+
+
+ NdbLogEventManager manager = mgm.createNdbLogEventManager(theList);
+ TransReportListener theListener1 = new TransReportListener();
+ ConnectedListener theListener2 = new ConnectedListener();
+ DisconnectListener theListener3 = new DisconnectListener();
+ NodeFailReportedListener theListener4 = new NodeFailReportedListener();
+ CommunicationOpenedListener theListener5 = new CommunicationOpenedListener();
+ CommunicationClosedListener theListener6 = new CommunicationClosedListener();
+ StartPhaseListener theListener7 = new StartPhaseListener();
+
+ NRCopyFragDoneListener theListener8 = new NRCopyFragDoneListener();
+
+ System.out.println("Registering listener");
+ manager.registerListener(theListener1);
+ manager.registerListener(theListener2);
+ manager.registerListener(theListener3);
+ manager.registerListener(theListener4);
+ manager.registerListener(theListener5);
+ manager.registerListener(theListener6);
+ manager.registerListener(theListener7);
+ manager.registerListener(theListener8);
+ System.out.println("Done");
+
+ ClusterState cs = mgm.getStatus();
+ for(int i=0; i< cs.getNoOfNodes(); i++) {
NodeState ns = cs.getNodeState(i);
NodeType type= ns.getNodeType();
System.out.println("Type: " + type.toString() +
@@ -59,24 +94,36 @@
+ (short)(ns.getVersion()>>8 & 0xFF)
+ "."
+ (short)(ns.getVersion()>>0 & 0xFF)
- + " connected address " + ns.getConnectAddress());
-
- }
-
- while(true) {
-
- manager.pollEvents(5000);
- }
-
+ + " connected address "
+ + ns.getConnectAddress());
+
+ }
+ /**
+ * get events until the connection
+ * to the management server fails.
+ * If it does, then we have to
+ * exit (break) the loop and reconnect.
+ */
+ while(true) {
+ try {
+ manager.pollEvents(5000);
+
+ } catch(NdbMgmException e){
+ // break and then reconnect
+ break;
+ }
+ }
+
+ } catch(NdbMgmException e){
+ System.out.println("Something happened");
+
+ }
}
-
+ }
}
class TransReportListener extends TransReportCountersTypeListener {
-
-
-
/* (non-Javadoc)
* @see
com.mysql.cluster.mgmj.NdbLogEventCategoryListener#handleEvent(com.mysql.cluster.mgmj.NdbLogEvent)
*/
@@ -100,10 +147,6 @@
class DisconnectListener extends DisconnectedTypeListener {
-
-
-
-
/* (non-Javadoc)
* @see
com.mysql.cluster.mgmj.NdbLogEventCategoryListener#handleEvent(com.mysql.cluster.mgmj.NdbLogEvent)
*/
@@ -128,9 +171,6 @@
class CommunicationOpenedListener extends CommunicationOpenedTypeListener {
-
-
-
/* (non-Javadoc)
* @see
com.mysql.cluster.mgmj.NdbLogEventCategoryListener#handleEvent(com.mysql.cluster.mgmj.NdbLogEvent)
*/
@@ -144,45 +184,46 @@
class CommunicationClosedListener extends CommunicationClosedTypeListener {
-
-
/* (non-Javadoc)
* @see
com.mysql.cluster.mgmj.NdbLogEventCategoryListener#handleEvent(com.mysql.cluster.mgmj.NdbLogEvent)
*/
- @Override
+ @Override
public void handleEvent(CommunicationClosed event) {
- System.out.println("Comm closed to node:" + event.getNode());
- }
+ System.out.println("Comm closed to node:" + event.getNode());
+ }
}
class NodeFailReportedListener extends NodeFailReportedTypeListener {
-
-
-
-
-
- /* (non-Javadoc)
- * @see
com.mysql.cluster.mgmj.NdbLogEventCategoryListener#handleEvent(com.mysql.cluster.mgmj.NdbLogEvent)
- */
- @Override
+ /* (non-Javadoc)
+ * @see
com.mysql.cluster.mgmj.NdbLogEventCategoryListener#handleEvent(com.mysql.cluster.mgmj.NdbLogEvent)
+ */
+ @Override
public void handleEvent(NodeFailReported event) {
- System.out.println("Failed node:" + event.getFailedNode());
- }
-}
-
+ System.out.println("Failed node:" + event.getFailedNode());
+ }
+}
+
+
+class NRCopyFragDoneListener extends NRCopyFragDoneTypeListener
+{
+ @Override
+ public void handleEvent(NRCopyFragDone event) {
+ System.out.println("Node " + event.getSourceNodeId() +
+ ": done copying table " + event.getTableId() +
+ " of fragment: " + event.getFragmentId() +
+ " to node: " + event.getDestNode());
+ }
+}
class StartPhaseListener extends StartPhaseCompletedTypeListener {
-
-
-
/* (non-Javadoc)
* @see
com.mysql.cluster.mgmj.NdbLogEventCategoryListener#handleEvent(com.mysql.cluster.mgmj.NdbLogEvent)
*/
- @Override
+ @Override
public void handleEvent(StartPhaseCompleted event) {
- System.out.println("Node " + event.getSourceNodeId() );
- // + ": start phase" + theEvent.getPhase());
- }
+ System.out.println("Node " + event.getSourceNodeId() +
+ ": start phase" + event.getPhase());
+ }
}
=== modified file 'perl/Makefile.am'
--- a/perl/Makefile.am 2008-01-11 19:34:54 +0000
+++ b/perl/Makefile.am 2008-01-23 06:57:26 +0000
@@ -13,22 +13,25 @@
CLEANFILES=$(PERL_CRUFT) ${SWIG_OUTPUTS}
MAINTAINERCLEANFILES=
-SWIG_OPTS=-perl5 $(DEFS) -outdir lib -I${top_srcdir} -I$(SWIG_DIR) -I$(srcdir)/swig
$(MYSQL_INCLUDES)
+SWIG_OPTS=-perl5 $(DEFS) -outdir ${builddir}/lib -I${top_builddir} -I${top_srcdir}
-I$(SWIG_DIR) -I$(srcdir)/swig $(MYSQL_INCLUDES)
#ndbapi/ndbapi_wrap.cpp lib/mysql/cluster/ndbapi.pm: ndbapi.i $(SWIG_NDB_SOURCES)
-ndbapi/ndbapi_wrap.cpp lib/ndbapi.pm: ndbapi.i $(SWIG_NDB_SOURCES)
- mkdir -p lib #/mysql/cluster
- $(SWIG) $(SWIG_OPTS) -o ndbapi/ndbapi_wrap.cpp ndbapi.i
-
-mgmapi/mgmapi_wrap.cpp lib/mgmapi.pm: mgmapi.i $(SWIG_MGM_SOURCES)
- mkdir -p lib #/mysql/cluster
- $(SWIG) $(SWIG_OPTS) -o mgmapi/mgmapi_wrap.cpp mgmapi.i
-
-$(PERL_MAKEFILE): $(srcdir)/Makefile.PL ndbapi/ndbapi_wrap.cpp mgmapi/mgmapi_wrap.cpp
lib/ndbapi.pm lib/mgmapi.pm $(srcdir)/Makefile.am
+${builddir}/ndbapi/ndbapi_wrap.cpp ${builddir}/lib/ndbapi.pm: ${srcdir}/ndbapi.i
$(SWIG_NDB_SOURCES)
+ @mkdir -p ${builddir}/lib
+ @mkdir -p ${builddir}/ndbapi
+ $(SWIG) $(SWIG_OPTS) -o ${builddir}/ndbapi/ndbapi_wrap.cpp ${srcdir}/ndbapi.i
+
+${builddir}/mgmapi/mgmapi_wrap.cpp ${builddir}/lib/mgmapi.pm: ${srcdir}/mgmapi.i
$(SWIG_MGM_SOURCES)
+ @mkdir -p ${builddir}/lib
+ @mkdir -p ${builddir}/mgmapi
+ $(SWIG) $(SWIG_OPTS) -o ${builddir}/mgmapi/mgmapi_wrap.cpp ${srcdir}/mgmapi.i
+
+$(PERL_MAKEFILE): $(srcdir)/Makefile.PL ${builddir}/ndbapi/ndbapi_wrap.cpp
${builddir}/mgmapi/mgmapi_wrap.cpp ${builddir}/lib/ndbapi.pm ${builddir}/lib/mgmapi.pm
$(srcdir)/Makefile.am
echo "$(DEB_MAKE_PL_OPT) should be INSTALLDIRS=vendor"
- CFLAGS="-I../.. -I../../mgmpp $(CPPFLAGS) $(CFLAGS) $(MYSQL_INCLUDES)"
LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS) $(LIBS)" $(PERL) $(srcdir)/Makefile.PL $(MAKE_PL_OPTS)
$(DEB_MAKE_PL_OPT) PREFIX="${prefix}"
+ test ! ${srcdir}/Makefile.PL -ef ${builddir}/Makefile.PL && cp
${srcdir}/Makefile.PL ${builddir}/Makefile.PL
+ CFLAGS="-I${top_builddir} -I${top_srcdir} $(CPPFLAGS) $(CFLAGS) $(MYSQL_INCLUDES)"
LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS) $(LIBS)" $(PERL) $(srcdir)/Makefile.PL $(MAKE_PL_OPTS)
$(DEB_MAKE_PL_OPT) PREFIX="${prefix}"
--perl install-perl: $(PERL_MAKEFILE) ndbapi/ndbapi_wrap.cpp mgmapi/mgmapi_wrap.cpp
+-perl install-perl: $(PERL_MAKEFILE) ${builddir}/ndbapi/ndbapi_wrap.cpp
${builddir}/mgmapi/mgmapi_wrap.cpp
@target=`echo $@ | sed -e 's/-perl//'`; \
echo $(MAKE) -f $(PERL_MAKEFILE) $$target; \
DESTDIR=$(DESTDIR) $(MAKE) $(AM_MAKEFLAGS) -f $(PERL_MAKEFILE) $$target
PREFIX="${prefix}"
@@ -37,6 +40,7 @@
$(RUN)$(MAKE) -f $(PERL_MAKEFILE) test
clean-perl realclean-perl:
+ test ! ${srcdir}/Makefile.PL -ef ${builddir}/Makefile.PL && rm -f
${builddir}/Makefile.PL
@target=`echo $@ | sed -e 's/-perl//'`; \
if test -r $(PERL_MAKEFILE); then \
echo $(MAKE) -f $(PERL_MAKEFILE) $$target; \
=== removed file 'python/MANIFEST.in'
--- a/python/MANIFEST.in 2007-11-04 21:32:20 +0000
+++ b/python/MANIFEST.in 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-include *.py
-include *.cpp
=== modified file 'python/Makefile.am'
--- a/python/Makefile.am 2007-12-10 07:39:46 +0000
+++ b/python/Makefile.am 2008-01-23 01:27:15 +0000
@@ -3,12 +3,11 @@
pythonarchdir=$(PYTHON_DIR)
pythonarch_DATA=${builddir}/mysql/cluster/_ndbapi.so ${builddir}/mysql/cluster/_mgmapi.so
-CLEANFILES=ndbapi.cpp ndbapi.h mgmapi.cpp mysql/cluster/ndbapi.py mysql/cluster/mgmapi.py
mysql/cluster/events.py mysql/cluster/listeners.py *.so mysql/cluster/*pyc *pyc mgmapi.h
events.cpp listeners.cpp events.h listeners.h mysql/cluster/*.so ez_setup.pyc
${builddir}/mysql/__init__.pyc
-EXTRA_DIST = *py mgmapi.i ndbapi.i events.i listeners.i PKG-INFO README MANIFEST.in
mysql/cluster/alchemy.py mysql/__init__.py mysql/cluster/__init__.py
mysql/cluster/NdbObject mysql/cluster/tests
+CLEANFILES=ndbapi.cpp ndbapi.h mgmapi.cpp mysql/cluster/ndbapi.py mysql/cluster/mgmapi.py
mysql/cluster/events.py mysql/cluster/listeners.py *.so mysql/cluster/*pyc *pyc mgmapi.h
events.cpp listeners.cpp events.h listeners.h mysql/cluster/*.so ez_setup.pyc
${builddir}/mysql/__init__.pyc ndbapi.o mgmapi.o
+EXTRA_DIST = *py mgmapi.i ndbapi.i events.i listeners.i README mysql/cluster/alchemy.py
mysql/__init__.py mysql/cluster/__init__.py mysql/cluster/NdbObject mysql/cluster/tests
SWIG_OPTS=-O -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/mgmpp
-I$(SWIG_DIR) @MYSQL_INCLUDES@ -outdir $(builddir)/mysql/cluster
-
${SWIG_BIN}:
( cd $(top_builddir)/swig && $(MAKE) $(AM_MAKEFLAGS) )
@@ -27,21 +26,36 @@
@chmod -R u+w $(builddir)/mysql
$(SWIG) -c++ -python $(SWIG_OPTS) -o $@ $<
-$(builddir)/mysql/cluster/_ndbapi.so $(builddir)/mysql/cluster/_mgmapi.so
$(builddir)/mysql/cluster/_events.so $(builddir)/mysql/cluster/_listeners.so:
$(builddir)/ndbapi.cpp $(builddir)/mgmapi.cpp $(builddir)/events.cpp
$(builddir)/listeners.cpp
- CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
SRCDIR="${srcdir}" TOP_SRCDIR="${top_srcdir}" BUILDDIR="${builddir}"
TOP_BUILDDIR="${top_builddir}" ${PYTHON} $(srcdir)/setup.py build
--build-base="${top_builddir}/python/build"
+${builddir}/mysql/cluster/_ndbapi.so: $(builddir)/ndbapi.o
+ ${CXX} ${LDFLAGS} -shared -fPIC ${PYTHON_EXTRA_LDFLAGS} ${PYTHON_LDFLAGS}
${PYTHON_EXTRA_LIBS} ${builddir}/ndbapi.o -o ${builddir}/mysql/cluster/_ndbapi.so
+
+${builddir}/ndbapi.o: $(builddir)/ndbapi.cpp
+ ${CXX} -DNDEBUG -g ${CFLAGS} -fPIC ${CPPFLAGS} ${PYTHON_CPPFLAGS} -c
${builddir}/ndbapi.cpp -o ${builddir}/ndbapi.o
+
+${builddir}/mysql/cluster/_mgmapi.so: $(builddir)/mgmapi.o
+ ${CXX} ${LDFLAGS} -shared -fPIC ${PYTHON_EXTRA_LDFLAGS} ${PYTHON_LDFLAGS}
${PYTHON_EXTRA_LIBS} ${builddir}/mgmapi.o -L../mgmpp/.libs -lmgmpp -o
${builddir}/mysql/cluster/_mgmapi.so
+
+${builddir}/mgmapi.o: $(builddir)/mgmapi.cpp
+ ${CXX} -DNDEBUG -g ${CFLAGS} -fPIC ${CPPFLAGS} ${PYTHON_CPPFLAGS} -c
${builddir}/mgmapi.cpp -o ${builddir}/mgmapi.o
+
+${builddir}/mysql/cluster/_listeners.so: $(builddir)/listeners.o
+ ${CXX} ${LDFLAGS} -shared -fPIC ${PYTHON_EXTRA_LDFLAGS} ${PYTHON_LDFLAGS}
${PYTHON_EXTRA_LIBS} ${builddir}/listeners.o -L../mgmpp/.libs -lmgmpp -o
${builddir}/mysql/cluster/_listeners.so
+
+${builddir}/listeners.o: $(builddir)/listeners.cpp
+ ${CXX} -DNDEBUG -g ${CFLAGS} -fPIC ${CPPFLAGS} ${PYTHON_CPPFLAGS} -c
${builddir}/listeners.cpp -o ${builddir}/listeners.o
+
+${builddir}/mysql/cluster/_events.so: $(builddir)/events.o
+ ${CXX} ${LDFLAGS} -shared -fPIC ${PYTHON_EXTRA_LDFLAGS} ${PYTHON_LDFLAGS}
${PYTHON_EXTRA_LIBS} ${builddir}/events.o -L../mgmpp/.libs -lmgmpp -o
${builddir}/mysql/cluster/_events.so
+
+${builddir}/events.o: $(builddir)/events.cpp
+ ${CXX} -DNDEBUG -g ${CFLAGS} -fPIC ${CPPFLAGS} ${PYTHON_CPPFLAGS} -c
${builddir}/events.cpp -o ${builddir}/events.o
clean-local:
- ${PYTHON} ${srcdir}/setup.py clean
rm -rf ${builddir}/build
@test ${builddir}/mysql -ef ${srcdir}/mysql || rm -rf ${builddir}/mysql
- @rm ez_setup.pyc
-install: $(builddir)/mysql/cluster/_ndbapi.so $(builddir)/mysql/cluster/_mgmapi.so
+install-exec-local:
@mkdir -p ${pythondir}
- PYTHONPATH="${PYTHONPATH}:${pythondir}" CC="${CXX}" CFLAGS="${CFLAGS}"
CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON} ${srcdir}/setup.py install
--prefix=${DESTDIR}${prefix} --single-version-externally-managed --root=/
-
-develop: $(builddir)/mysql/cluster/_ndbapi.so $(builddir)/mysql/cluster/_mgmapi.so
- CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON}
setup.py develop --prefix=${DESTDIR}${prefix}
dist-hook:
=== removed file 'python/PKG-INFO'
--- a/python/PKG-INFO 2006-11-22 20:17:43 +0000
+++ b/python/PKG-INFO 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
-Metadata-Version: 1.0
-Name: python-ndbapi
-Version: 0.1
-Summary: python wrapper of the NDBAPI
-Home-page: UNKNOWN
-Author: Monty Taylor
-Author-email: mtaylor@stripped
-License: GPL
-Description: python wrapper of the NDBAPI
-Platform: linux
-Classifier: Development Status :: 2 - Pre-Alpha
-Classifier: License :: OSI Approved :: GPL
-Classifier: Operating System :: POSIX :: Linux
-Classifier: Programming Language :: C++
-Classifier: Programming Language :: Python
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
=== removed file 'python/ez_setup.py'
--- a/python/ez_setup.py 2007-10-27 09:26:42 +0000
+++ b/python/ez_setup.py 1970-01-01 00:00:00 +0000
@@ -1,234 +0,0 @@
-#!python
-"""Bootstrap setuptools installation
-
-If you want to use setuptools in your package's setup.py, just include this
-file in the same directory with it, and add this to the top of your setup.py::
-
- from ez_setup import use_setuptools
- use_setuptools()
-
-If you want to require a specific version of setuptools, set a download
-mirror, or use an alternate download directory, you can do so by supplying
-the appropriate options to ``use_setuptools()``.
-
-This file can also be run as a script to install or upgrade setuptools.
-"""
-import sys
-DEFAULT_VERSION = "0.6c1"
-DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
-
-md5_data = {
- 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
- 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
- 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
- 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
- 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
- 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
- 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
- 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
- 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
- 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
- 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
- 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
- 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
- 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
- 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
- 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
- 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
- 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
- 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
- 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
- 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
- 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
- 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
- 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
- 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
- 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
- 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
-}
-
-import sys, os
-
-def _validate_md5(egg_name, data):
- if egg_name in md5_data:
- from md5 import md5
- digest = md5(data).hexdigest()
- if digest != md5_data[egg_name]:
- print >>sys.stderr, (
- "md5 validation of %s failed! (Possible download problem?)"
- % egg_name
- )
- sys.exit(2)
- return data
-
-
-def use_setuptools(
- version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
- download_delay=15
-):
- """Automatically find/download setuptools and make it available on sys.path
-
- `version` should be a valid setuptools version number that is available
- as an egg for download under the `download_base` URL (which should end with
- a '/'). `to_dir` is the directory where setuptools will be downloaded, if
- it is not already available. If `download_delay` is specified, it should
- be the number of seconds that will be paused before initiating a download,
- should one be required. If an older version of setuptools is installed,
- this routine will print a message to ``sys.stderr`` and raise SystemExit in
- an attempt to abort the calling script.
- """
- try:
- import setuptools
- if setuptools.__version__ == '0.0.1':
- print >>sys.stderr, (
- "You have an obsolete version of setuptools installed. Please\n"
- "remove it from your system entirely before rerunning this script."
- )
- sys.exit(2)
- except ImportError:
- egg = download_setuptools(version, download_base, to_dir, download_delay)
- sys.path.insert(0, egg)
- import setuptools; setuptools.bootstrap_install_from = egg
-
- import pkg_resources
- try:
- pkg_resources.require("setuptools>="+version)
-
- except pkg_resources.VersionConflict, e:
- # XXX could we install in a subprocess here?
- print >>sys.stderr, (
- "The required version of setuptools (>=%s) is not available, and\n"
- "can't be installed while this script is running. Please install\n"
- " a more recent version first.\n\n(Currently using %r)"
- ) % (version, e.args[0])
- sys.exit(2)
-
-def download_setuptools(
- version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
- delay = 15
-):
- """Download setuptools from a specified location and return its filename
-
- `version` should be a valid setuptools version number that is available
- as an egg for download under the `download_base` URL (which should end
- with a '/'). `to_dir` is the directory where the egg will be downloaded.
- `delay` is the number of seconds to pause before an actual download attempt.
- """
- import urllib2, shutil
- egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
- url = download_base + egg_name
- saveto = os.path.join(to_dir, egg_name)
- src = dst = None
- if not os.path.exists(saveto): # Avoid repeated downloads
- try:
- from distutils import log
- if delay:
- log.warn("""
----------------------------------------------------------------------------
-This script requires setuptools version %s to run (even to display
-help). I will attempt to download it for you (from
-%s), but
-you may need to enable firewall access for this script first.
-I will start the download in %d seconds.
-
-(Note: if this machine does not have network access, please obtain the file
-
- %s
-
-and place it in this directory before rerunning this script.)
----------------------------------------------------------------------------""",
- version, download_base, delay, url
- ); from time import sleep; sleep(delay)
- log.warn("Downloading %s", url)
- src = urllib2.urlopen(url)
- # Read/write all in one block, so we don't create a corrupt file
- # if the download is interrupted.
- data = _validate_md5(egg_name, src.read())
- dst = open(saveto,"wb"); dst.write(data)
- finally:
- if src: src.close()
- if dst: dst.close()
- return os.path.realpath(saveto)
-
-def main(argv, version=DEFAULT_VERSION):
- """Install or upgrade setuptools and EasyInstall"""
-
- try:
- import setuptools
- except ImportError:
- egg = None
- try:
- egg = download_setuptools(version, delay=0)
- sys.path.insert(0,egg)
- from setuptools.command.easy_install import main
- return main(list(argv)+[egg]) # we're done here
- finally:
- if egg and os.path.exists(egg):
- os.unlink(egg)
- else:
- if setuptools.__version__ == '0.0.1':
- # tell the user to uninstall obsolete version
- use_setuptools(version)
-
- req = "setuptools>="+version
- import pkg_resources
- try:
- pkg_resources.require(req)
- except pkg_resources.VersionConflict:
- try:
- from setuptools.command.easy_install import main
- except ImportError:
- from easy_install import main
- main(list(argv)+[download_setuptools(delay=0)])
- sys.exit(0) # try to force an exit
- else:
- if argv:
- from setuptools.command.easy_install import main
- main(argv)
- else:
- print "Setuptools version",version,"or greater has been installed."
- print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
-
-
-
-def update_md5(filenames):
- """Update our built-in md5 registry"""
-
- import re
- from md5 import md5
-
- for name in filenames:
- base = os.path.basename(name)
- f = open(name,'rb')
- md5_data[base] = md5(f.read()).hexdigest()
- f.close()
-
- data = [" %r: %r,\n" % it for it in md5_data.items()]
- data.sort()
- repl = "".join(data)
-
- import inspect
- srcfile = inspect.getsourcefile(sys.modules[__name__])
- f = open(srcfile, 'rb'); src = f.read(); f.close()
-
- match = re.search("\nmd5_data = {\n([^}]+)}", src)
- if not match:
- print >>sys.stderr, "Internal error!"
- sys.exit(2)
-
- src = src[:match.start(1)] + repl + src[match.end(1):]
- f = open(srcfile,'w')
- f.write(src)
- f.close()
-
-
-if __name__=='__main__':
- if len(sys.argv)>2 and sys.argv[1]=='--md5update':
- update_md5(sys.argv[2:])
- else:
- main(sys.argv[1:])
-
-
-
-
-
=== removed file 'python/setup.py'
--- a/python/setup.py 2007-12-07 10:40:58 +0000
+++ b/python/setup.py 1970-01-01 00:00:00 +0000
@@ -1,99 +0,0 @@
-#!/usr/bin/env python
-## ndb-connectors: Wrappers for the NDBAPI
-## Copyright (C) 2006 MySQL, Inc.
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# bootstrap setuptools if necessary
-from ez_setup import use_setuptools
-use_setuptools()
-
-from distutils.command.clean import clean
-from distutils.command.build import build
-from setuptools import setup,Extension
-import os.path, os
-import sys
-
-srcdir=os.environ.get("SRCDIR",".")
-top_srcdir=os.environ.get("TOP_SRCDIR","..")
-builddir=os.environ.get("BUILDDIR",".")
-top_builddir=os.environ.get("TOP_BUILDDIR","..")
-
-description = """Python wrapper of the NDBAPI"""
-
-classifiers="""\
-Development Status :: 2 - Pre-Alpha
-License :: OSI Approved :: GPL
-Operating System :: POSIX :: Linux
-Programming Language :: C++
-Programming Language :: Python
-Topic :: Software Development :: Libraries :: Python Modules
-"""
-
-version = "0.5.0"
-
-setup(name="python-ndbapi",
- version=version,
- description=description,
- long_description=description,
- author="Monty Taylor",
- author_email="mtaylor@stripped",
- url="http://launchpad.net/ndb-connectors",
- platforms="linux",
- license="GPL",
- classifiers=filter(None, classifiers.splitlines()),
-
- ext_modules=[
- Extension("mysql.cluster._mgmapi",
- sources=["mgmapi.cpp"],
- libraries=["mgmpp"],
- library_dirs=["%s/mgmpp/.libs" % top_builddir],
- depends=["%s/interface/mgmapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/mgmapi" % top_srcdir)],
- language="c++",
-
- ),
- Extension("mysql.cluster._ndbapi",
- sources=["ndbapi.cpp"],
- library_dirs=["%s/mgmpp/.libs" % top_builddir],
- depends=["%s/interface/ndbapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/ndbapi" % top_srcdir)],
- language="c++",
-
- ),
- Extension("mysql.cluster._events",
- sources=["events.cpp"],
- libraries=["mgmpp"],
- library_dirs=["%s/mgmpp/.libs" % top_builddir],
- depends=["%s/interface/mgmapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/mgmapi" % top_srcdir)],
- language="c++",
-
- ),
- Extension("mysql.cluster._listeners",
- sources=["listeners.cpp"],
- libraries=["mgmpp"],
- library_dirs=["%s/mgmpp/.libs" % top_builddir],
- depends=["%s/interface/mgmapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/mgmapi" % top_srcdir)],
- language="c++",
-
- ),
-
- ],
- test_suite = "mysql.cluster.tests.NdbTest.test_all",
- entry_points = {
- 'sqlalchemy.databases': [ 'ndbapi = mysql.cluster.alchemy:dialect' ]
- },
-
py_modules=["mysql.cluster.ndbapi","mysql.cluster.mgmapi","mysql.cluster.events","mysql.cluster.alchemy"]
-
- )
-
| Thread |
|---|
| • Rev 310: Merged in devel changes. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3 | Monty Taylor | 23 Jan |