List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:June 25 2007 6:27pm
Subject:Rev 126: Added initial support to ndb/j wrapper for NdbEventOperation. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
View as plain text  
------------------------------------------------------------
revno: 126
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Mon 2007-06-25 13:26:16 -0500
message:
  Added initial support to ndb/j wrapper for NdbEventOperation.
  Changed wrapper functions that wanted a Uint64* to take a Uint64. Probably needs extra
work. 
added:
  java/com/mysql/cluster/ndbj/NdbEventOperation.java
ndbeventoperation.ja-20070625182612-zsu6r68jih70efaq-1
modified:
  java/com/mysql/cluster/ndbj/NdbImpl.java ndbimpl.java-20070517181935-98huwjarzuh25b30-14
  swig/Ndb.i                     ndb.i-20070228021421-qkr4cbpxymyqdrf3-1
=== added file 'java/com/mysql/cluster/ndbj/NdbEventOperation.java'
--- a/java/com/mysql/cluster/ndbj/NdbEventOperation.java	1970-01-01 00:00:00 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbEventOperation.java	2007-06-25 18:26:16 +0000
@@ -0,0 +1,196 @@
+package com.mysql.cluster.ndbj;
+
+import java.math.BigInteger;
+
+import com.mysql.cluster.ndbapi.NdbBlob;
+import com.mysql.cluster.ndbapi.NdbError;
+import com.mysql.cluster.ndbapi.NdbRecAttr;
+import com.mysql.cluster.ndbapi.NdbEvent.TableEvent;
+import com.mysql.cluster.ndbapi.NdbEventOperation.State;
+
+public class NdbEventOperation extends NdbBaseImpl {
+
+	/* (non-Javadoc)
+	 * @see com.mysql.cluster.ndbj.NdbBaseImpl#getNdbErrorRef()
+	 */
+	com.mysql.cluster.ndbapi.NdbEventOperation opRef; 
+
+	public NdbEventOperation(com.mysql.cluster.ndbapi.NdbEventOperation theOp) { 
+		this.opRef = theOp;
+	}
+	
+	public void delete() { 
+		this.opRef = null;
+	}
+	
+	@Override
+	protected NdbError getNdbErrorRef() {
+		// TODO Auto-generated method stub
+		return opRef.getNdbError();
+	}
+
+	public com.mysql.cluster.ndbapi.NdbEventOperation getOpRef() { 
+		return this.opRef;
+	}
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#execute()
+	 */
+	public int execute() {
+		return opRef.execute();
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getAnyValue()
+	 */
+	public long getAnyValue() {
+		return opRef.getAnyValue();
+	}
+
+	/**
+	 * @param anAttrName
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getBlobHandle(java.lang.String)
+	 */
+	public NdbBlob getBlobHandle(String anAttrName) {
+		return opRef.getBlobHandle(anAttrName);
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getEventType()
+	 */
+	public TableEvent getEventType() {
+		return opRef.getEventType();
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getGCI()
+	 */
+	public BigInteger getGCI() {
+		return opRef.getGCI();
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getLatestGCI()
+	 */
+	public BigInteger getLatestGCI() {
+		return opRef.getLatestGCI();
+	}
+
+
+	/**
+	 * @param anAttrName
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getPreBlobHandle(java.lang.String)
+	 */
+	public NdbBlob getPreBlobHandle(String anAttrName) {
+		return opRef.getPreBlobHandle(anAttrName);
+	}
+
+	/**
+	 * @param anAttrName
+	 * @param aValue
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getPreValue(java.lang.String,
java.lang.String)
+	 */
+	public NdbRecAttr getPreValue(String anAttrName, String aValue) {
+		return opRef.getPreValue(anAttrName, aValue);
+	}
+
+	/**
+	 * @param anAttrName
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getPreValue(java.lang.String)
+	 */
+	public NdbRecAttr getPreValue(String anAttrName) {
+		return opRef.getPreValue(anAttrName);
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getState()
+	 */
+	public State getState() {
+		return opRef.getState();
+	}
+
+	/**
+	 * @param anAttrName
+	 * @param aValue
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getValue(java.lang.String,
java.lang.String)
+	 */
+	public NdbRecAttr getValue(String anAttrName, String aValue) {
+		return opRef.getValue(anAttrName, aValue);
+	}
+
+	/**
+	 * @param anAttrName
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#getValue(java.lang.String)
+	 */
+	public NdbRecAttr getValue(String anAttrName) {
+		return opRef.getValue(anAttrName);
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#isConsistent()
+	 */
+	public boolean isConsistent() {
+		return opRef.isConsistent();
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#isOverrun()
+	 */
+	public int isOverrun() {
+		return opRef.isOverrun();
+	}
+
+	/**
+	 * @param flag
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#mergeEvents(boolean)
+	 */
+	public void mergeEvents(boolean flag) {
+		opRef.mergeEvents(flag);
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#tableFragmentationChanged()
+	 */
+	public boolean tableFragmentationChanged() {
+		return opRef.tableFragmentationChanged();
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#tableFrmChanged()
+	 */
+	public boolean tableFrmChanged() {
+		return opRef.tableFrmChanged();
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#tableNameChanged()
+	 */
+	public boolean tableNameChanged() {
+		return opRef.tableNameChanged();
+	}
+
+	/**
+	 * @return
+	 * @see com.mysql.cluster.ndbapi.NdbEventOperation#tableRangeListChanged()
+	 */
+	public boolean tableRangeListChanged() {
+		return opRef.tableRangeListChanged();
+	}
+
+}

=== modified file 'java/com/mysql/cluster/ndbj/NdbImpl.java'
--- a/java/com/mysql/cluster/ndbj/NdbImpl.java	2007-05-23 01:05:32 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbImpl.java	2007-06-25 18:26:16 +0000
@@ -4,6 +4,8 @@
 import java.util.Set;
 
 import com.mysql.cluster.errors.*;
+import com.mysql.cluster.ndbapi.SWIGTYPE_p_unsigned_int;
+import com.mysql.cluster.ndbapi.SWIGTYPE_p_unsigned_long_long;
 
 /**
  *
@@ -241,5 +243,66 @@
 	protected com.mysql.cluster.ndbapi.NdbError getNdbErrorRef() { 
 		return ndbRef.getNdbError();
 	}
+
+	/**
+	 * @param eventName
+	 * @return
+	 * @throws NdbApiException
+	 * @see com.mysql.cluster.ndbapi.Ndb#createEventOperation(java.lang.String)
+	 */
+	public NdbEventOperation createEventOperation(String eventName) throws NdbApiException {
+		return new NdbEventOperation(ndbRef.createEventOperation(eventName));
+	}
+
+	/**
+	 * @param eventOp
+	 * @return
+	 * @throws NdbApiException
+	 * @see
com.mysql.cluster.ndbapi.Ndb#dropEventOperation(com.mysql.cluster.ndbapi.NdbEventOperation)
+	 */
+	public int dropEventOperation(NdbEventOperation eventOp) throws NdbApiException {
+		return ndbRef.dropEventOperation(eventOp.getOpRef());
+	}
+
+	/**
+	 * @param iter
+	 * @param event_types
+	 * @return
+	 * @throws NdbApiException
+	 * @see
com.mysql.cluster.ndbapi.Ndb#getGCIEventOperations(com.mysql.cluster.ndbapi.SWIGTYPE_p_unsigned_int,
com.mysql.cluster.ndbapi.SWIGTYPE_p_unsigned_int)
+	 */
+	public NdbEventOperation getGCIEventOperations(long iter, long event_types) throws
NdbApiException {
+		return new NdbEventOperation(ndbRef.getGCIEventOperations(iter, event_types));
+	}
+
+	/**
+	 * @return
+	 * @throws NdbApiException
+	 * @see com.mysql.cluster.ndbapi.Ndb#nextEvent()
+	 */
+	public NdbEventOperation nextEvent() throws NdbApiException {
+		return new NdbEventOperation(ndbRef.nextEvent());
+	}
+
+	/**
+	 * @param aMillisecondNumber
+	 * @param latestGCI
+	 * @return
+	 * @throws NdbApiException
+	 * @see com.mysql.cluster.ndbapi.Ndb#pollEvents(int,
com.mysql.cluster.ndbapi.SWIGTYPE_p_unsigned_long_long)
+	 */
+	public int pollEvents(int aMillisecondNumber, java.math.BigInteger latestGCI) throws
NdbApiException {
+		return ndbRef.pollEvents(aMillisecondNumber, latestGCI);
+	}
+
+	/**
+	 * @param aMillisecondNumber
+	 * @return
+	 * @throws NdbApiException
+	 * @see com.mysql.cluster.ndbapi.Ndb#pollEvents(int)
+	 */
+	public int pollEvents(int aMillisecondNumber) throws NdbApiException {
+		return ndbRef.pollEvents(aMillisecondNumber);
+	}
 	
 }

=== modified file 'swig/Ndb.i'
--- a/swig/Ndb.i	2007-05-25 00:08:44 +0000
+++ b/swig/Ndb.i	2007-06-25 18:26:16 +0000
@@ -80,10 +80,33 @@
                             Uint64 & OUTPUT, Uint32 cacheSize);
 
   class NdbDictDictionary* getDictionary();
+
+/* Events */
+
+  NdbEventOperation* createEventOperation(const char* eventName);
+  int dropEventOperation(NdbEventOperation* eventOp);
+
+//  int pollEvents(int aMillisecondNumber, Uint64 *latestGCI= 0);
+
+  NdbEventOperation *nextEvent();
+//  const NdbEventOperation*
+//    getGCIEventOperations(Uint32* iter, Uint32* event_types);
+
+
+
 };     
 
 %extend Ndb {
 public:
+  int pollEvents(int aMillisecondNumber, Uint64 latestGCI=0) { 
+    return self->pollEvents(aMillisecondNumber,&latestGCI);
+
+  }
+  const NdbEventOperation*
+    getGCIEventOperations(Uint32 iter, Uint32 event_types) {
+    return self->getGCIEventOperations(&iter,&event_types);
+  }
+
   NdbTransaction* startTransaction(const char* aTableName, 
                                    const char *keyData) {
     const NdbDictDictionary *myDict = self->getDictionary();

Thread
Rev 126: Added initial support to ndb/j wrapper for NdbEventOperation. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmergeMonty Taylor25 Jun