List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:October 31 2007 3:07pm
Subject:Rev 202: Merged in tons of changes from the devel line so I can start working on distribution keys. in http://bazaar.launchpad.net/~ndb-connectors/ndb...
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3

------------------------------------------------------------
revno: 202
revision-id: mtaylor@stripped
parent: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: telco-6.3
timestamp: Wed 2007-10-31 15:07:03 +0000
message:
  Merged in tons of changes from the devel line so I can start working on distribution
keys.
added:
  java/testsuite/ndbj/ImmediatePollTimeoutTest.java
immediatepolltimeout-20071030180642-3bfrv97t3q8mc2m6-1
renamed:
  java/com/mysql/cluster/ndbj/INdbCallable.java =>
java/com/mysql/cluster/ndbj/BaseCallback.java
indbcallable.java-20070913212805-mw0t23qijtyjad85-1
modified:
  configure.in                   configure.in-20070228020914-u2pk759xg7thauwf-13
  java/build.xml                 build.xml-20070521233115-yg3ylf2k3vuzr27o-1
  java/com/mysql/cluster/ndbj/NdbTransaction.java
ndbtransaction.java-20070517181935-98huwjarzuh25b30-27
  java/com/mysql/cluster/ndbj/examples/TestEvent.java
testevent.java-20071026232217-5tigfbdmcudrnbbx-1
  java/ndbj.i                    ndbj.i-20070913223244-5938mztpztyn9sry-1
  swig/NdbTransaction.i          ndbtransaction.i-20070227184716-ecjyhh3jgvmye4de-7
  swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
  java/com/mysql/cluster/ndbj/BaseCallback.java
indbcallable.java-20070913212805-mw0t23qijtyjad85-1
    ------------------------------------------------------------
    revno: 192.1.25.1.10
    revision-id: mtaylor@stripped
    parent: mtaylor@stripped
    committer: Monty Taylor <mtaylor@stripped>
    branch nick: ndbjmerge
    timestamp: Wed 2007-10-31 15:04:37 +0000
    message:
      Removed directors based callback. Implemented a new callback mechanism by hand. 
    renamed:
      java/com/mysql/cluster/ndbj/INdbCallable.java =>
java/com/mysql/cluster/ndbj/BaseCallback.java
indbcallable.java-20070913212805-mw0t23qijtyjad85-1
    modified:
      java/build.xml                 build.xml-20070521233115-yg3ylf2k3vuzr27o-1
      java/com/mysql/cluster/ndbj/NdbTransaction.java
ndbtransaction.java-20070517181935-98huwjarzuh25b30-27
      java/ndbj.i                    ndbj.i-20070913223244-5938mztpztyn9sry-1
      swig/NdbTransaction.i          ndbtransaction.i-20070227184716-ecjyhh3jgvmye4de-7
      swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
      java/com/mysql/cluster/ndbj/BaseCallback.java
indbcallable.java-20070913212805-mw0t23qijtyjad85-1
    ------------------------------------------------------------
    revno: 192.1.25.1.9
    revision-id: mtaylor@stripped
    parent: mtaylor@stripped
    parent: mtaylor@stripped
    committer: Monty Taylor <mtaylor@stripped>
    branch nick: ndbjmerge
    timestamp: Tue 2007-10-30 19:19:45 +0000
    message:
      Merging changes.
    added:
      java/testsuite/ndbj/ImmediatePollTimeoutTest.java
immediatepolltimeout-20071030180642-3bfrv97t3q8mc2m6-1
        ------------------------------------------------------------
        revno: 192.1.32
        revision-id: mtaylor@stripped
        parent: mtaylor@stripped
        parent: root@stripped
        committer: Monty Taylor <mtaylor@stripped>
        branch nick: devel
        timestamp: Tue 2007-10-30 19:17:06 +0000
        message:
          Merged in new test from David Shepherd for testing ImmediatePollTimeout
        added:
          java/testsuite/ndbj/ImmediatePollTimeoutTest.java
