|
|||||||||||
|
Rev 162: Split interpreted program instructions into an interface. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
From: Monty Taylor <mtaylor(at)mysql.com>
Date: Sat Sep 29 2007 - 22:40:29 EDT
revno: 162 revision-id: mtaylor@mysql.com-20070930023945-xs3411hjls3zhvs6 parent: mtaylor@mysql.com-20070930020641-vck8d8lywo21mjbt committer: Monty Taylor <mtaylor@mysql.com> branch nick: ndbjmerge timestamp: Sat 2007-09-29 19:39:45 -0700 message: Split interpreted program instructions into an interface. Renamed all interpred program instructions. Migrated all old exception declarations to ndbexception. added: java/com/mysql/cluster/ndbj/NdbInterpretedOperation.java ndbinterpretedoperat-20070930023903-6bxvuqq341exc9er-1 java/com/mysql/cluster/ndbj/NdbOperationResults.java ndboperationresults.-20070930023920-gzlkrx1c10i1d6bl-1 modified: java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java ndbbaseoperationequa-20070517181935-98huwjarzuh25b30-6 java/com/mysql/cluster/ndbj/examples/CRUDandScan.java crudandscan.java-20070517181935-98huwjarzuh25b30-32 java/ndbj.i ndbj.i-20070913223244-5938mztpztyn9sry-1 swig/NdbClusterConnection.i ndb_cluster_connecti-20070228021421-qkr4cbpxymyqdrf3-6 swig/NdbIndexOperation.i ndbindexoperation.i-20070426125056-cdc2fzutv5osp12a-1 swig/NdbIndexScanOperation.i ndbindexscanoperatio-20070426125039-esztodu0kcqbofgn-1 swig/NdbOperation.i ndboperation.i-20070228021421-qkr4cbpxymyqdrf3-3 swig/NdbScanOperation.i ndbscanoperation.i-20070228021421-qkr4cbpxymyqdrf3-5 === added file 'java/com/mysql/cluster/ndbj/NdbInterpretedOperation.java' --- a/java/com/mysql/cluster/ndbj/NdbInterpretedOperation.java 1970-01-01 00:00:00 +0000@@ -0,0 +1,139 @@ +package com.mysql.cluster.ndbj; + +public interface NdbInterpretedOperation { + + public abstract int incValueLong(String anAttrName, long aValue) + throws NdbApiException; + + public abstract int incValueLong(long anAttrId, long aValue) + throws NdbApiException; + + public abstract int incValueUlong(String anAttrName, + java.math.BigInteger aValue) throws NdbApiException; + + public abstract int incValueUlong(long anAttrId, java.math.BigInteger aValue) + throws NdbApiException; + + public abstract int subValueLong(String anAttrName, long aValue) + throws NdbApiException; + + public abstract int subValueUlong(String anAttrName, + java.math.BigInteger aValue) throws NdbApiException; + + public abstract int subValueLong(long anAttrId, long aValue) + throws NdbApiException; + + public abstract int subValueUlong(long anAttrId, java.math.BigInteger aValue) + throws NdbApiException; + + public abstract int defLabel(int labelNumber) throws NdbApiException; + + public abstract int addReg(long RegSource1, long RegSource2, long RegDest) + throws NdbApiException; + + public abstract int subReg(long RegSource1, long RegSource2, long RegDest) + throws NdbApiException; + + public abstract int loadConstU32(long RegDest, long Constant) + throws NdbApiException; + + public abstract int loadConstU64(long RegDest, java.math.BigInteger Constant) + throws NdbApiException; + + public abstract int loadConstNull(long RegDest) throws NdbApiException; + + public abstract int readAttr(String anAttrName, long RegDest) + throws NdbApiException; + + public abstract int writeAttr(String anAttrName, long RegSource) + throws NdbApiException; + + public abstract int readAttr(long anAttrId, long RegDest) + throws NdbApiException; + + public abstract int writeAttr(long anAttrId, long RegSource) + throws NdbApiException; + + public abstract int branchGe(long RegLvalue, long RegRvalue, long Label) + throws NdbApiException; + + public abstract int branchGt(long RegLvalue, long RegRvalue, long Label) + throws NdbApiException; + + public abstract int branchLe(long RegLvalue, long RegRvalue, long Label) + throws NdbApiException; + + public abstract int branchLt(long RegLvalue, long RegRvalue, long Label) + throws NdbApiException; + + public abstract int branchEq(long RegLvalue, long RegRvalue, long Label) + throws NdbApiException; + + public abstract int branchNe(long RegLvalue, long RegRvalue, long Label) + throws NdbApiException; + + public abstract int branchNeNull(long RegLvalue, long Label) + throws NdbApiException; + + public abstract int branchEqNull(long RegLvalue, long Label) + throws NdbApiException; + + public abstract int branchLabel(long Label) throws NdbApiException; + + public abstract int branchColEqNull(long ColId, long Label) + throws NdbApiException; + + public abstract int branchColNeNull(long ColId, long Label) + throws NdbApiException; + + public abstract int interpretExitOk() throws NdbApiException; + + public abstract int interpretExitNok(long ErrorCode) throws NdbApiException; + + public abstract int interpretExitNok() throws NdbApiException; + + public abstract int interpretExitLastRow() throws NdbApiException; + + public abstract int defSubroutine(int SubroutineNumber) + throws NdbApiException; + + public abstract int callSub(long Subroutine) throws NdbApiException; + + public abstract int retSub() throws NdbApiException; + + public abstract int interpretedUpdateTuple() throws NdbApiException; + + public abstract int interpretedDeleteTuple() throws NdbApiException; + + public abstract int branchColEq(long ColId, long val, long len, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColNe(long ColId, long val, long len, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColLt(long ColId, long val, long len, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColLe(long ColId, long val, long len, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColGt(long ColId, long val, long len, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColGe(long ColId, long val, long len, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColLikeString(long ColId, String anInputString, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColNotLikeString(long ColId, + String anInputString, boolean nopad, long Label) + throws NdbApiException; + + public abstract int branchColLikeBytes(long ColId, byte[] BYTE, + boolean nopad, long Label) throws NdbApiException; + + public abstract int branchColNotLikeBytes(long ColId, byte[] BYTE, + boolean nopad, long Label) throws NdbApiException; + +} \ No newline at end of file
/**
*
@@ -153,7 +153,7 @@
* @throws NdbApiException if there was a problem in the cluster when trying to find tuples using this column.
* @throws NdbApiRuntimeException If a bad columnName is entered
*/
- public int equalBigInteger(long columnId, BigInteger val) throws NdbApiException;
@@ -9,7 +9,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/ndbj.i' --- a/java/ndbj.i 2007-09-30 02:06:41 +0000@@ -347,7 +347,7 @@
}
-%typemap(javainterfaces) NdbOperation "NdbOperation"; +%typemap(javainterfaces) NdbOperation "NdbOperation,NdbInterpretedOperation"; %typemap(javabase) NdbOperation "NdbOperationResultsImpl"; %javamethodmodifiers NdbScanOperation::getNdbScanFilter "protected";
+// Need to do this here so it doesn't get overridden
-#if defined(SWIGJAVA)
- %javaexception("NdbApiException") {
-#else
- %exception { // this applies to everything until we clear it
-#endif
@@ -40,11 +36,7 @@
int interpretedUpdateTuple();
-#if defined(SWIGJAVA)
- %javaexception("NdbApiException") {
-#else
- %exception { // this applies to everything until we clear it
-#endif
};
-#if defined(SWIG_JAVA)
- int setBoundBigInteger(const char* anAttrName, BoundType type,const Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(anAttrName,type,(void *) &value);
- };
- int setBoundBigInteger(Uint32 anAttrId, BoundType type, const Uint64 val) {
- Uint64 value = (Uint64)val;
- return self->setBound(anAttrId,type,(void *) &value);
- };
-#else
int setBoundUlong(const char* anAttrName, BoundType type,const Uint64 val) {
Uint64 value = (Uint64)val;
return self->setBound(anAttrName,type,(void *) &value);
@@ -120,7 +110,6 @@
Uint64 value = (Uint64)val;
return self->setBound(anAttrId,type,(void *) &value);
};
-#endif int setBoundDouble(const char* anAttrName, BoundType type,const double val) {
double value = (double)val;
return self->setBound(anAttrName,type,(void *) &value);
=== modified file 'swig/NdbOperation.i'
--- a/swig/NdbOperation.i 2007-09-30 02:06:41 +0000
@@ -240,13 +240,9 @@
int equal(const char* anAttrName, Int64 aValue); int equal(Uint32 anAttrId, Int64 aValue); -#if defined(SWIGJAVA) - %rename(equalBigInteger) equal(const char *, Uint64); - %rename(equalBigInteger) equal(Uint32, Uint64); -#else
%rename(equalUlong) equal(const char *, Uint64);
%rename(equalUlong) equal(Uint32, Uint64);
-#endif
int equal(const char* anAttrName, Uint64 aValue); int equal(Uint32 anAttrId, Uint64 aValue); @@ -260,23 +256,51 @@ /* Interpreted Program Support */ -#if defined(SWIGPYTHON) || defined(SWIGPERL) - %rename(incValue64) incValue(const char*, Uint64); - %rename(subValue64) subValue(const char*, Uint64); - %rename(incValue64) incValue(Uint32, Uint64); - %rename(subValue64) subValue(Uint32, Uint64); +#if !defined(SWIG_RUBY_AUTORENAME) + %rename(incValueLong) incValue(const char*, Uint32); + %rename(incValueLong) incValue(Uint32, Uint32); + %rename(incValueUlong) incValue(const char*, Uint64); + %rename(incValueUlong) incValue(Uint32, Uint64); + + %rename(subValueLong) subValue(const char*, Uint32); + %rename(subValueLong) subValue(Uint32, Uint32); + %rename(subValueUlong) subValue(const char*, Uint64); + %rename(subValueUlong) subValue(Uint32, Uint64); #endif - int incValue(const char* anAttrName, Uint32 aValue); int subValue(const char* anAttrName, Uint32 aValue); -// int subValue(const char* anAttrName, Uint64 aValue); - int subValue(Uint32 anAttrId, Uint32 aValue); -// int subValue(Uint32 anAttrId, Uint64 aValue);+ int subValue(Uint32 anAttrId, Uint32 aValue); + int subValue(Uint32 anAttrId, Uint64 aValue); + +#if !defined(SWIG_RUBY_AUTORENAME) + %rename(defLabel) def_label(int labelNumber); + %rename(addReg) add_reg(Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest); + %rename(subReg) sub_reg(Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest); + %rename(loadConstU32) load_const_u32(Uint32 RegDest, Uint32 Constant); + %rename(loadConstU64) load_const_u64(Uint32 RegDest, Uint64 Constant); + %rename(loadConstNull) load_const_null(Uint32 RegDest); + %rename(readAttr) read_attr(const char* anAttrName, Uint32 RegDest); + %rename(writeAttr) write_attr(const char* anAttrName, Uint32 RegSource); + %rename(readAttr) read_attr(Uint32 anAttrId, Uint32 RegDest); + %rename(writeAttr) write_attr(Uint32 anAttrId, Uint32 RegSource); + %rename(branchGe) branch_ge(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label); + %rename(branchGt) branch_gt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label); + %rename(branchLe) branch_le(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label); + %rename(branchLt) branch_lt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label); + %rename(branchEq) branch_eq(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label); + %rename(branchNe) branch_ne(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label); + %rename(branchNeNull) branch_ne_null(Uint32 RegLvalue, Uint32 Label); + %rename(branchEqNull) branch_eq_null(Uint32 RegLvalue, Uint32 Label); + %rename(branchLabel) branch_label(Uint32 Label); + %rename(branchColEqNull) branch_col_eq_null(Uint32 ColId, Uint32 Label); + %rename(branchColNeNull) branch_col_ne_null(Uint32 ColId, Uint32 Label); +#endif
int def_label(int labelNumber);
int branch_label(Uint32 Label); int branch_col_eq_null(Uint32 ColId, Uint32 Label); int branch_col_ne_null(Uint32 ColId, Uint32 Label); -/* int branch_col_eq(Uint32 ColId, const void * val, Uint32 len, - bool nopad, Uint32 Label); - int branch_col_ne(Uint32 ColId, const void * val, Uint32 len, - bool nopad, Uint32 Label); - int branch_col_lt(Uint32 ColId, const void * val, Uint32 len, - bool nopad, Uint32 Label); - int branch_col_le(Uint32 ColId, const void * val, Uint32 len, - bool nopad, Uint32 Label); - int branch_col_gt(Uint32 ColId, const void * val, Uint32 len, - bool nopad, Uint32 Label); - int branch_col_ge(Uint32 ColId, const void * val, Uint32 len, - bool nopad, Uint32 Label); - int branch_col_like(Uint32 ColId, const void *, Uint32 len, - bool nopad, Uint32 Label);- int branch_col_notlike(Uint32 ColId, const void *, Uint32 len, - bool nopad, Uint32 Label);*/ + +#if !defined(SWIG_RUBY_AUTORENAME) + %rename(interpretExitOk) interpret_exit_ok(); + %rename(interpretExitNok) interpret_exit_nok(Uint32); + %rename(interpretExitNok) interpret_exit_nok(); + %rename(interpretExitLastRow) interpret_exit_last_row(); + %rename(defSubroutine) def_subroutine(int); + %rename(callSub) call_sub(Uint32); + %rename(retSub) ret_sub(); +#endif + int interpret_exit_ok(); int interpret_exit_nok(Uint32 ErrorCode); int interpret_exit_nok(); @@ -329,11 +348,12 @@ %ndbnoexception;
-
%extend NdbOperation {
%ndbexception("NdbApiException") {
}
public:
-#if defined(SWIGJAVA)
- %javaexception("NdbApiException") {
-#else
- %exception { // this applies to everything until we clear it
-#endif
@@ -48,11 +44,7 @@
-#if defined(SWIGJAVA)
- %javaexception("NdbApiException") {
-#else
- %exception { // this applies to everything until we clear it
-#endif
@@ -67,12 +59,7 @@
NdbOperation* updateCurrentTuple();
-#if defined(SWIGJAVA) - %nojavaexception; -#else - %noexception; -#endif - + %ndbnoexception; const NdbError & getNdbError() const; -- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Sun Sep 30 02:29:07 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:45:39 EDT |
||||||||||
|
|||||||||||