List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:October 1 2007 6:13am
Subject:Rev 165: Fixed everything from merge except whereGreaterThan* methods and NdbBlob. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjm...
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge

------------------------------------------------------------
revno: 165
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Sun 2007-09-30 23:12:42 -0700
message:
  Fixed everything from merge except whereGreaterThan* methods and NdbBlob.
modified:
  java/com/mysql/cluster/ndbj/NdbScanOperation.java
ndbscanoperation.jav-20070517181935-98huwjarzuh25b30-25
  java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java
ndbscanoperationimpl-20070517181935-98huwjarzuh25b30-26
  java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java
joinusingscanandinde-20070517181935-98huwjarzuh25b30-37
  java/com/mysql/cluster/ndbj/examples/PrimaryKeyBatchOps.java
primarykeybatchops.j-20070517181935-98huwjarzuh25b30-38
  java/com/mysql/cluster/ndbj/examples/PrimaryKeyOpBlob.java
primarykeyopblob.jav-20070517181935-98huwjarzuh25b30-39
  java/com/mysql/cluster/ndbj/examples/ReadRowsUsingTableScan.java
readrowsusingtablesc-20070517181935-98huwjarzuh25b30-40
  java/com/mysql/cluster/ndbj/examples/ReadUsingOrderedIndexOnPK.java
readusingorderedinde-20070517181935-98huwjarzuh25b30-41
  java/com/mysql/cluster/ndbj/examples/ReadUsingPrimaryKey.java
readusingprimarykey.-20070517181935-98huwjarzuh25b30-42
  java/ndbj.i                    ndbj.i-20070913223244-5938mztpztyn9sry-1
  java/testsuite/ndbj/NdbScanFilterTest.java
ndbscanfiltertest.ja-20070517181935-98huwjarzuh25b30-57
  java/testsuite/ndbj/OrderedIndexScanTest.java
orderedindexscantest-20070913200612-yxpzo7ji93xk863r-1
  swig/NdbScanOperation.i        ndbscanoperation.i-20070228021421-qkr4cbpxymyqdrf3-5
=== modified file 'java/com/mysql/cluster/ndbj/NdbScanOperation.java'
--- a/java/com/mysql/cluster/ndbj/NdbScanOperation.java	2007-09-30 21:21:46 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbScanOperation.java	2007-10-01 06:12:42 +0000
@@ -112,7 +112,7 @@
      * Use 0 to specify the maximum automatically.
      * @throws NdbApiException if the object has been closed or if readTuples failed
      */
-    public abstract int readTuples(LockMode mode, ScanFlag scanFlag, long parallel,
+    public abstract int readTuples(LockMode mode, long scanFlag, long parallel,
             long batch) throws NdbApiException;
 
 
@@ -227,4 +227,23 @@
     public abstract NdbScanFilter getNdbScanFilter() throws NdbApiException;
 
 
+	public abstract int readTuples() throws NdbApiException;
+
+	public abstract int readTuples(NdbOperation.LockMode lock_mode, long scan_flags, long
parallel) throws NdbApiException;
+		  
+
+	public abstract int readTuples(int parallell) throws NdbApiException;
+
+
+	public abstract int readTuplesExclusive(int parallell) throws NdbApiException;
+
+
+	public abstract int readTuplesExclusive() throws NdbApiException;
+
+	public abstract int readTuples(LockMode mode, ScanFlag scanFlag, long parallel,
+            long batch) throws NdbApiException;
+
+	public abstract int readTuples(LockMode mode, ArrayList<ScanFlag> scanFlag, long
parallel,
+            long batch) throws NdbApiException;
+
 }
\ No newline at end of file

=== modified file 'java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java'
--- a/java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java	2007-09-30 21:21:46 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java	2007-10-01 06:12:42 +0000
@@ -7,7 +7,7 @@
  * ----------------------------------------------------------------------------- */
 
 package com.mysql.cluster.ndbj;
-
+import java.util.ArrayList;
 public class NdbScanOperationImpl extends NdbOperationImpl implements NdbScanOperation {
   private long swigCPtr;
 
@@ -29,20 +29,37 @@
     super.delete();
   }
 