immediatepolltimeout-20071030180642-3bfrv97t3q8mc2m6-1
            ------------------------------------------------------------
            revno: 192.1.30.1.1
            revision-id: root@stripped
            parent: mtaylor@stripped
            committer: root <root@stripped>
            branch nick: work
            timestamp: Tue 2007-10-30 18:06:46 +0000
            message:
              h
            added:
              java/testsuite/ndbj/ImmediatePollTimeoutTest.java
immediatepolltimeout-20071030180642-3bfrv97t3q8mc2m6-1
        ------------------------------------------------------------
        revno: 192.1.31
        revision-id: mtaylor@stripped
        parent: mtaylor@stripped
        parent: mtaylor@stripped
        committer: Monty Taylor <mtaylor@stripped>
        branch nick: devel
        timestamp: Tue 2007-10-30 18:16:00 +0000
        message:
          Merged in changes for async timing.
        modified:
          configure.in                   configure.in-20070228020914-u2pk759xg7thauwf-13
          java/com/mysql/cluster/ndbj/examples/TestEvent.java
testevent.java-20071026232217-5tigfbdmcudrnbbx-1
          java/ndbj.i                    ndbj.i-20070913223244-5938mztpztyn9sry-1
          swig/NdbTransaction.i         
ndbtransaction.i-20070227184716-ecjyhh3jgvmye4de-7
          swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
    ------------------------------------------------------------
    revno: 192.1.25.1.8
    revision-id: mtaylor@stripped
    parent: mtaylor@stripped
    committer: Monty Taylor <mtaylor@stripped>
    branch nick: ndbjmerge
    timestamp: Tue 2007-10-30 19:19:27 +0000
    message:
      Merging changes.
    modified:
      swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
    ------------------------------------------------------------
    revno: 192.1.25.1.7
    revision-id: mtaylor@stripped
    parent: mtaylor@stripped
    committer: Monty Taylor <mtaylor@stripped>
    branch nick: ndbjmerge
    timestamp: Tue 2007-10-30 18:05:31 +0000
    message:
      Fix to make Johan happy.
    modified:
      swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
    ------------------------------------------------------------
    revno: 192.1.25.1.6
    revision-id: mtaylor@stripped
    parent: mtaylor@stripped
    committer: Monty Taylor <mtaylor@stripped>
    branch nick: ndbjmerge
    timestamp: Tue 2007-10-30 18:04:07 +0000
    message:
      Added timing to async callbacks.
    modified:
      configure.in                   configure.in-20070228020914-u2pk759xg7thauwf-13
      java/com/mysql/cluster/ndbj/examples/TestEvent.java
testevent.java-20071026232217-5tigfbdmcudrnbbx-1
      java/ndbj.i                    ndbj.i-20070913223244-5938mztpztyn9sry-1
      swig/NdbTransaction.i          ndbtransaction.i-20070227184716-ecjyhh3jgvmye4de-7
      swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
