List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:October 31 2007 3:27pm
Subject:Rev 203: Fixed the dist key selection code for telco-6.3 branch. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3

------------------------------------------------------------
revno: 203
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: telco-6.3
timestamp: Wed 2007-10-31 15:27:30 +0000
message:
  Fixed the dist key selection code for telco-6.3 branch.
modified:
  java/com/mysql/cluster/ndbj/Ndb.java ndb.java-20070517181935-98huwjarzuh25b30-2
  swig/Ndb.i                     ndb.i-20070228021421-qkr4cbpxymyqdrf3-1
=== modified file 'java/com/mysql/cluster/ndbj/Ndb.java'
--- a/java/com/mysql/cluster/ndbj/Ndb.java	2007-10-29 17:51:35 +0000
+++ b/java/com/mysql/cluster/ndbj/Ndb.java	2007-10-31 15:27:30 +0000
@@ -116,12 +116,8 @@
 
 	public int dropEventOperation(NdbEventOperationImpl eventOp) throws NdbApiException;
 
-	public NdbTransaction startTransaction(NdbTable table, String keyData) throws
NdbApiException;
-
 	public NdbEventOperation createEventOperation(String eventName) throws NdbApiException;
 
-	public NdbTransaction startTransaction(NdbTable table, int keyData) throws
NdbApiException;
-
 	public java.math.BigInteger getAutoIncrementValue(NdbTable myTable, long cacheSize)
throws NdbApiException;
 
 	public int sendPollNdb(int aMillisecondNumber, int minNoOfEventsToWakeup, int forceSend)
throws NdbApiException;
@@ -142,4 +138,12 @@
 
 	public int pollNdb() throws NdbApiException;
 
+	public NdbTransactionImpl startTransaction(String aTableName, short keyData) throws
NdbApiException;
+
+	public NdbTransactionImpl startTransaction(NdbTable table, String anInputString) throws
NdbApiException;
+
+	public NdbTransactionImpl startTransaction(NdbTable table, short keyData) throws
NdbApiException;
+
+	public NdbTransactionImpl startTransaction(NdbTable table, int keyData) throws
NdbApiException;
+
 }
\ No newline at end of file

=== modified file 'swig/Ndb.i'
--- a/swig/Ndb.i	2007-10-29 17:51:35 +0000
+++ b/swig/Ndb.i	2007-10-31 15:27:30 +0000
@@ -66,12 +66,10 @@
 	NDB_exception(NdbApiException,err.message);
       }
   }
-  NdbTransaction* startTransaction(const NdbDictTable *table= 0,
-                                   const char  *keyData = 0, 
-                                   Uint32       keyLen = 0);
 
   class NdbDictDictionary* getDictionary();
   NdbEventOperation* createEventOperation(const char* eventName);
+
 //  const NdbEventOperation*
 //    getGCIEventOperations(Uint32* iter, Uint32* event_types);
 
@@ -159,20 +157,78 @@
   }
 
   NdbTransaction* startTransaction(const char* aTableName, 
-                                   const char *keyData) {
-    const NdbDictDictionary *myDict = self->getDictionary();
-    const NdbDictTable *myTable = myDict->getTable(aTableName);
-    return self->startTransaction(myTable,keyData);
-  }
-  NdbTransaction* startTransaction(const char* aTableName, 
-                                   int keyData) {
-    const NdbDictDictionary *myDict = self->getDictionary();
-    const NdbDictTable *myTable = myDict->getTable(aTableName);
-    return self->startTransaction(myTable,(const char *) &keyData);
-  }
-  NdbTransaction* startTransaction(const NdbDictTable* table, 
-                                   int keyData) {
-    return self->startTransaction(table,(const char *) &keyData);
+                                   const char * anInputString, size_t len) {
+    const NdbDictDictionary *myDict = self->getDictionary();
+    const NdbDictTable *myTable = myDict->getTable(aTableName);
+    
+    Ndb::Key_part_ptr keys[2];
+    keys[0].ptr=(const void*)anInputString;
+    keys[0].len=len;
+    keys[1].ptr=NULL;
+    keys[1].len=0; 
+    return self->startTransaction(myTable,keys);
+  }
+  NdbTransaction* startTransaction(const char* aTableName, 
+                                   short keyData) {    
+    const NdbDictDictionary *myDict = self->getDictionary();
+    const NdbDictTable *myTable = myDict->getTable(aTableName);
+
+    Ndb::Key_part_ptr keys[2];
+    keys[0].ptr=(const void*)&keyData;
+    keys[0].len=sizeof(keyData);
+    keys[1].ptr=NULL;
+    keys[1].len=0; 
+
+    return self->startTransaction(myTable,keys);
+  }
+  NdbTransaction* startTransaction(const char* aTableName, 
+                                   int keyData) {
+    const NdbDictDictionary *myDict = self->getDictionary();
+    const NdbDictTable *myTable = myDict->getTable(aTableName);
+
+    Ndb::Key_part_ptr keys[2];
+    keys[0].ptr=(const void*)&keyData;
+    keys[0].len=sizeof(keyData);
+    keys[1].ptr=NULL;
+    keys[1].len=0; 
+
+    return self->startTransaction(myTable,keys);
+  }
+  NdbTransaction* startTransaction(const NdbDictTable* table, 
+                                   const char * anInputString, size_t len) {
+    
+    Ndb::Key_part_ptr keys[2];
+    keys[0].ptr=(const void*)anInputString;
+    keys[0].len=len;
+    keys[1].ptr=NULL;
+    keys[1].len=0; 
+    return self->startTransaction(table,keys);
+  }
+  NdbTransaction* startTransaction(const NdbDictTable* table, 
+                                   short keyData) {    
+
+    Ndb::Key_part_ptr keys[2];
+    keys[0].ptr=(const void*)&keyData;
+    keys[0].len=sizeof(keyData);
+    keys[1].ptr=NULL;
+    keys[1].len=0; 
+
+    return self->startTransaction(table,keys);
+  }
+  NdbTransaction* startTransaction(const NdbDictTable* table, 
+                                   int keyData) {
+
+    Ndb::Key_part_ptr keys[2];
+    keys[0].ptr=(const void*)&keyData;
+    keys[0].len=sizeof(keyData);
+    keys[1].ptr=NULL;
+    keys[1].len=0; 
+
+    return self->startTransaction(table,keys);
+  }
+
+  NdbTransaction* startTransaction() { 
+    return self->startTransaction(); 
   }
 
   %ndbnoexception; 

Thread
Rev 203: Fixed the dist key selection code for telco-6.3 branch. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3Monty Taylor31 Oct