List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:October 30 2007 12:02pm
Subject:Rev 222: Merged in changes. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel

------------------------------------------------------------
revno: 222
revision-id: mtaylor@stripped
parent: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Tue 2007-10-30 12:02:51 +0000
message:
  Merged in changes.
modified:
  acinclude.m4                   acinclude.m4-20070228020914-u2pk759xg7thauwf-8
  java/com/mysql/cluster/ndbj/examples/TestAsync.java
testasync.java-20070703002120-jsnz1ul38pp1h3w3-1
  swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
    ------------------------------------------------------------
    revno: 217.1.5
    revision-id: mtaylor@stripped
    parent: mtaylor@stripped
    committer: Monty Taylor <mtaylor@stripped>
    branch nick: ndbjmerge
    timestamp: Tue 2007-10-30 12:02:14 +0000
    message:
      Added helper getTimeMicros() function.
    modified:
      swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
    ------------------------------------------------------------
    revno: 217.1.4
    revision-id: mtaylor@stripped
    parent: mtaylor@stripped
    committer: Monty Taylor <mtaylor@stripped>
    branch nick: ndbjmerge
    timestamp: Tue 2007-10-30 08:55:54 +0000
    message:
      Fixed async transaction delete. 
    modified:
      acinclude.m4                   acinclude.m4-20070228020914-u2pk759xg7thauwf-8
      java/com/mysql/cluster/ndbj/examples/TestAsync.java
testasync.java-20070703002120-jsnz1ul38pp1h3w3-1
      swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
=== modified file 'acinclude.m4'
--- a/acinclude.m4	2007-10-29 10:26:03 +0000
+++ b/acinclude.m4	2007-10-30 08:55:54 +0000
@@ -2,37 +2,38 @@
 dnl configure.in helper macros
 dnl 
 