=== added file 'java/testsuite/ndbj/ImmediatePollTimeoutTest.java'
--- a/java/testsuite/ndbj/ImmediatePollTimeoutTest.java	1970-01-01 00:00:00 +0000
+++ b/java/testsuite/ndbj/ImmediatePollTimeoutTest.java	2007-10-30 18:06:46 +0000
@@ -0,0 +1,180 @@
+package testsuite.ndbj;
+
+import java.util.*;
+
+import testsuite.BaseNdbjTestCase;
+import com.mysql.cluster.ndbj.*;
+
+public class ImmediatePollTimeoutTest extends BaseNdbjTestCase {
+
+	static boolean alreadySetUp                   = false;
+	static long    ourTotalTransactionCount       = 0;
+	static long    ourOutstandingTransactionCount = 0;
+	static long    ourCallbackCount               = 0;
+
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	// GENERAL STUFF
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+	static int MAXIMUM_OPERATION_VOLUME       = 300; // TO DO: Calculate this
+
+	static int NUMBER_OF_ELEMENT_INSERTIONS   = 50;
+
+	static int NUM_REQUEST_TRANSACTIONS       = 2;
+	static int REQUEST_TRANSACTIONS_TIMEOUT   = 0;
+
+	static int FORCE_SEND                     = 1;
+
+	static boolean USE_SYNCHRONOUS            = false;
+
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	// TABLE METADATA
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+	static String tablename      = "t_immediatepolltimeouttest";
+
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	// INITIALISATION CODE
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+	public ImmediatePollTimeoutTest(String arg0) {
+		super(arg0);
+	}
+
+	public void setUp() throws Exception {
+		super.setUp();
+
+		if (!alreadySetUp) {
+			// Create required tables
+
+			System.out.print("Creating tables...");
+
+			this.createTable(tablename, 
+				"    (ATTR1 INT UNSIGNED auto_increment not null," +
+				"     ATTR2 INT UNSIGNED NOT NULL," +
+				"     PRIMARY KEY (ATTR1) )" + 
+				"  ENGINE=NDBCLUSTER");
+
+			System.out.println("done.");
+
+			System.out.print("Storing column indices...");
+			System.out.println("done.");
+
+			alreadySetUp = true;
+		}
+	}
+
+	public void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	// TEST CODE
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+	public void testOperation() {
+		
+		HashMap<Integer,BaseCallback> hash=new HashMap<Integer,BaseCallback>();
+	
+		try {
+			for (int loop = 0;
+			loop < 100;
+			loop++) {
+				// Process request transaction
+
+				NdbOperation orderOp;
+				BaseCallback callback;
+
+				for (int elementCount = 0;
+				     elementCount < NUMBER_OF_ELEMENT_INSERTIONS;
+				     elementCount++) {
+					int id = (NUMBER_OF_ELEMENT_INSERTIONS * loop) + elementCount;
+
+					trans = ndb.startTransaction();
+					orderOp = trans.getNdbOperation(tablename);
+					orderOp.insertTuple();
+					orderOp.equalInt("ATTR1", id);
+					orderOp.setInt("ATTR2", id);
+
+					callback = new MyCallback(hash, id, ndb, orderOp.resultData());
+					hash.put(callback.hashCode(), callback);
+
+					trans.executeAsynchPrepare(ExecType.Commit,
+							callback,
+							AbortOption.AbortOnError);
+
+					ourOutstandingTransactionCount++;
+				}
+
+				ourCallbackCount = 0;
+
+				ndb.sendPreparedTransactions(FORCE_SEND);
+
+				long then = System.nanoTime();
+				ndb.pollNdb(REQUEST_TRANSACTIONS_TIMEOUT);
+				long now = System.nanoTime();
+
+				ourOutstandingTransactionCount = ourOutstandingTransactionCount - ourCallbackCount;
+				System.out.println("Poll took " + (now - then) + " nanos (" + ourCallbackCount + 
+							" txs received) [" + ourOutstandingTransactionCount + " outstanding]");
+			}
+
+			System.out.println("Performing cooldown");
+
+			ourCallbackCount = 0;
+
+			long then = System.nanoTime();
+			ndb.pollNdb(100000,100000);
+			long now = System.nanoTime();
+
+			ourOutstandingTransactionCount = ourOutstandingTransactionCount - ourCallbackCount;
+			System.out.println("Closedown poll took " + (now - then) + " nanos (" +
ourCallbackCount + 
+						" txs received) [" + ourOutstandingTransactionCount + " outstanding]");
+		}
+		catch (NdbApiException e) {
+			System.out.println("Caught NdbApiException in Insert:\t" + e.getMessage());
+			e.printStackTrace();
+			assertFalse(true);
+		}
+		finally {
+			// Do something ;o)
+		}
+	}
+
+	class HashCallback extends BaseCallback {
+	
+
+	    int                            myCallbackNum;
+	    Ndb                            myNdb;
+	    NdbResultSet                   myResults;
+	    HashMap<Integer, BaseCallback> myMap;
+
+	    public HashCallback(HashMap<Integer, BaseCallback> theMap, int theCallbackNum,
Ndb theNdb, NdbResultSet theResults) {
+		myMap         = theMap;
+		myCallbackNum = theCallbackNum;
+		myNdb         = theNdb;
+		myResults     = theResults;
+	    }
+    
+	    public void callback(int res, NdbTransactionImpl trans) { 
+
+		if (res!=0)
System.out.println("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHASSSSSSSSSSSSSSSSSSSSHHH");
+	
+		trans.close();
+		myMap.remove(this.hashCode());
+
+		ourCallbackCount++;
+	    }
+    
+	}
+
+	class MyCallback extends HashCallback {
+
+	    public MyCallback(HashMap<Integer, BaseCallback> theMap,int theCallbackNum,
Ndb theNdb, NdbResultSet theResults) {
+		super(theMap, theCallbackNum, theNdb, theResults);
+	    }
+
+	}
+
+}

