List:Commits« Previous MessageNext Message »
From:Craig L Russell Date:June 9 2011 10:58pm
Subject:bzr commit into mysql-5.1-telco-7.1 branch (Craig.Russell:4241)
View as plain text  
#At file:///Users/clr/ndb/bzr-repo/mysql-5.1-telco-7.1/ based on revid:craig.russell@stripped

 4241 Craig L Russell	2011-06-09
      Change field handling to only send modified fields to the database
      Add default to dn2id table
      Remember the number of fields during initialization of value handlers

    modified:
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/InvocationHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/KeyValueHandlerImpl.java
      storage/ndb/clusterj/clusterj-test/src/main/resources/schema.sql
=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java	2011-02-02 09:52:33 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java	2011-06-09 22:56:27 +0000
@@ -256,7 +256,9 @@ public abstract class AbstractDomainType
 
     public void operationSetNonPKValues(ValueHandler handler, Operation op) {
         for (DomainFieldHandler fmd: nonPKFieldHandlers) {
-            fmd.operationSetValue(handler, op);
+            if (handler.isModified(fmd.getFieldNumber())) {
+                fmd.operationSetValue(handler, op);
+            }
         }
     }
 

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/InvocationHandlerImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/InvocationHandlerImpl.java	2011-02-06 21:37:05 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/InvocationHandlerImpl.java	2011-06-09 22:56:27 +0000
@@ -56,6 +56,9 @@ public class InvocationHandlerImpl<T> im
     /** The properties of the instance. */
     protected Object[] properties;
 
+    /** The number of fields */
+    protected int numberOfFields;
+
     /** The types of the properties. */
     protected Map<String, Class<?>> typemap = new HashMap<String, Class<?>>();
 
@@ -79,7 +82,7 @@ public class InvocationHandlerImpl<T> im
 
     public InvocationHandlerImpl(DomainTypeHandlerImpl<T> domainTypeHandler) {
         this.domainTypeHandler = domainTypeHandler;
-        int numberOfFields = domainTypeHandler.getNumberOfFields();
+        numberOfFields = domainTypeHandler.getNumberOfFields();
         properties = new Object[numberOfFields];
         modifiedFields = new BitSet(numberOfFields);
         domainTypeHandler.initializeNotPersistentFields(this);

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/KeyValueHandlerImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/KeyValueHandlerImpl.java	2011-02-06 21:37:05 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/KeyValueHandlerImpl.java	2011-06-09 22:56:27 +0000
@@ -40,8 +40,12 @@ public class KeyValueHandlerImpl impleme
 
     private Object[] values;
 
+    /** The number of fields */
+    private int numberOfFields;
+    
     public KeyValueHandlerImpl(Object[] keyValues) {
         this.values = keyValues;
+        this.numberOfFields = keyValues.length;
         if (logger.isDetailEnabled()) {
             StringBuffer buffer = new StringBuffer();
             for (int i = 0; i < values.length; ++i) {

=== modified file 'storage/ndb/clusterj/clusterj-test/src/main/resources/schema.sql'
--- a/storage/ndb/clusterj/clusterj-test/src/main/resources/schema.sql	2011-03-22 01:48:09 +0000
+++ b/storage/ndb/clusterj/clusterj-test/src/main/resources/schema.sql	2011-06-09 22:56:27 +0000
@@ -367,7 +367,7 @@ drop table if exists dn2id;
 create table dn2id (
  eid bigint(20) unsigned NOT NULL,
  object_classes varchar(100) NOT NULL,
- x_object_classes varchar(100) NOT NULL,
+ x_object_classes varchar(100) NOT NULL DEFAULT '',
  a0 varchar(128) NOT NULL DEFAULT '',
  a1 varchar(128) NOT NULL DEFAULT '',
  a2 varchar(128) NOT NULL DEFAULT '',


Attachment: [text/bzr-bundle] bzr/craig.russell@oracle.com-20110609225627-s3qxv1iao3jaq040.bundle
Thread
bzr commit into mysql-5.1-telco-7.1 branch (Craig.Russell:4241)Craig L Russell10 Jun