-public NdbScanFilter getNdbScanFilter() throws NdbApiException {
-  return new NdbScanFilterImpl(this);
-}
- 
-  public int readTuples(NdbOperation.LockMode lock_mode, NdbScanOperation.ScanFlag
scan_flags, long parallel, long batch) throws NdbApiException {
-    return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_0(swigCPtr, this,
lock_mode.swigValue(), scan_flags.swigValue(), parallel, batch);
-  }
-
-  public int readTuples(NdbOperation.LockMode lock_mode, NdbScanOperation.ScanFlag
scan_flags, long parallel) throws NdbApiException {
-    return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_1(swigCPtr, this,
lock_mode.swigValue(), scan_flags.swigValue(), parallel);
-  }
-
-  public int readTuples(NdbOperation.LockMode lock_mode, NdbScanOperation.ScanFlag
scan_flags) throws NdbApiException {
-    return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_2(swigCPtr, this,
lock_mode.swigValue(), scan_flags.swigValue());
+  
+  public NdbScanFilter getNdbScanFilter() throws NdbApiException {
+    return new NdbScanFilterImpl(this);
+  }
+
+  public int readTuples(NdbOperation.LockMode mode, NdbScanOperation.ScanFlag scanFlag,
long parallel,
+			long batch) throws NdbApiException { 
+    return readTuples(mode,scanFlag.type,parallel,batch);
+  }
+
+  public int readTuples(NdbOperation.LockMode mode,
ArrayList<NdbScanOperation.ScanFlag> scanFlag, long parallel,
+			long batch) throws NdbApiException {
+    long flagVal = 0;
+    for (NdbScanOperation.ScanFlag s : scanFlag) { 
+      flagVal = flagVal | s.type;
+    }
+    return readTuples(mode,flagVal,parallel,batch);
+  }
+  
+
+  
+  public int readTuples(NdbOperation.LockMode lock_mode, long scan_flags, long parallel,
long batch) throws NdbApiException {
+    return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_0(swigCPtr, this,
lock_mode.swigValue(), scan_flags, parallel, batch);
+  }
+
+  public int readTuples(NdbOperation.LockMode lock_mode, long scan_flags, long parallel)
throws NdbApiException {
+    return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_1(swigCPtr, this,
lock_mode.swigValue(), scan_flags, parallel);
+  }
+
+  public int readTuples(NdbOperation.LockMode lock_mode, long scan_flags) throws
NdbApiException {
+    return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_2(swigCPtr, this,
lock_mode.swigValue(), scan_flags);
   }
 
   public int readTuples(NdbOperation.LockMode lock_mode) throws NdbApiException {
@@ -53,6 +70,18 @@
     return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_4(swigCPtr, this);
   }
 
+  public int readTuples(int parallell) throws NdbApiException {
+    return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_5(swigCPtr, this, parallell);
+  }
+
+  public int readTuplesExclusive(int parallell) throws NdbApiException {
+    return ndbjJNI.NdbScanOperationImpl_readTuplesExclusive__SWIG_0(swigCPtr, this,
parallell);
+  }
+
+  public int readTuplesExclusive() throws NdbApiException {
+    return ndbjJNI.NdbScanOperationImpl_readTuplesExclusive__SWIG_1(swigCPtr, this);
+  }
+
   public int nextResult(boolean fetchAllowed, boolean forceSend) throws NdbApiException {
     return ndbjJNI.NdbScanOperationImpl_nextResult__SWIG_0(swigCPtr, this, fetchAllowed,
forceSend);
   }

=== modified file 'java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java'
--- a/java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java	2007-09-30
21:21:46 +0000
+++ b/java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java	2007-10-01
06:12:42 +0000
@@ -214,7 +214,7 @@
 		    NdbScanOperation op_a = trans.getNdbScanOperation("ndbj_join_a");
 			
 		    // TODO: readTuples needs work
-		   
op_a.readTuples(NdbOperation.LockMode.LM_CommittedRead,NdbScanOperation.ScanFlag.TUPLE_SCAN,0,0);
+		   
op_a.readTuples(NdbOperation.LockMode.LM_CommittedRead,NdbScanOperation.ScanFlag.TUPLE_SCAN.type,0,0);
 			op_a.getValue("id");
 			NdbResultSet rs_a = op_a.resultData();
 
@@ -240,7 +240,7 @@
 				 * on the primary key. We need to specify how we want to lock the row. Here we say
LM_CommittedRead - read the
 				 * last committed values for the row.columnId
 				 */
-				op_b.readTuples(NdbOperation.LockMode.LM_CommittedRead,NdbScanOperation.ScanFlag.DESCENDING,0,0);
+				op_b.readTuples(NdbOperation.LockMode.LM_CommittedRead,NdbScanOperation.ScanFlag.DESCENDING.type,0,0);
 				
 				/**
 				 * Here we have a multi-part primary key, and we call equal() on both parts of the
primary key. 

=== modified file 'java/com/mysql/cluster/ndbj/examples/PrimaryKeyBatchOps.java'
--- a/java/com/mysql/cluster/ndbj/examples/PrimaryKeyBatchOps.java	2007-09-17 01:09:47
+0000
+++ b/java/com/mysql/cluster/ndbj/examples/PrimaryKeyBatchOps.java	2007-10-01 06:12:42
+0000
@@ -9,7 +9,6 @@
 import com.mysql.cluster.ndbj.NdbClusterConnectionPermanentException;
 import com.mysql.cluster.ndbj.NdbFactory;
 import com.mysql.cluster.ndbj.NdbOperation;
-import com.mysql.cluster.ndbj.NdbOperationRef;
 import com.mysql.cluster.ndbj.NdbResultSet;
 import com.mysql.cluster.ndbj.NdbTransaction;
 

=== modified file 'java/com/mysql/cluster/ndbj/examples/PrimaryKeyOpBlob.java'
--- a/java/com/mysql/cluster/ndbj/examples/PrimaryKeyOpBlob.java	2007-09-17 01:09:47 +0000
+++ b/java/com/mysql/cluster/ndbj/examples/PrimaryKeyOpBlob.java	2007-10-01 06:12:42 +0000
@@ -7,7 +7,6 @@
 import com.mysql.cluster.ndbj.NdbClusterConnectionPermanentException;
 import com.mysql.cluster.ndbj.NdbFactory;
 import com.mysql.cluster.ndbj.NdbOperation;
-import com.mysql.cluster.ndbj.NdbOperationRef;
 import com.mysql.cluster.ndbj.NdbResultSet;
 import com.mysql.cluster.ndbj.NdbTransaction;
 

=== modified file 'java/com/mysql/cluster/ndbj/examples/ReadRowsUsingTableScan.java'
--- a/java/com/mysql/cluster/ndbj/examples/ReadRowsUsingTableScan.java	2007-09-17 01:09:47
+0000
+++ b/java/com/mysql/cluster/ndbj/examples/ReadRowsUsingTableScan.java	2007-10-01 06:12:42
+0000
@@ -6,7 +6,6 @@
 import com.mysql.cluster.ndbj.NdbClusterConnectionPermanentException;
 import com.mysql.cluster.ndbj.NdbFactory;
 import com.mysql.cluster.ndbj.NdbOperation;
-import com.mysql.cluster.ndbj.NdbOperationRef;
 import com.mysql.cluster.ndbj.NdbResultSet;
 import com.mysql.cluster.ndbj.NdbScanOperation;
 import com.mysql.cluster.ndbj.NdbTransaction;

=== modified file 'java/com/mysql/cluster/ndbj/examples/ReadUsingOrderedIndexOnPK.java'
--- a/java/com/mysql/cluster/ndbj/examples/ReadUsingOrderedIndexOnPK.java	2007-09-17
01:09:47 +0000
+++ b/java/com/mysql/cluster/ndbj/examples/ReadUsingOrderedIndexOnPK.java	2007-10-01
06:12:42 +0000
@@ -7,7 +7,6 @@
 import com.mysql.cluster.ndbj.NdbFactory;
 import com.mysql.cluster.ndbj.NdbIndexScanOperation;
 import com.mysql.cluster.ndbj.NdbOperation;
-import com.mysql.cluster.ndbj.NdbOperationRef;
 import com.mysql.cluster.ndbj.NdbResultSet;
 import com.mysql.cluster.ndbj.NdbScanOperation;
 import com.mysql.cluster.ndbj.NdbTransaction;

=== modified file 'java/com/mysql/cluster/ndbj/examples/ReadUsingPrimaryKey.java'
--- a/java/com/mysql/cluster/ndbj/examples/ReadUsingPrimaryKey.java	2007-09-17 01:09:47
+0000
+++ b/java/com/mysql/cluster/ndbj/examples/ReadUsingPrimaryKey.java	2007-10-01 06:12:42
+0000
@@ -6,7 +6,6 @@
 import com.mysql.cluster.ndbj.NdbClusterConnectionPermanentException;
 import com.mysql.cluster.ndbj.NdbFactory;
 import com.mysql.cluster.ndbj.NdbOperation;
-import com.mysql.cluster.ndbj.NdbOperationRef;
 import com.mysql.cluster.ndbj.NdbResultSet;
 import com.mysql.cluster.ndbj.NdbTransaction;
 

=== modified file 'java/ndbj.i'
--- a/java/ndbj.i	2007-09-30 21:21:46 +0000
+++ b/java/ndbj.i	2007-10-01 06:12:42 +0000
@@ -468,17 +468,7 @@
 import java.math.BigInteger;
   %}
 
-%javamethodmodifiers NdbScanOperation::getNdbScanFilter "protected";
-%rename(realGetNdbScanFilter) getNdbScanFilter();
-%typemap(javacode) NdbScanOperation %{
-public NdbScanFilter getNdbScanFilter() throws NdbApiException {
-  return new NdbScanFilterImpl(this);
-}
- %}
 
-%typemap(javainterfaces) NdbScanOperation "NdbScanOperation";
-%typemap(javainterfaces) NdbIndexOperation "NdbIndexOperation";
-%typemap(javainterfaces) NdbIndexScanOperation "NdbIndexScanOperation";
 
 %javamethodmodifiers NdbOperation::getValue "protected";
 %rename(realGetValue) getValue(const char* anAttrName);
@@ -497,13 +487,46 @@
         return
NdbScanOperation.ScanFlag.swigToEnum(ndbjJNI.NdbScanOperationImpl_getScanFlag(swigCPtr,
this));
 }
 
+%typemap(javainterfaces) NdbScanOperation "NdbScanOperation";
+
+%javamethodmodifiers NdbScanOperation::getNdbScanFilter "protected";
+%rename(realGetNdbScanFilter) getNdbScanFilter();
+
+%typemap(javaimports) NdbScanOperation "import java.util.ArrayList;"
+%typemap(javacode) NdbScanOperation %{
+  
+  public NdbScanFilter getNdbScanFilter() throws NdbApiException {
+    return new NdbScanFilterImpl(this);
+  }
+
+  public int readTuples(NdbOperation.LockMode mode, NdbScanOperation.ScanFlag scanFlag,
long parallel,
+			long batch) throws NdbApiException { 
+    return readTuples(mode,scanFlag.type,parallel,batch);
+  }
+
+  public int readTuples(NdbOperation.LockMode mode,
ArrayList<NdbScanOperation.ScanFlag> scanFlag, long parallel,
+			long batch) throws NdbApiException {
+    long flagVal = 0;
+    for (NdbScanOperation.ScanFlag s : scanFlag) { 
+      flagVal = flagVal | s.type;
+    }
+    return readTuples(mode,flagVal,parallel,batch);
+  }
+  
+
+  %}
+
 %include "NdbScanOperation.i"
+
+%typemap(javainterfaces) NdbIndexOperation "NdbIndexOperation";
+
 %include "NdbIndexOperation.i"
 
 %typemap(jstype) NdbIndexScanOperation::BoundType "NdbIndexScanOperation.BoundType"
 %typemap(javaout) NdbIndexScanOperation::BoundType { 
         return
NdbIndexScanOperation.BoundType.swigToEnum(ndbjJNI.NdbIndexScanOperationImpl_getBoundType(swigCPtr,
this));
 }
+%typemap(javainterfaces) NdbIndexScanOperation "NdbIndexScanOperation";
 
 %include "NdbIndexScanOperation.i"
 

=== modified file 'java/testsuite/ndbj/NdbScanFilterTest.java'
--- a/java/testsuite/ndbj/NdbScanFilterTest.java	2007-09-30 02:06:41 +0000
+++ b/java/testsuite/ndbj/NdbScanFilterTest.java	2007-10-01 06:12:42 +0000
@@ -87,7 +87,7 @@
 	            NdbScanOperation scan = scanTrans.getNdbScanOperation(tablename);
 
 	            scan.readTuples(LockMode.LM_CommittedRead, 0, 0);
-
+ 
 	            sd.defineFiltering(scan);
 
 	            long startTime=System.currentTimeMillis();

=== modified file 'java/testsuite/ndbj/OrderedIndexScanTest.java'
--- a/java/testsuite/ndbj/OrderedIndexScanTest.java	2007-09-17 01:09:47 +0000
+++ b/java/testsuite/ndbj/OrderedIndexScanTest.java	2007-10-01 06:12:42 +0000
@@ -10,7 +10,6 @@
 import com.mysql.cluster.ndbj.AbortOption;
 import com.mysql.cluster.ndbj.ExecType;
 
-import com.mysql.cluster.ndbj.NdbOperationRef;
 
 public class OrderedIndexScanTest extends BaseNdbjTestCase {
 

=== modified file 'swig/NdbScanOperation.i'
--- a/swig/NdbScanOperation.i	2007-09-30 21:21:46 +0000
+++ b/swig/NdbScanOperation.i	2007-10-01 06:12:42 +0000
@@ -45,8 +45,17 @@
       }
   }
 
-  virtual int readTuples(LockMode lock_mode = LM_Read, 
-                 ScanFlag scan_flags = 0, Uint32 parallel = 0, Uint32 batch = 0);
+  virtual int readTuples(LockMode lock_mode=LM_Read, 
+			 Uint32 scan_flags=0, Uint32 parallel=0, Uint32 batch=0);
+
+  inline int readTuples(int parallell){
+    return readTuples(LM_Read, 0, parallell);
+  }
+  
+  inline int readTuplesExclusive(int parallell = 0){
+    return readTuples(LM_Exclusive, 0, parallell);
+  }
+
   int nextResult(bool fetchAllowed = true, bool forceSend = false);
   int deleteCurrentTuple();
   int deleteCurrentTuple(NdbTransaction* takeOverTransaction);

Thread
Rev 165: Fixed everything from merge except whereGreaterThan* methods and NdbBlob. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjm...Monty Taylor1 Oct