=== renamed file 'java/com/mysql/cluster/ndbj/INdbCallable.java' =>
'java/com/mysql/cluster/ndbj/BaseCallback.java'
--- a/java/com/mysql/cluster/ndbj/INdbCallable.java	2007-09-30 02:06:41 +0000
+++ b/java/com/mysql/cluster/ndbj/BaseCallback.java	2007-10-31 15:04:37 +0000
@@ -1,8 +1,41 @@
 package com.mysql.cluster.ndbj;
 
-
-public interface INdbCallable { 
-
-  void callback(int result, NdbTransaction myTrans);
-
+import com.mysql.cluster.ndbj.ndbjJNI;
+
+public class BaseCallback { 
+
+  private long create_time;
+  private long start_time;
+  private long end_time;
+
+  public BaseCallback() { 
+    create_time = 0;
+    start_time = 0;
+    end_time = 0;
+  }
+
+  protected final void jni_call_callback(int result, long transPtr, long create_time) {
+    this.create_time = create_time;
+    this.start_time = this.getMicroTime();
+    this.callback(result,new NdbTransactionImpl(transPtr,false));
+    this.end_time = this.getMicroTime();
+  };
+
+  public void callback(int result, NdbTransaction myTrans) {}
+
+  public final long getMicroTime() { 
+    return ndbjJNI.getMicroTime(); 
+  }
+
+  public final long getElapsedTime() { 
+    return this.getMicroTime() - this.create_time; 
+  }
+
+  public final long getExecuteTime() { 
+    return this.end_time - this.create_time; 
+  }
+
+  public final long getCallbackTime() { 
+    return this.end_time - this.start_time; 
+  } 
 };

=== modified file 'configure.in'
--- a/configure.in	2007-10-28 00:17:55 +0000
+++ b/configure.in	2007-10-30 18:04:07 +0000
@@ -6,6 +6,18 @@
     [  --with-debug         Build a debugging version],
     [with_debug=$withval],
     [with_debug=no])
+
+AC_ARG_WITH([async-time],
+  [AS_HELP_STRING([--with-async-time],
+      [Produce timing reports for Async transactions @<:@default=no@:>@])],
+    [with_asynctime=$withval],
+    [with_asynctime=no])
+
+AS_IF([test "x$with_asynctime" = "xyes"],
+      [AC_DEFINE([DEBUG_ASYNC_TIMES],1,
+	[Define to 1 if you want to profile async callbacks])],
+      [])
+
 if test "$with_debug" = "yes"
 then
   CXXFLAGS="-ggdb3 -Wall"

=== modified file 'java/build.xml'
--- a/java/build.xml	2007-10-29 15:26:44 +0000
+++ b/java/build.xml	2007-10-31 15:04:37 +0000
@@ -48,7 +48,6 @@
       <fileset dir="com/mysql/cluster/mgmj" includes="NdbMgmSeverity.java" />
       <fileset dir="com/mysql/cluster/ndbj" includes="NdbColumn.java" />
       <fileset dir="com/mysql/cluster/ndbj" includes="AbortOption.java" />
-      <fileset dir="com/mysql/cluster/ndbj" includes="BaseCallback.java" />
       <fileset dir="com/mysql/cluster/ndbj" includes="ExecType.java" />
       <fileset dir="com/mysql/cluster/ndbj" includes="NdbDictionary.java" />
       <fileset dir="com/mysql/cluster/ndbj" includes="NdbEvent.java" />