-AC_DEFUN([WITH_PHP], [
-
-  AC_ARG_WITH(php,  [  --with-php=PATH	path to php_config binary],
-    with_php=$withval, withval="no")
-
-  if test "X$withval" != "Xno" ; then 
-    if test "X$withval" != "Xyes" ; then 
-      AC_CHECK_PROGS(PHP_CONFIG, $withval)
-    else
-      AC_CHECK_PROGS(PHP_CONFIG, [ php-config  php-config5 ])
-    fi
-  else 
-    with_php="no"
-  fi
-
-if test "X$PHP_CONFIG" != "X"; then 
-  PHP_CFLAGS=`$PHP_CONFIG --includes`
-  PHP_CPPFLAGS=`$PHP_CONFIG --includes`
-  PHP_LDFLAGS=`$PHP_CONFIG --ldflags`
-  PHP_EXTDIR=`$PHP_CONFIG --extension-dir`
-else
-  PHP_CFLAGS=
-  PHP_CPPFLAGS=
-  PHP_LDFLAGS=
-  PHP_EXTDIR=
-fi
-
-AC_SUBST(PHP_CFLAGS)
-AC_SUBST(PHP_CPPFLAGS)
-AC_SUBST(PHP_LDFLAGS)
-AC_SUBST(PHP_EXTDIR)
+AC_DEFUN([WITH_PHP],[
+
+  AC_ARG_WITH([php],
+    [AS_HELP_STRING([--with-php],
+      [Build NDB/PHP @<:@default=no@:>@])],
+    [with_php=$withval],
+    [with_php=no])
+
+  AS_IF([test "x$with_php" != "xno"],[
+    AS_IF([test "x$with_php" != "xyes"],
+      [ac_check_php_config=$with_php],
+      [ac_check_php_config="php-config php-config5"])
+      AC_CHECK_PROGS(PHP_CONFIG, [$ac_check_php_config])
+    ])
+
+  AS_IF([test "x$PHP_CONFIG" != "x"],[
+    PHP_CFLAGS=`$PHP_CONFIG --includes`
+    PHP_CPPFLAGS=`$PHP_CONFIG --includes`
+    PHP_LDFLAGS=`$PHP_CONFIG --ldflags`
+    PHP_EXTDIR=`$PHP_CONFIG --extension-dir`
+  ],[
+    PHP_CFLAGS=
+    PHP_CPPFLAGS=
+    PHP_LDFLAGS=
+    PHP_EXTDIR=
+    with_php=no
+  ])
+
+  AC_SUBST(PHP_CFLAGS)
+  AC_SUBST(PHP_CPPFLAGS)
+  AC_SUBST(PHP_LDFLAGS)
+  AC_SUBST(PHP_EXTDIR)
 ])
 
 AC_DEFUN([WITH_PYTHON], [
@@ -75,67 +76,70 @@
 
 AC_DEFUN([WITH_PERL], [
 
-  AC_ARG_WITH(perl, [  --with-perl=PATH	path to perl binary],
-  with_perl=$withval, withval="yes")
-
-
-  if test "X$withval" != "Xno" ; then
-     if test "X$withval" != "Xyes" ; then
-       AC_CHECK_PROGS(PERL, $withval)
-     else
-       AC_CHECK_PROGS(PERL, perl)
-     fi
-   fi
-if test "X$PERL" != "X"; then
-  PERLCCFLAGS=`$PERL -MConfig -e 'print $Config{ccflags};'`
-  PERLCPPFLAGS=`$PERL -MConfig -e 'print $Config{cppflags};'`
-  PERLLIBS=`$PERL -MConfig -e 'print $Config{perllibs};'`
-fi 
+  AC_ARG_WITH([perl], 
+    [AS_HELP_STRING([--with-perl],
+      [BULD NDB/Perl @<:@default=yes@:>@])],
+    [with_perl=$withval], 
+    [with_perl=perl])
+
+
+  AS_IF([test "x$with_perl" != "xno"],[
+    AS_IF([test "x$with_perl" != "xyes"],
+      [ac_chk_perl=$with_perl],
+      [ac_chk_perl=perl])
+    AC_CHECK_PROGS(PERL,$ac_chk_perl)
+  ])
+
+dnl Don't think we need these anymore, but it's a good reference
+dnl if test "x$PERL" != "x"; then
+dnl  PERLCCFLAGS=`$PERL -MConfig -e 'print $Config{ccflags};'`
+dnl  PERLCPPFLAGS=`$PERL -MConfig -e 'print $Config{cppflags};'`
+dnl  PERLLIBS=`$PERL -MConfig -e 'print $Config{perllibs};'`
+dnl fi 
 
 ])
 
 AC_DEFUN([WITH_RUBY], [
 
-  AC_ARG_WITH(ruby, [  --with-ruby=PATH	path to ruby binary], 
-  withval=$withval, withval="yes")
-
-  if test "X$withval" != "Xno" ; then
-     if test "X$withval" != "Xyes" ; then
-       AC_CHECK_PROGS(RUBY, $withval)
-     else
-       AC_CHECK_PROGS(RUBY, ruby)
-     fi
-   fi
-
-
-if test "X$RUBY" != X; then
-
-  dnl need to change quotes to allow square brackets
-  changequote(<<, >>)dnl
-  ruby_prefix=`$RUBY -rrbconfig -e "print Config::CONFIG['archdir']"`
-  RUBY_LIB=`$RUBY -rrbconfig -e "puts Config::CONFIG['ruby_install_name']"`
-  LIBRUBYARG_SHARED=`$RUBY -rrbconfig -e "puts Config::CONFIG['LIBRUBYARG_SHARED']"`
-  RUBY_DIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['archdir']"`
-  RUBY_LIBDIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['rubylibdir']"`
-  changequote([, ])dnl
-
-  RUBY_INCLUDES="-I$ruby_prefix"
-else
-  # This allows 'make clean' in the ruby directory to work when
-  # ruby isn't available
-  RUBY=
-  RUBY_INCLUDES=
-  LIBRUBYARG_SHARED=
-  RUBY_LIB=
-  RUBY_DIR=
-  RUBY_LIBDIR=
-fi
-AC_SUBST(RUBY_INCLUDES)
-AC_SUBST(LIBRUBYARG_SHARED)
-AC_SUBST(RUBY_LIB)
-AC_SUBST(RUBY_DIR)
-AC_SUBST(RUBY_LIBDIR)
-
+  AC_ARG_WITH([ruby],[--with-ruby],
+      [BULD NDB/Ruby @<:@default=yes@:>@],
+      [with_ruby=$withval],
+      [with_ruby=ruby])
+
+  AS_IF([test "x$with_ruby" != "xno"],[
+    AS_IF([test "x$with_ruby" != "xyes"],
+      [ac_chk_ruby=$with_ruby],
+      [ac_chk_ruby=ruby])
+    AC_CHECK_PROGS(RUBY,$ac_chk_ruby)
+  ])
+
+  AS_IF([test "x$RUBY" != "x"],[
+
+    dnl need to change quotes to allow square brackets
+    changequote(<<, >>)dnl
+    ruby_prefix=`$RUBY -rrbconfig -e "print Config::CONFIG['archdir']"`
+    RUBY_LIB=`$RUBY -rrbconfig -e "puts Config::CONFIG['ruby_install_name']"`
+    LIBRUBYARG_SHARED=`$RUBY -rrbconfig -e "puts Config::CONFIG['LIBRUBYARG_SHARED']"`
+    RUBY_DIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['archdir']"`
+    RUBY_LIBDIR=`$RUBY -rrbconfig -e "puts Config::CONFIG['rubylibdir']"`
+    RUBY_INCLUDES="-I$ruby_prefix"
+    changequote([, ])dnl
+  ],[
+    # This allows 'make clean' in the ruby directory to work when
+    # ruby isn't available
+    RUBY=
+    RUBY_INCLUDES=
+    LIBRUBYARG_SHARED=
+    RUBY_LIB=
+    RUBY_DIR=
+    RUBY_LIBDIR=
+  ])
+
+  AC_SUBST(RUBY_INCLUDES)
+  AC_SUBST(LIBRUBYARG_SHARED)
+  AC_SUBST(RUBY_LIB)
+  AC_SUBST(RUBY_DIR)
+  AC_SUBST(RUBY_LIBDIR)
 
 ])
  

=== modified file 'java/com/mysql/cluster/ndbj/examples/TestAsync.java'
--- a/java/com/mysql/cluster/ndbj/examples/TestAsync.java	2007-10-24 02:46:38 +0000
+++ b/java/com/mysql/cluster/ndbj/examples/TestAsync.java	2007-10-30 08:55:54 +0000
@@ -121,12 +121,11 @@
       for(int i=0;i<BATCH_SIZE-offset;i++) { 
 
 
-    	  java.math.BigInteger auto_id = myNdb.getAutoIncrementValue(myTable,BATCH_SIZE);
     	  NdbOperation myOperation = myTransaction.getNdbOperation(myTable);
 
     	  myOperation.insertTuple();
 
-    	  myOperation.equal("ATTR1",((t-1)*BATCH_SIZE)+i);
+    	  myOperation.equalInt("ATTR1",((t-1)*BATCH_SIZE)+i);
     	  myOperation.setLong("ATTR2", t*BATCH_SIZE+i);
 
       }      
@@ -196,7 +195,7 @@
       NdbOperation myOper = myTrans.getNdbOperation(table_name);
       myOper.readTuple(NdbOperation.LockMode.LM_Read);
       
-      myOper.equal("ATTR1",id_num);
+      myOper.equalInt("ATTR1",id_num);
       
       myOper.getValue("ATTR2"); 
       
@@ -232,8 +231,7 @@
       NdbOperation myOper = myTrans.getNdbOperation(table_name);
       myOper.readTuple(NdbOperation.LockMode.LM_Read);
       
-      myOper.equal("ATTR1",id_num);
-
+      myOper.equalInt("ATTR1",id_num);
     
       myOper.getValue("ATTR2"); 
 
@@ -242,7 +240,6 @@
       
       myTrans.executeAsynchPrepare(ExecType.Commit, cb, AbortOption.AbortOnError);
       cbs.add(cb);
-
 //      foo=myRecAttr.int32_value();
 //      myNdb.closeTransaction(myTrans);
     }

=== modified file 'swig/ndbglobals.i'
--- a/swig/ndbglobals.i	2007-10-25 13:24:04 +0000
+++ b/swig/ndbglobals.i	2007-10-30 12:02:14 +0000
@@ -40,9 +40,6 @@
   void theNdbCallback(int ret, NdbTransaction * trans, void * anyObject) {
     BaseCallback * cb = (BaseCallback *)anyObject;
     cb->callback(ret, trans);
-    /* TODO: Fix the transaction leak here so we don't need this */
-    trans->close(); 
-    delete cb;
   }
 
   class BaseEventCallback {
@@ -61,6 +58,13 @@
     cb->callback(theOp,theNdb);
   }
 
+  long long getTimeMicros() 
+  {
+    struct timeval tTime;
+    gettimeofday(&tTime, 0);
+    long long microSeconds = (long long) tTime.tv_sec * 1000000 + tTime.tv_usec;
+    return microSeconds;
+  }
 
 
 typedef int voidint; 
@@ -78,6 +82,7 @@
 } BYTES; 
 %}
 
+long long getTimeMicros();
 /*
 typedef char my_bool;
 enum enum_mysql_timestamp_type

Thread
Rev 222: Merged in changes. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/develMonty Taylor30 Oct