=== modified file 'java/com/mysql/cluster/ndbj/NdbTransaction.java'
--- a/java/com/mysql/cluster/ndbj/NdbTransaction.java	2007-10-05 18:18:53 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbTransaction.java	2007-10-31 15:04:37 +0000
@@ -147,9 +147,6 @@
 	public int execute(ExecType execType, AbortOption abortOption) throws NdbApiException;
 	public int execute(ExecType execType) throws NdbApiException;
 
-	public void executeAsynchPrepare(ExecType execType, BaseCallback cb,
-			AbortOption abortOption);
-	public void executeAsynchPrepare(ExecType execType, BaseCallback cb);
 	/**
 	 * Creates a NdbOperationRef (primary key operation) and adds it to the transaction.
 	 * @param tableName name of the schema
@@ -257,17 +254,17 @@
 	 * @param cb
 	 * @param abortOption
 	 * @see NdbTransactionRef#executeAsynchPrepare(ExecTypeRef,
-	 *      INdbCallable,
+	 *      BaseCallback,
 	 *      AbortOptionRef)
 	 */
-	public void executeAsynchPrepare(ExecType execType, INdbCallable cb, AbortOption
abortOption);
+	public void executeAsynchPrepare(ExecType execType, BaseCallback cb, AbortOption
abortOption);
 	/**
 	 * @param execType
 	 * @param cb
 	 * @see NdbTransactionRef#executeAsynchPrepare(ExecTypeRef,
-	 *      INdbCallable)
+	 *      BaseCallback)
 	 */
-	public void executeAsynchPrepare(ExecType execType, INdbCallable cb);
+	public void executeAsynchPrepare(ExecType execType, BaseCallback cb);
 	public NdbOperationImpl getNdbOperation(NdbTable aTable) throws NdbApiException;
 	public NdbIndexScanOperationImpl getNdbIndexScanOperation(NdbIndex anIndex, NdbTable
aTable) throws NdbApiException;
 	public NdbIndexOperationImpl getNdbIndexOperation(NdbIndex anIndex, NdbTable aTable)
throws NdbApiException;

=== modified file 'java/com/mysql/cluster/ndbj/examples/TestEvent.java'
--- a/java/com/mysql/cluster/ndbj/examples/TestEvent.java	2007-10-28 00:05:03 +0000
+++ b/java/com/mysql/cluster/ndbj/examples/TestEvent.java	2007-10-30 18:04:07 +0000
@@ -89,6 +89,8 @@
 	  }
       NdbResultSet theResultSet = eop.resultData();
       NdbResultSet preResultSet = eop.preResultData();
+     
+      
       
       System.out.println("done");
 

=== modified file 'java/ndbj.i'
--- a/java/ndbj.i	2007-10-30 12:55:23 +0000
+++ b/java/ndbj.i	2007-10-31 15:07:03 +0000
@@ -17,7 +17,7 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-%module(directors="1") ndbj
+%module ndbj
 
 
 %rename NdbBlob NdbBlobImpl;
@@ -37,7 +37,6 @@
 %include "various.i"
 %include "enums.swg"
 
-%include "config.h"
 
 %{
 #include <stdio.h>
@@ -46,58 +45,39 @@
 asynch_callback_t
 {  
   JNIEnv *env; 
-  jobject obj; 
-};
-
-typedef struct
-event_callback_t
-{  
-  JNIEnv *env; 
-  jobject obj; 
-};
-
-
-static void JavaCallBack(int result,
+  jobject obj;
+  long long create_time;
+};
+
+
+
+static void theCallBack(int result,
                      NdbTransaction *trans,
                      void *aObject)
 {
 
   asynch_callback_t * callback_data = (asynch_callback_t *)aObject;
 
-  JNIEnv *env = callback_data->env; 
-
-  jclass callablecls = env->GetObjectClass((callback_data->obj));
-
-  jmethodID mid = env->GetMethodID(callablecls, "callback", "(ILNdbTransaction;)V");
-  if (mid == NULL) { 
-    jclass clazz = env->FindClass("java/lang/RuntimeException");
-    env->ThrowNew(clazz,"No callback method!");
-  }
-
-  env->CallVoidMethod(callback_data->obj,mid,(jlong)result,trans);
-
-}
-
-static void EventCallBack(NdbEventOperation *theOp,
-                     Ndb *theNdb,
-                     void *aObject)
-{
-
-  event_callback_t * callback_data = (event_callback_t *)aObject;
-
-  JNIEnv *env = callback_data->env; 
-
-  jclass callablecls = env->GetObjectClass((callback_data->obj));
-
-  jmethodID mid = env->GetMethodID(callablecls, "callback", "(ILNdb;)V");
-  if (mid == NULL) { 
-    jclass clazz = env->FindClass("java/lang/RuntimeException");
-    env->ThrowNew(clazz,"No callback method!");
-  }
-
-  env->CallVoidMethod(callback_data->obj,mid,theOp,theNdb);
-
-}
+  JNIEnv *jenv = callback_data->env;
+//  printf("Running callback: env == %p .. callback_data->obj ==
%p\n",jenv,callback_data->obj); 
+
+  jclass callablecls = jenv->GetObjectClass((callback_data->obj));
+
+  // printf("\tcallablecls: %p\n",callablecls);
+  jmethodID mid = jenv->GetMethodID(callablecls, "jni_call_callback","(IJJ)V");
+
+  //jmethodID mid = jenv->GetMethodID(callablecls, "callback",
"(ILNdbTransaction;)V");
+  //printf("\tmid: %p\n",mid);
+  if ((mid == NULL) || (mid == 0)) { 
+    jenv->DeleteGlobalRef(callback_data->obj);
+    jclass clazz = jenv->FindClass("java/lang/RuntimeException");
+    jenv->ThrowNew(clazz,"No callback method!");
+  }
+
+ 
jenv->CallVoidMethod(callback_data->obj,mid,(jlong)result,trans,callback_data->create_time);
+  jenv->DeleteGlobalRef(callback_data->obj);
+}
+
 
 #define NDB_exception(excp, msg) { ndb_throw_exception(jenv, #excp,msg);  } 
 #define NDB_exception_err(excp, msg, err) { ndb_throw_exception(jenv, #excp,msg, err);  }

@@ -144,17 +124,17 @@
 
 %typemap(in) asynch_callback_t * cb
 %{ 
-  asynch_callback_t * callback_data; 
-    callback_data = new asynch_callback_t;
-    callback_data->env = jenv; 
-    callback_data->obj = $input;
-    
-    $1 = callback_data;
+    $1 = new asynch_callback_t;
+    $1->env = jenv; 
+    $1->obj = jenv->NewGlobalRef($input);
+    $1->create_time = 0;
+//    jclass callablecls = jenv->GetObjectClass(($1->obj));    
+//    printf("Registering callback: env==%p .. obj==%p ..
callbackcls==%p\n",jenv,$1->obj,callablecls);
  %}
 
 %typemap(in) event_callback_t * cb
 %{ 
-  event_callback_t * callback_data; 
+  
     callback_data = new event_callback_t;
     callback_data->env = jenv; 
     callback_data->obj = $input;
@@ -164,14 +144,9 @@
 
 %typemap(jni) asynch_callback_t * "jobject" 
 %typemap(jtype) asynch_callback_t * "Object"
-%typemap(jstype) asynch_callback_t * "INdbCallable"
+%typemap(jstype) asynch_callback_t * "BaseCallback"
 %typemap(javain) asynch_callback_t * "(Object)$javainput"
 
-%typemap(jni) event_callback_t * "jobject" 
-%typemap(jtype) event_callback_t * "Object"
-%typemap(jstype) event_callback_t * "INdbEventCallable"
-%typemap(javain) event_callback_t * "(Object)$javainput"
-
 %typemap(jtype) voidint "void";
 %typemap(jstype) voidint "void";
 %typemap(javaout) voidint { 
@@ -446,10 +421,6 @@
 
 %extend NdbTransaction { 
   
-  void executeAsynchPrepare(ExecType execType, asynch_callback_t * cb, AbortOption      
abortOption = AbortOnError){ 
-    self->executeAsynchPrepare(execType,JavaCallBack,(void *)cb, abortOption); 
-    
-  }
 };
 
 %typemap(javainterfaces) NdbOperation "NdbOperation,NdbInterpretedOperation";

=== modified file 'swig/NdbTransaction.i'
--- a/swig/NdbTransaction.i	2007-10-23 05:12:33 +0000
+++ b/swig/NdbTransaction.i	2007-10-31 15:04:37 +0000
@@ -133,12 +133,12 @@
     }
 */
     %ndbnoexception
-    void executeAsynchPrepare(ExecType execType,
-			      BaseCallback * cb,
-			      AbortOption abortOption = AbortOnError) {
-      self->executeAsynchPrepare(execType,theNdbCallback,(void *)cb,abortOption);
-    };
 
+       void executeAsynchPrepare(ExecType execType, asynch_callback_t * cb, AbortOption  
    abortOption = AbortOnError){ 
+    cb->create_time=getMicroTime();
+    self->executeAsynchPrepare(execType,theCallBack,(void *)cb, abortOption); 
+    
+  }
 
     %ndbexception("NdbApiException") { 
       $action

=== modified file 'swig/ndbglobals.i'
--- a/swig/ndbglobals.i	2007-10-30 12:02:14 +0000
+++ b/swig/ndbglobals.i	2007-10-31 15:04:37 +0000
@@ -18,6 +18,7 @@
 */
 
 %include "globals.i"
+%include "config.h"
 
 %{
 #include <my_global.h>
@@ -25,40 +26,20 @@
 
 #include <mysql.h>
 #include <NdbApi.hpp> 
+
+#undef PACKAGE
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#undef VERSION
+
+#include "config.h"
+
 //#include <m_ctype.h>
 
-  class BaseCallback { 
-
-  public:
-    virtual ~BaseCallback() {};
-    virtual void callback(int res, NdbTransaction * trans) { 
-      printf("In BaseCallback::callback. Return Value: %d. Transaction: %p\n",res,trans);
-  }
-
-  };
-
-  void theNdbCallback(int ret, NdbTransaction * trans, void * anyObject) {
-    BaseCallback * cb = (BaseCallback *)anyObject;
-    cb->callback(ret, trans);
-  }
-
-  class BaseEventCallback {
-
-    public: 
-      virtual ~BaseEventCallback() {};
-      virtual void callback(NdbEventOperation *theOp, Ndb *theNdb) {
-        printf("In BaseEventCallback::callback.\n\tOperation: %p\n\tNdb: %p\n",
-               theOp,theNdb);
-    }
-  };
-
-
-  void theNdbEventCallback(NdbEventOperation * theOp, Ndb * theNdb, void * anyObject) { 
-    BaseEventCallback * cb = (BaseEventCallback *)anyObject;
-    cb->callback(theOp,theNdb);
-  }
-
-  long long getTimeMicros() 
+
+  long long getMicroTime() 
   {
     struct timeval tTime;
     gettimeofday(&tTime, 0);
@@ -67,6 +48,7 @@
   }
 
 
+
 typedef int voidint; 
 typedef Uint32 NdbTimestamp;
 
@@ -82,7 +64,7 @@
 } BYTES; 
 %}
 
-long long getTimeMicros();
+long long getMicroTime();
 /*
 typedef char my_bool;
 enum enum_mysql_timestamp_type
@@ -134,21 +116,3 @@
 typedef Uint32 NdbTimestamp;
 
 
-%feature("director") BaseCallback;
-
-class BaseCallback {
-  virtual ~BaseCallback() {};
-  public:
-  virtual void callback(int res, NdbTransaction * trans);
-  
-};
-
-%feature("director") BaseEventCallback;
-
-class BaseEventCallback {
-
-  public:
-    virtual ~BaseEventCallback() {};
-    virtual void callback(NdbEventOperation *theOp, Ndb *theNdb);
-};
-

Thread
Rev 202: Merged in tons of changes from the devel line so I can start working on distribution keys. in http://bazaar.launchpad.net/~ndb-connectors/ndb...Monty Taylor31 Oct