gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject svn commit: r1556830 - in /gora/branches/GORA_94: gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/ gora-core/src/examples/avro/ gora-core/src/examples/java/org/apache/gora/examples/ gora-core/src/examples/java/org/apache/gora/example...
Date Thu, 09 Jan 2014 15:17:02 GMT
Author: lewismc
Date: Thu Jan  9 15:17:01 2014
New Revision: 1556830

URL: http://svn.apache.org/r1556830
Log:
commit for GORA-94v10.patch

Modified:
    gora/branches/GORA_94/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm
    gora/branches/GORA_94/gora-core/src/examples/avro/employee.json
    gora/branches/GORA_94/gora-core/src/examples/avro/immutable_fields.json
    gora/branches/GORA_94/gora-core/src/examples/avro/tokendatum.json
    gora/branches/GORA_94/gora-core/src/examples/avro/webpage.json
    gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
    gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java
    gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/ImmutableFields.java
    gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Metadata.java
    gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/TokenDatum.java
    gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/V2.java
    gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/WebPage.java
    gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java
    gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java
    gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java
    gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/mock/persistency/MockPersistent.java
    gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
    gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
    gora/branches/GORA_94/gora-tutorial/src/main/avro/metricdatum.json
    gora/branches/GORA_94/gora-tutorial/src/main/avro/pageview.json
    gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java
    gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java

Modified: gora/branches/GORA_94/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm (original)
+++ gora/branches/GORA_94/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm Thu Jan  9 15:17:01 2014
@@ -16,7 +16,7 @@
 ## limitations under the License.
 ##
 #if ($schema.getNamespace())
-package $schema.getNamespace();  
+package $schema.getNamespace();
 #end
 @SuppressWarnings("all")
 #if ($schema.getDoc())
@@ -35,7 +35,7 @@ public class ${this.mangle($schema.getNa
   public ${this.mangle($schema.getName())}() {
     super();
   }
-  
+
   public ${this.mangle($schema.getName())}(Object value) {
     super(value);
   }
@@ -50,7 +50,7 @@ public class ${this.mangle($schema.getNa
 
 #end
   public org.apache.avro.Schema getSchema() { return SCHEMA$; }
-  // Used by DatumWriter.  Applications should not call. 
+  // Used by DatumWriter.  Applications should not call.
   public java.lang.Object get(int field$) {
     switch (field$) {
 #set ($i = 0)
@@ -61,8 +61,8 @@ public class ${this.mangle($schema.getNa
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
-  
-  // Used by DatumReader.  Applications should not call. 
+
+  // Used by DatumReader.  Applications should not call.
   @SuppressWarnings(value="unchecked")
   public void put(int field$, java.lang.Object value) {
     switch (field$) {
@@ -94,7 +94,7 @@ public class ${this.mangle($schema.getNa
     this.${this.mangle($field.name(), $schema.isError())} = ${this.generateAppropriateWrapperOrValue($field.schema())};
     setDirty(${field.pos()});
   }
-  
+
   /**
    * Checks the dirty status of the '${this.mangle($field.name(), $schema.isError())}' field. A field is dirty if it represents a change that has not yet been written to the database.
 #if ($field.doc())   * $field.doc()#end
@@ -110,17 +110,17 @@ public class ${this.mangle($schema.getNa
   public static #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder newBuilder() {
     return new #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder();
   }
-  
+
   /** Creates a new ${this.mangle($schema.getName())} RecordBuilder by copying an existing Builder */
   public static #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder newBuilder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder other) {
     return new #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder(other);
   }
-  
+
   /** Creates a new ${this.mangle($schema.getName())} RecordBuilder by copying an existing $this.mangle($schema.getName()) instance */
   public static #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder newBuilder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())} other) {
     return new #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder(other);
   }
-  
+
   private static java.nio.ByteBuffer deepCopyToWriteOnlyBuffer(
       java.nio.ByteBuffer input) {
     java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity());
@@ -143,7 +143,7 @@ public class ${this.mangle($schema.getNa
     copy.limit(limit);
     return copy.asReadOnlyBuffer();
   }
-  
+
   /**
    * RecordBuilder for ${this.mangle($schema.getName())} instances.
    */
@@ -159,12 +159,12 @@ public class ${this.mangle($schema.getNa
     private Builder() {
       super(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.SCHEMA$);
     }
-    
+
     /** Creates a Builder by copying an existing Builder */
     private Builder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder other) {
       super(other);
     }
-    
+
     /** Creates a Builder by copying an existing $this.mangle($schema.getName()) instance */
     private Builder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())} other) {
       #if ($schema.isError())super(other)#else
@@ -183,7 +183,7 @@ public class ${this.mangle($schema.getNa
       super.setValue(value);
       return this;
     }
-    
+
     @Override
     public #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder clearValue() {
       super.clearValue();
@@ -195,7 +195,7 @@ public class ${this.mangle($schema.getNa
       super.setCause(cause);
       return this;
     }
-    
+
     @Override
     public #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder clearCause() {
       super.clearCause();
@@ -209,20 +209,20 @@ public class ${this.mangle($schema.getNa
     public ${this.javaType($field.schema())} ${this.generateGetMethod($schema, $field)}() {
       return ${this.mangle($field.name(), $schema.isError())};
     }
-    
+
     /** Sets the value of the '${this.mangle($field.name(), $schema.isError())}' field */
     public #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder ${this.generateSetMethod($schema, $field)}(${this.javaUnbox($field.schema())} value) {
       validate(fields()[$field.pos()], value);
       this.${this.mangle($field.name(), $schema.isError())} = value;
       fieldSetFlags()[$field.pos()] = true;
-      return this; 
+      return this;
     }
-    
+
     /** Checks whether the '${this.mangle($field.name(), $schema.isError())}' field has been set */
     public boolean ${this.generateHasMethod($schema, $field)}() {
       return fieldSetFlags()[$field.pos()];
     }
-    
+
     /** Clears the value of the '${this.mangle($field.name(), $schema.isError())}' field */
     public #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder ${this.generateClearMethod($schema, $field)}() {
 #if (${this.isUnboxedJavaTypeNullable($field.schema())})
@@ -231,7 +231,7 @@ public class ${this.mangle($schema.getNa
       fieldSetFlags()[$field.pos()] = false;
       return this;
     }
-    
+
 #end
 #end
     @Override
@@ -247,17 +247,21 @@ public class ${this.mangle($schema.getNa
       }
     }
   }
-  
+
   public ${this.mangle($schema.getName())}.Tombstone getTombstone(){
   	return TOMBSTONE;
   }
 
+  public ${this.mangle($schema.getName())} newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
-  
+
   public static final class Tombstone extends ${this.mangle($schema.getName())} implements org.apache.gora.persistency.Tombstone {
-  
+
       private Tombstone() { }
-  
+
 	  #foreach ($field in $schema.getFields())
 	#if ($this.isNotHiddenField($field.name()))
 	  /**
@@ -267,7 +271,7 @@ public class ${this.mangle($schema.getNa
 	  public ${this.javaType($field.schema())} ${this.generateGetMethod($schema, $field)}() {
 	    throw new java.lang.UnsupportedOperationException("Get is not supported on tombstones");
 	  }
-	
+
 	  /**
 	   * Sets the value of the '${this.mangle($field.name(), $schema.isError())}' field.
 	#if ($field.doc())   * $field.doc()#end
@@ -276,7 +280,7 @@ public class ${this.mangle($schema.getNa
 	  public void ${this.generateSetMethod($schema, $field)}(${this.javaType($field.schema())} value) {
 	    throw new java.lang.UnsupportedOperationException("Set is not supported on tombstones");
 	  }
-	  
+
 	  /**
 	   * Checks the dirty status of the '${this.mangle($field.name(), $schema.isError())}' field. A field is dirty if it represents a change that has not yet been written to the database.
 	#if ($field.doc())   * $field.doc()#end
@@ -285,10 +289,10 @@ public class ${this.mangle($schema.getNa
 	  public boolean ${this.generateDirtyMethod($schema, $field)}(${this.javaType($field.schema())} value) {
 	    throw new java.lang.UnsupportedOperationException("IsDirty is not supported on tombstones");
 	  }
-	
+
 	#end
 	#end
-  
+
   }
-  
+
 }
\ No newline at end of file

Modified: gora/branches/GORA_94/gora-core/src/examples/avro/employee.json
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/avro/employee.json?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/avro/employee.json (original)
+++ gora/branches/GORA_94/gora-core/src/examples/avro/employee.json Thu Jan  9 15:17:01 2014
@@ -16,15 +16,15 @@
           "fields" : [
            {"name": "url", "type": ["null","string"], "default":null},
            {"name": "content", "type": ["null","bytes"],"default":null},
-           {"name": "parsedContent", "type": {"type":"array", "items": "string"},"default":null},
-           {"name": "outlinks", "type": {"type":"map", "values":"string"},"default":null},
+           {"name": "parsedContent", "type": {"type":"array", "items": "string"},"default":{}},
+           {"name": "outlinks", "type": {"type":"map", "values":"string"},"default":{}},
            {"name": "metadata", "default":null, "type": {
             "name": "Metadata",
             "type": "record",
             "namespace": "org.apache.gora.examples.generated",
             "fields": [
              {"name": "version", "type": "int","default":0},
-             {"name": "data", "type": {"type": "map", "values": "string"},"default":null}
+             {"name": "data", "type": {"type": "map", "values": "string"},"default":{}}
             ]
           }}
           ]

Modified: gora/branches/GORA_94/gora-core/src/examples/avro/immutable_fields.json
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/avro/immutable_fields.json?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/avro/immutable_fields.json (original)
+++ gora/branches/GORA_94/gora-core/src/examples/avro/immutable_fields.json Thu Jan  9 15:17:01 2014
@@ -4,15 +4,15 @@
   "doc": "Record with only immutable or dirtyable fields, used for testing",
   "namespace": "org.apache.gora.examples.generated",
   "fields" : [
-    {"name": "v1", "type": "int"},
+    {"name": "v1", "type": "int","default":0},
     {"name": "v2", "type": [{
       "name": "V2",
       "type": "record",
       "namespace": "org.apache.gora.examples.generated",
       "fields": [
-        {"name": "v3", "type": "int"}
+        {"name": "v3", "type": "int","default":0}
       ]
-    },"null"]
+    },"null"], "default":null
     }
   ]
 }

Modified: gora/branches/GORA_94/gora-core/src/examples/avro/tokendatum.json
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/avro/tokendatum.json?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/avro/tokendatum.json (original)
+++ gora/branches/GORA_94/gora-core/src/examples/avro/tokendatum.json Thu Jan  9 15:17:01 2014
@@ -3,6 +3,6 @@
   "name": "TokenDatum",
   "namespace": "org.apache.gora.examples.generated",
   "fields" : [
-    {"name": "count", "type": "int"}
+    {"name": "count", "type": "int","default":0}
   ]
 }

Modified: gora/branches/GORA_94/gora-core/src/examples/avro/webpage.json
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/avro/webpage.json?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/avro/webpage.json (original)
+++ gora/branches/GORA_94/gora-core/src/examples/avro/webpage.json Thu Jan  9 15:17:01 2014
@@ -6,7 +6,7 @@
     {"name": "url", "type": ["null","string"], "default":null},
     {"name": "content", "type": ["null","bytes"],"default":null},
     {"name": "parsedContent", "type": {"type":"array", "items": "string"}, "default":null},
-    {"name": "outlinks", "type": {"type":"map", "values":"string"}, "default":null},
+    {"name": "outlinks", "type": {"type":"map", "values":"string"}, "default":{}},
     {"name": "metadata", "default":null, "type": {
       "name": "Metadata",
       "type": "record",

Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/WebPageDataCreator.java Thu Jan  9 15:17:01 2014
@@ -120,7 +120,6 @@ public class WebPageDataCreator {
         page = WebPage.newBuilder().build();
         page.setUrl(new Utf8(URLS[i]));
         page.setParsedContent(new ArrayList<CharSequence>());
-        page.setOutlinks(new HashMap<CharSequence, CharSequence>());
         if (CONTENTS[i]!=null){
           page.setContent(ByteBuffer.wrap(CONTENTS[i].getBytes()));
           for(String token : CONTENTS[i].split(" ")) {
@@ -133,10 +132,9 @@ public class WebPageDataCreator {
         
         Metadata metadata = Metadata.newBuilder().build();
         metadata.setVersion(1);
-        metadata.setData(new HashMap<CharSequence, CharSequence>());
         metadata.getData().put(new Utf8("metakey"), new Utf8("metavalue"));
         page.setMetadata(metadata);
-        
+
         dataStore.put(URLS[i], page);
       }
       dataStore.flush();

Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java Thu Jan  9 15:17:01 2014
@@ -6,7 +6,7 @@
 package org.apache.gora.examples.generated;  
 @SuppressWarnings("all")
 public class Employee extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Employee\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"name\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"dateOfBirth\",\"type\":\"long\",\"default\":0},{\"name\":\"ssn\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"salary\",\"type\":\"int\",\"default\":0},{\"name\":\"boss\",\"type\":[\"null\",\"Employee\",\"string\"],\"default\":null},{\"name\":\"webpage\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"WebPage\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"url\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"content\",\"type\":
 [\"null\",\"bytes\"],\"default\":null},{\"name\":\"parsedContent\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"default\":null},{\"name\":\"outlinks\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":null},{\"name\":\"metadata\",\"type\":{\"type\":\"record\",\"name\":\"Metadata\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"version\",\"type\":\"int\",\"default\":0},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":null}]},\"default\":null}]}],\"default\":null}]}");
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Employee\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"name\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"dateOfBirth\",\"type\":\"long\",\"default\":0},{\"name\":\"ssn\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"salary\",\"type\":\"int\",\"default\":0},{\"name\":\"boss\",\"type\":[\"null\",\"Employee\",\"string\"],\"default\":null},{\"name\":\"webpage\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"WebPage\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"url\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"content\",\"type\":
 [\"null\",\"bytes\"],\"default\":null},{\"name\":\"parsedContent\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"default\":{}},{\"name\":\"outlinks\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":{}},{\"name\":\"metadata\",\"type\":{\"type\":\"record\",\"name\":\"Metadata\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"version\",\"type\":\"int\",\"default\":0},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":{}}]},\"default\":null}]}],\"default\":null}]}");
   /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
   private java.lang.CharSequence name;
@@ -454,6 +454,10 @@ public class Employee extends org.apache
   	return TOMBSTONE;
   }
 
+  public Employee newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends Employee implements org.apache.gora.persistency.Tombstone {

Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/ImmutableFields.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/ImmutableFields.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/ImmutableFields.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/ImmutableFields.java Thu Jan  9 15:17:01 2014
@@ -7,7 +7,7 @@ package org.apache.gora.examples.generat
 @SuppressWarnings("all")
 /** Record with only immutable or dirtyable fields, used for testing */
 public class ImmutableFields extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ImmutableFields\",\"namespace\":\"org.apache.gora.examples.generated\",\"doc\":\"Record with only immutable or dirtyable fields, used for testing\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"v1\",\"type\":\"int\"},{\"name\":\"v2\",\"type\":[{\"type\":\"record\",\"name\":\"V2\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"v3\",\"type\":\"int\"}]},\"null\"]}]}");
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ImmutableFields\",\"namespace\":\"org.apache.gora.examples.generated\",\"doc\":\"Record with only immutable or dirtyable fields, used for testing\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"v1\",\"type\":\"int\",\"default\":0},{\"name\":\"v2\",\"type\":[{\"type\":\"record\",\"name\":\"V2\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"v3\",\"type\":\"int\",\"default\":0}]},\"null\"],\"default\":null}]}");
   /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
   private int v1;
@@ -22,13 +22,14 @@ public class ImmutableFields extends org
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
+  
   // Used by DatumReader.  Applications should not call. 
   @SuppressWarnings(value="unchecked")
-  public void put(int field$, java.lang.Object value$) {
+  public void put(int field$, java.lang.Object value) {
     switch (field$) {
-    case 0: __g__dirty = (java.nio.ByteBuffer)value$; break;
-    case 1: v1 = (java.lang.Integer)value$; break;
-    case 2: v2 = (org.apache.gora.examples.generated.V2)value$; break;
+    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
+    case 1: v1 = (java.lang.Integer)(value); break;
+    case 2: v2 = (org.apache.gora.examples.generated.V2)(value); break;
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
@@ -209,7 +210,7 @@ public class ImmutableFields extends org
     public ImmutableFields build() {
       try {
         ImmutableFields record = new ImmutableFields();
-        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) defaultValue(fields()[0]);
+        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[1]);
         record.v1 = fieldSetFlags()[1] ? this.v1 : (java.lang.Integer) defaultValue(fields()[1]);
         record.v2 = fieldSetFlags()[2] ? this.v2 : (org.apache.gora.examples.generated.V2) defaultValue(fields()[2]);
         return record;
@@ -223,6 +224,10 @@ public class ImmutableFields extends org
   	return TOMBSTONE;
   }
 
+  public ImmutableFields newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends ImmutableFields implements org.apache.gora.persistency.Tombstone {

Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Metadata.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Metadata.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Metadata.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Metadata.java Thu Jan  9 15:17:01 2014
@@ -6,14 +6,7 @@
 package org.apache.gora.examples.generated;  
 @SuppressWarnings("all")
 public class Metadata extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Metadata\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"version\",\"type\":\"int\",\"default\":0},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":null}]}");
-  
-  public static final String[] _ALL_FIELDS = {
-  "__g__dirty",
-  "version",
-  "data",
-  };
-
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Metadata\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"version\",\"type\":\"int\",\"default\":0},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":{}}]}");
   /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
   private int version;
@@ -28,13 +21,14 @@ public class Metadata extends org.apache
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
+  
   // Used by DatumReader.  Applications should not call. 
   @SuppressWarnings(value="unchecked")
-  public void put(int field$, java.lang.Object value$) {
+  public void put(int field$, java.lang.Object value) {
     switch (field$) {
-    case 0: __g__dirty = (java.nio.ByteBuffer)value$; break;
-    case 1: version = (java.lang.Integer)value$; break;
-    case 2: data = (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>)value$; break;
+    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
+    case 1: version = (java.lang.Integer)(value); break;
+    case 2: data = (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>)((value instanceof org.apache.gora.persistency.Dirtyable) ? value : new org.apache.gora.persistency.impl.DirtyMapWrapper((java.util.Map)value)); break;
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
@@ -215,9 +209,9 @@ public class Metadata extends org.apache
     public Metadata build() {
       try {
         Metadata record = new Metadata();
-        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) defaultValue(fields()[0]);
+        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[1]);
         record.version = fieldSetFlags()[1] ? this.version : (java.lang.Integer) defaultValue(fields()[1]);
-        record.data = fieldSetFlags()[2] ? this.data : (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>) defaultValue(fields()[2]);
+        record.data = fieldSetFlags()[2] ? this.data : (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>) new org.apache.gora.persistency.impl.DirtyMapWrapper((java.util.Map)defaultValue(fields()[2]));
         return record;
       } catch (Exception e) {
         throw new org.apache.avro.AvroRuntimeException(e);
@@ -229,6 +223,10 @@ public class Metadata extends org.apache
   	return TOMBSTONE;
   }
 
+  public Metadata newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends Metadata implements org.apache.gora.persistency.Tombstone {

Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/TokenDatum.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/TokenDatum.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/TokenDatum.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/TokenDatum.java Thu Jan  9 15:17:01 2014
@@ -6,7 +6,7 @@
 package org.apache.gora.examples.generated;  
 @SuppressWarnings("all")
 public class TokenDatum extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TokenDatum\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"count\",\"type\":\"int\"}]}");
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TokenDatum\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"count\",\"type\":\"int\",\"default\":0}]}");
   /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
   private int count;
@@ -19,12 +19,13 @@ public class TokenDatum extends org.apac
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
+  
   // Used by DatumReader.  Applications should not call. 
   @SuppressWarnings(value="unchecked")
-  public void put(int field$, java.lang.Object value$) {
+  public void put(int field$, java.lang.Object value) {
     switch (field$) {
-    case 0: __g__dirty = (java.nio.ByteBuffer)value$; break;
-    case 1: count = (java.lang.Integer)value$; break;
+    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
+    case 1: count = (java.lang.Integer)(value); break;
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
@@ -151,7 +152,7 @@ public class TokenDatum extends org.apac
     public TokenDatum build() {
       try {
         TokenDatum record = new TokenDatum();
-        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) defaultValue(fields()[0]);
+        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[1]);
         record.count = fieldSetFlags()[1] ? this.count : (java.lang.Integer) defaultValue(fields()[1]);
         return record;
       } catch (Exception e) {
@@ -164,6 +165,10 @@ public class TokenDatum extends org.apac
   	return TOMBSTONE;
   }
 
+  public TokenDatum newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends TokenDatum implements org.apache.gora.persistency.Tombstone {

Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/V2.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/V2.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/V2.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/V2.java Thu Jan  9 15:17:01 2014
@@ -6,7 +6,7 @@
 package org.apache.gora.examples.generated;  
 @SuppressWarnings("all")
 public class V2 extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"V2\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"v3\",\"type\":\"int\"}]}");
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"V2\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"v3\",\"type\":\"int\",\"default\":0}]}");
   /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
   private int v3;
@@ -19,12 +19,13 @@ public class V2 extends org.apache.gora.
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
+  
   // Used by DatumReader.  Applications should not call. 
   @SuppressWarnings(value="unchecked")
-  public void put(int field$, java.lang.Object value$) {
+  public void put(int field$, java.lang.Object value) {
     switch (field$) {
-    case 0: __g__dirty = (java.nio.ByteBuffer)value$; break;
-    case 1: v3 = (java.lang.Integer)value$; break;
+    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
+    case 1: v3 = (java.lang.Integer)(value); break;
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
@@ -151,7 +152,7 @@ public class V2 extends org.apache.gora.
     public V2 build() {
       try {
         V2 record = new V2();
-        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) defaultValue(fields()[0]);
+        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[1]);
         record.v3 = fieldSetFlags()[1] ? this.v3 : (java.lang.Integer) defaultValue(fields()[1]);
         return record;
       } catch (Exception e) {
@@ -164,6 +165,10 @@ public class V2 extends org.apache.gora.
   	return TOMBSTONE;
   }
 
+  public V2 newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends V2 implements org.apache.gora.persistency.Tombstone {

Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/WebPage.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/WebPage.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/WebPage.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/WebPage.java Thu Jan  9 15:17:01 2014
@@ -6,17 +6,7 @@
 package org.apache.gora.examples.generated;  
 @SuppressWarnings("all")
 public class WebPage extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"WebPage\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"url\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"content\",\"type\":[\"null\",\"bytes\"],\"default\":null},{\"name\":\"parsedContent\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"default\":null},{\"name\":\"outlinks\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":null},{\"name\":\"metadata\",\"type\":{\"type\":\"record\",\"name\":\"Metadata\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"version\",\"type\":\"int\",\"default\":0},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\"
 :\"string\"},\"default\":null}]},\"default\":null}]}");
-  
-  public static final String[] _ALL_FIELDS = {
-  "__g__dirty",
-  "url",
-  "content",
-  "parsedContent",
-  "outlinks",
-  "metadata",
-  };
-
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"WebPage\",\"namespace\":\"org.apache.gora.examples.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"url\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"content\",\"type\":[\"null\",\"bytes\"],\"default\":null},{\"name\":\"parsedContent\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"default\":{}},{\"name\":\"outlinks\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":{}},{\"name\":\"metadata\",\"type\":{\"type\":\"record\",\"name\":\"Metadata\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"version\",\"type\":\"int\",\"default\":0},{\"name\":\"data\",\"type\":{\"type\":\"map\",\"values\":\"s
 tring\"},\"default\":{}}]},\"default\":null}]}");
   /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
   private java.lang.CharSequence url;
@@ -37,16 +27,17 @@ public class WebPage extends org.apache.
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
+  
   // Used by DatumReader.  Applications should not call. 
   @SuppressWarnings(value="unchecked")
-  public void put(int field$, java.lang.Object value$) {
+  public void put(int field$, java.lang.Object value) {
     switch (field$) {
-    case 0: __g__dirty = (java.nio.ByteBuffer)value$; break;
-    case 1: url = (java.lang.CharSequence)value$; break;
-    case 2: content = (java.nio.ByteBuffer)value$; break;
-    case 3: parsedContent = (java.util.List<java.lang.CharSequence>)value$; break;
-    case 4: outlinks = (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>)value$; break;
-    case 5: metadata = (org.apache.gora.examples.generated.Metadata)value$; break;
+    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
+    case 1: url = (java.lang.CharSequence)(value); break;
+    case 2: content = (java.nio.ByteBuffer)(value); break;
+    case 3: parsedContent = (java.util.List<java.lang.CharSequence>)((value instanceof org.apache.gora.persistency.Dirtyable) ? value : new org.apache.gora.persistency.impl.DirtyListWrapper((java.util.List)value)); break;
+    case 4: outlinks = (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>)((value instanceof org.apache.gora.persistency.Dirtyable) ? value : new org.apache.gora.persistency.impl.DirtyMapWrapper((java.util.Map)value)); break;
+    case 5: metadata = (org.apache.gora.examples.generated.Metadata)(value); break;
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
@@ -390,12 +381,12 @@ public class WebPage extends org.apache.
     public WebPage build() {
       try {
         WebPage record = new WebPage();
-        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) defaultValue(fields()[0]);
+        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[1]);
         record.url = fieldSetFlags()[1] ? this.url : (java.lang.CharSequence) defaultValue(fields()[1]);
         record.content = fieldSetFlags()[2] ? this.content : (java.nio.ByteBuffer) defaultValue(fields()[2]);
-        record.parsedContent = fieldSetFlags()[3] ? this.parsedContent : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[3]);
-        record.outlinks = fieldSetFlags()[4] ? this.outlinks : (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>) defaultValue(fields()[4]);
-        record.metadata = fieldSetFlags()[5] ? this.metadata : (org.apache.gora.examples.generated.Metadata) defaultValue(fields()[5]);
+        record.parsedContent = fieldSetFlags()[3] ? this.parsedContent : (java.util.List<java.lang.CharSequence>) new org.apache.gora.persistency.impl.DirtyListWrapper((java.util.List)defaultValue(fields()[3]));
+        record.outlinks = fieldSetFlags()[4] ? this.outlinks : (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>) new org.apache.gora.persistency.impl.DirtyMapWrapper((java.util.Map)defaultValue(fields()[4]));
+        record.metadata = fieldSetFlags()[5] ? this.metadata : (org.apache.gora.examples.generated.Metadata) Metadata.newBuilder().build();
         return record;
       } catch (Exception e) {
         throw new org.apache.avro.AvroRuntimeException(e);
@@ -407,6 +398,10 @@ public class WebPage extends org.apache.
   	return TOMBSTONE;
   }
 
+  public WebPage newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends WebPage implements org.apache.gora.persistency.Tombstone {

Modified: gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java (original)
+++ gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java Thu Jan  9 15:17:01 2014
@@ -109,4 +109,11 @@ public interface Persistent extends Spec
 */
   public List<Field> getUnmanagedFields();
 
+  /**
+   * Constructs a new instance of the object by using appropriate builder. This
+   * method is intended to be used by Gora framework.
+   * 
+   * @return a new instance of the object
+   */
+  Persistent newInstance();
 }
\ No newline at end of file

Modified: gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java (original)
+++ gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/BeanFactoryImpl.java Thu Jan  9 15:17:01 2014
@@ -78,13 +78,7 @@ public class BeanFactoryImpl<K, T extend
  
   @Override
   public T newPersistent() {
-    try {
-      return persistentClass.newInstance();
-    } catch (InstantiationException e) {
-      throw new RuntimeException(e);
-    } catch (IllegalAccessException e) {
-      throw new RuntimeException(e);
-    }
+    return (T) persistent.newInstance();
   }
   
   @Override

Modified: gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java (original)
+++ gora/branches/GORA_94/gora-core/src/main/java/org/apache/gora/persistency/impl/PersistentBase.java Thu Jan  9 15:17:01 2014
@@ -182,12 +182,7 @@ public abstract class PersistentBase ext
     for (Field field : getSchema().getFields()) {
       if (!unmanagedFields.contains(field))
         continue;
-      /*
-       * TODO: Its more in the spirit of Gora's clear method to actually clear
-       * data structures, but since avro no-longer defaults to having empty
-       * structures the way to do this consistently would be complicated.
-       */
-      put(field.pos(), null);
+      put(field.pos(), PersistentData.get().deepCopy(field.schema(), PersistentData.get().getDefaultValue(field)));
     }
     clearDirty();
   }

Modified: gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/mock/persistency/MockPersistent.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/mock/persistency/MockPersistent.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/mock/persistency/MockPersistent.java (original)
+++ gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/mock/persistency/MockPersistent.java Thu Jan  9 15:17:01 2014
@@ -19,6 +19,7 @@
 package org.apache.gora.mock.persistency;
 
 import org.apache.avro.Schema;
+import org.apache.gora.persistency.Persistent;
 import org.apache.gora.persistency.Tombstone;
 import org.apache.gora.persistency.impl.PersistentBase;
 
@@ -79,5 +80,9 @@ public class MockPersistent extends Pers
     return new Tombstone(){};
   }
 
-  
+  @Override
+  public Persistent newInstance() {
+    return new MockPersistent();
+  }
+
 }

Modified: gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java (original)
+++ gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java Thu Jan  9 15:17:01 2014
@@ -115,24 +115,20 @@ public class TestPersistentBase {
     WebPage page = WebPage.newBuilder().build();
    
     page.setUrl(new Utf8("http://foo.com"));
-    page.setParsedContent(new ArrayList<CharSequence>());
     page.getParsedContent().add(new Utf8("foo"));
-    page.setOutlinks(new HashMap<CharSequence, CharSequence>());
     page.getOutlinks().put(new Utf8("foo"), new Utf8("bar"));
     page.setContent(ByteBuffer.wrap("foo baz bar".getBytes()));
     
     page.clear();
     
     assertNull(page.getUrl());
-    assertNull(page.getParsedContent());
-    assertNull(page.getOutlinks());
+    assertEquals(0, page.getParsedContent().size());
+    assertEquals(0, page.getOutlinks().size());
     assertNull(page.getContent());
     
     //set fields again
     page.setUrl(new Utf8("http://bar.com"));
-    page.setParsedContent(new ArrayList<CharSequence>());
     page.getParsedContent().add(new Utf8("bar"));
-    page.setOutlinks(new HashMap<CharSequence, CharSequence>());
     page.getOutlinks().put(new Utf8("bar"), new Utf8("baz"));
     page.setContent(ByteBuffer.wrap("foo baz bar barbaz".getBytes()));
     

Modified: gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java (original)
+++ gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java Thu Jan  9 15:17:01 2014
@@ -97,12 +97,22 @@ public class DataStoreTestUtil {
     return employee;
   }
 
-  public static <K> Employee createBoss(
-      DataStore<K, Employee> dataStore) throws IOException, Exception {
+  private static <K> WebPage createWebPage(DataStore<K, Employee> dataStore) {
+    WebPage webpage = WebPage.newBuilder().build();
+    webpage.setUrl(new Utf8("url.."));
+    webpage.setContent(ByteBuffer.wrap("test content".getBytes()));
+    webpage.setParsedContent(new ArrayList<CharSequence>());
+    Metadata metadata = Metadata.newBuilder().build();
+    webpage.setMetadata(metadata);
+    return webpage;
+  }
+
+  public static <K> Employee createBoss(DataStore<K, Employee> dataStore)
+      throws IOException, Exception {
 
     Employee employee = Employee.newBuilder().build();
     employee.setName(new Utf8("Random boss"));
-    employee.setDateOfBirth( System.currentTimeMillis() - 22L *  YEAR_IN_MS );
+    employee.setDateOfBirth(System.currentTimeMillis() - 22L * YEAR_IN_MS);
     employee.setSalary(1000000);
     employee.setSsn(new Utf8("202020202020"));
     return employee;
@@ -204,9 +214,7 @@ public class DataStoreTestUtil {
     webpage.setUrl(new Utf8("url..")) ;
     webpage.setContent(ByteBuffer.wrap("test content".getBytes())) ;
     webpage.setParsedContent(new ArrayList<CharSequence>());
-    webpage.setOutlinks(new HashMap<CharSequence, CharSequence>());
     Metadata metadata = new BeanFactoryImpl<String,Metadata>(String.class,Metadata.class).newPersistent();
-    metadata.setData(new HashMap<CharSequence, CharSequence>());
     webpage.setMetadata(metadata) ;
     employee.setWebpage(webpage) ;
     
@@ -242,6 +250,10 @@ public class DataStoreTestUtil {
   public static void testGetEmployeeWithFields(DataStore<String, Employee> dataStore)
     throws IOException, Exception {
     Employee employee = DataStoreTestUtil.createEmployee(dataStore);
+    WebPage webpage = createWebPage(dataStore);
+    employee.setWebpage(webpage);
+    Employee boss = createBoss(dataStore);
+    employee.setBoss(boss);
     String ssn = employee.getSsn().toString();
     dataStore.put(ssn, employee);
     dataStore.flush();
@@ -488,7 +500,6 @@ public class DataStoreTestUtil {
       for (parsedContentCount = 0; parsedContentCount < 5; parsedContentCount++) {
         webPage.getParsedContent().add(new Utf8(parsedContent + i + "," + parsedContentCount));
       }
-      webPage.setOutlinks(new HashMap<CharSequence, CharSequence>());
       for (int j = 0; j < urls.length; j += 2) {
         webPage.getOutlinks().put(new Utf8(anchor + j), new Utf8(urls[j]));
       }
@@ -900,8 +911,8 @@ public class DataStoreTestUtil {
 
       assertNotNull(page.getUrl());
       assertEquals(page.getUrl().toString(), SORTED_URLS[i]);
-      assertNull("Map of Outlinks should be 'null' as the deleteByQuery "
-          + "not only removes the data but also the data structure.", page.getOutlinks());
+      assertEquals("Map of Outlinks should have a size of '0' as the deleteByQuery "
+          + "not only removes the data but also the data structure.", 0, page.getOutlinks().size());
       assertEquals(0, page.getParsedContent().size());
       if(page.getContent() != null) {
         System.out.println("url:" + page.getUrl().toString());
@@ -1015,7 +1026,6 @@ public class DataStoreTestUtil {
     WebPage page = WebPage.newBuilder().build();
 
     page.setUrl(new Utf8("http://example.com"));
-    page.setOutlinks(new HashMap<CharSequence, CharSequence>());
     page.getOutlinks().put(new Utf8("http://example2.com"), new Utf8("anchor2"));
     page.getOutlinks().put(new Utf8("http://example3.com"), new Utf8("anchor3"));
     page.getOutlinks().put(new Utf8("http://example3.com"), new Utf8("anchor4"));

Modified: gora/branches/GORA_94/gora-tutorial/src/main/avro/metricdatum.json
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-tutorial/src/main/avro/metricdatum.json?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-tutorial/src/main/avro/metricdatum.json (original)
+++ gora/branches/GORA_94/gora-tutorial/src/main/avro/metricdatum.json Thu Jan  9 15:17:01 2014
@@ -1,10 +1,10 @@
 {
   "type": "record",
-  "name": "MetricDatum",
+  "name": "MetricDatum", "default":null,
   "namespace": "org.apache.gora.tutorial.log.generated",
   "fields" : [
-    {"name": "metricDimension", "type": "string"},
-    {"name": "timestamp", "type": "long"},
-    {"name": "metric", "type" : "long"}
+    {"name": "metricDimension", "type": ["null","string"], "default":null},
+    {"name": "timestamp", "type": "long","default":0},
+    {"name": "metric", "type" : "long","default":0}
   ]
 }

Modified: gora/branches/GORA_94/gora-tutorial/src/main/avro/pageview.json
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-tutorial/src/main/avro/pageview.json?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-tutorial/src/main/avro/pageview.json (original)
+++ gora/branches/GORA_94/gora-tutorial/src/main/avro/pageview.json Thu Jan  9 15:17:01 2014
@@ -1,15 +1,15 @@
 {
   "type": "record",
-  "name": "Pageview",
+  "name": "Pageview", "default":null,
   "namespace": "org.apache.gora.tutorial.log.generated",
   "fields" : [
-    {"name": "url", "type": "string"},
-    {"name": "timestamp", "type": "long"},
-    {"name": "ip", "type": "string"},
-    {"name": "httpMethod", "type": "string"},
-    {"name": "httpStatusCode", "type": "int"},
-    {"name": "responseSize", "type": "int"},
-    {"name": "referrer", "type": "string"},
-    {"name": "userAgent", "type": "string"}
+    {"name": "url", "type": ["null","string"], "default":null},
+    {"name": "timestamp", "type": "long", "default":0},
+    {"name": "ip", "type": ["null","string"], "default":null},
+    {"name": "httpMethod", "type": ["null","string"], "default":null},
+    {"name": "httpStatusCode", "type": "int", "default":0},
+    {"name": "responseSize", "type": "int", "default":0},
+    {"name": "referrer", "type": ["null","string"], "default":null},
+    {"name": "userAgent", "type": ["null","string"], "default":null}
   ]
 }

Modified: gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java (original)
+++ gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/MetricDatum.java Thu Jan  9 15:17:01 2014
@@ -6,7 +6,7 @@
 package org.apache.gora.tutorial.log.generated;  
 @SuppressWarnings("all")
 public class MetricDatum extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"MetricDatum\",\"namespace\":\"org.apache.gora.tutorial.log.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"metricDimension\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"metric\",\"type\":\"long\"}]}");
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"MetricDatum\",\"namespace\":\"org.apache.gora.tutorial.log.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AA==\"},{\"name\":\"metricDimension\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"timestamp\",\"type\":\"long\",\"default\":0},{\"name\":\"metric\",\"type\":\"long\",\"default\":0}]}");
   /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[1]);
   private java.lang.CharSequence metricDimension;
@@ -23,14 +23,15 @@ public class MetricDatum extends org.apa
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
+  
   // Used by DatumReader.  Applications should not call. 
   @SuppressWarnings(value="unchecked")
-  public void put(int field$, java.lang.Object value$) {
+  public void put(int field$, java.lang.Object value) {
     switch (field$) {
-    case 0: __g__dirty = (java.nio.ByteBuffer)value$; break;
-    case 1: metricDimension = (java.lang.CharSequence)value$; break;
-    case 2: timestamp = (java.lang.Long)value$; break;
-    case 3: metric = (java.lang.Long)value$; break;
+    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
+    case 1: metricDimension = (java.lang.CharSequence)(value); break;
+    case 2: timestamp = (java.lang.Long)(value); break;
+    case 3: metric = (java.lang.Long)(value); break;
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
@@ -39,7 +40,7 @@ public class MetricDatum extends org.apa
    * Gets the value of the 'metricDimension' field.
    */
   public java.lang.CharSequence getMetricDimension() {
-    return metricDimension.toString();
+    return metricDimension;
   }
 
   /**
@@ -47,7 +48,7 @@ public class MetricDatum extends org.apa
    * @param value the value to set.
    */
   public void setMetricDimension(java.lang.CharSequence value) {
-    this.metricDimension = value.toString();
+    this.metricDimension = value;
     setDirty(1);
   }
   
@@ -264,7 +265,7 @@ public class MetricDatum extends org.apa
     public MetricDatum build() {
       try {
         MetricDatum record = new MetricDatum();
-        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) defaultValue(fields()[0]);
+        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[1]);
         record.metricDimension = fieldSetFlags()[1] ? this.metricDimension : (java.lang.CharSequence) defaultValue(fields()[1]);
         record.timestamp = fieldSetFlags()[2] ? this.timestamp : (java.lang.Long) defaultValue(fields()[2]);
         record.metric = fieldSetFlags()[3] ? this.metric : (java.lang.Long) defaultValue(fields()[3]);
@@ -279,6 +280,10 @@ public class MetricDatum extends org.apa
   	return TOMBSTONE;
   }
 
+  public MetricDatum newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends MetricDatum implements org.apache.gora.persistency.Tombstone {

Modified: gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java?rev=1556830&r1=1556829&r2=1556830&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java (original)
+++ gora/branches/GORA_94/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/generated/Pageview.java Thu Jan  9 15:17:01 2014
@@ -6,21 +6,8 @@
 package org.apache.gora.tutorial.log.generated;  
 @SuppressWarnings("all")
 public class Pageview extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
-  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Pageview\",\"namespace\":\"org.apache.gora.tutorial.log.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty\",\"default\":\"AAA=\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"httpMethod\",\"type\":\"string\"},{\"name\":\"httpStatusCode\",\"type\":\"int\"},{\"name\":\"responseSize\",\"type\":\"int\"},{\"name\":\"referrer\",\"type\":\"string\"},{\"name\":\"userAgent\",\"type\":\"string\"}]}");
-  
-  public static final String[] _ALL_FIELDS = {
-  "__g__dirty",
-  "url",
-  "timestamp",
-  "ip",
-  "httpMethod",
-  "httpStatusCode",
-  "responseSize",
-  "referrer",
-  "userAgent",
-  };
-
-  /** Bytes used to represent weather or not a field is dirty */
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Pageview\",\"namespace\":\"org.apache.gora.tutorial.log.generated\",\"fields\":[{\"name\":\"__g__dirty\",\"type\":\"bytes\",\"doc\":\"Bytes used to represent weather or not a field is dirty.\",\"default\":\"AAA=\"},{\"name\":\"url\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"timestamp\",\"type\":\"long\",\"default\":0},{\"name\":\"ip\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"httpMethod\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"httpStatusCode\",\"type\":\"int\",\"default\":0},{\"name\":\"responseSize\",\"type\":\"int\",\"default\":0},{\"name\":\"referrer\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"userAgent\",\"type\":[\"null\",\"string\"],\"default\":null}]}");
+  /** Bytes used to represent weather or not a field is dirty. */
   private java.nio.ByteBuffer __g__dirty = java.nio.ByteBuffer.wrap(new byte[2]);
   private java.lang.CharSequence url;
   private long timestamp;
@@ -46,19 +33,20 @@ public class Pageview extends org.apache
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
+  
   // Used by DatumReader.  Applications should not call. 
   @SuppressWarnings(value="unchecked")
-  public void put(int field$, java.lang.Object value$) {
+  public void put(int field$, java.lang.Object value) {
     switch (field$) {
-    case 0: __g__dirty = (java.nio.ByteBuffer)value$; break;
-    case 1: url = (java.lang.CharSequence)value$; break;
-    case 2: timestamp = (java.lang.Long)value$; break;
-    case 3: ip = (java.lang.CharSequence)value$; break;
-    case 4: httpMethod = (java.lang.CharSequence)value$; break;
-    case 5: httpStatusCode = (java.lang.Integer)value$; break;
-    case 6: responseSize = (java.lang.Integer)value$; break;
-    case 7: referrer = (java.lang.CharSequence)value$; break;
-    case 8: userAgent = (java.lang.CharSequence)value$; break;
+    case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
+    case 1: url = (java.lang.CharSequence)(value); break;
+    case 2: timestamp = (java.lang.Long)(value); break;
+    case 3: ip = (java.lang.CharSequence)(value); break;
+    case 4: httpMethod = (java.lang.CharSequence)(value); break;
+    case 5: httpStatusCode = (java.lang.Integer)(value); break;
+    case 6: responseSize = (java.lang.Integer)(value); break;
+    case 7: referrer = (java.lang.CharSequence)(value); break;
+    case 8: userAgent = (java.lang.CharSequence)(value); break;
     default: throw new org.apache.avro.AvroRuntimeException("Bad index");
     }
   }
@@ -67,7 +55,7 @@ public class Pageview extends org.apache
    * Gets the value of the 'url' field.
    */
   public java.lang.CharSequence getUrl() {
-    return url.toString();
+    return url;
   }
 
   /**
@@ -75,7 +63,7 @@ public class Pageview extends org.apache
    * @param value the value to set.
    */
   public void setUrl(java.lang.CharSequence value) {
-    this.url = value.toString();
+    this.url = value;
     setDirty(1);
   }
   
@@ -115,7 +103,7 @@ public class Pageview extends org.apache
    * Gets the value of the 'ip' field.
    */
   public java.lang.CharSequence getIp() {
-    return ip.toString();
+    return ip;
   }
 
   /**
@@ -123,7 +111,7 @@ public class Pageview extends org.apache
    * @param value the value to set.
    */
   public void setIp(java.lang.CharSequence value) {
-    this.ip = value.toString();
+    this.ip = value;
     setDirty(3);
   }
   
@@ -139,7 +127,7 @@ public class Pageview extends org.apache
    * Gets the value of the 'httpMethod' field.
    */
   public java.lang.CharSequence getHttpMethod() {
-    return httpMethod.toString();
+    return httpMethod;
   }
 
   /**
@@ -147,7 +135,7 @@ public class Pageview extends org.apache
    * @param value the value to set.
    */
   public void setHttpMethod(java.lang.CharSequence value) {
-    this.httpMethod = value.toString();
+    this.httpMethod = value;
     setDirty(4);
   }
   
@@ -211,7 +199,7 @@ public class Pageview extends org.apache
    * Gets the value of the 'referrer' field.
    */
   public java.lang.CharSequence getReferrer() {
-    return referrer.toString();
+    return referrer;
   }
 
   /**
@@ -219,7 +207,7 @@ public class Pageview extends org.apache
    * @param value the value to set.
    */
   public void setReferrer(java.lang.CharSequence value) {
-    this.referrer = value.toString();
+    this.referrer = value;
     setDirty(7);
   }
   
@@ -235,7 +223,7 @@ public class Pageview extends org.apache
    * Gets the value of the 'userAgent' field.
    */
   public java.lang.CharSequence getUserAgent() {
-    return userAgent.toString();
+    return userAgent;
   }
 
   /**
@@ -243,7 +231,7 @@ public class Pageview extends org.apache
    * @param value the value to set.
    */
   public void setUserAgent(java.lang.CharSequence value) {
-    this.userAgent = value.toString();
+    this.userAgent = value;
     setDirty(8);
   }
   
@@ -561,7 +549,7 @@ public class Pageview extends org.apache
     public Pageview build() {
       try {
         Pageview record = new Pageview();
-        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) defaultValue(fields()[0]);
+        record.__g__dirty = fieldSetFlags()[0] ? this.__g__dirty : (java.nio.ByteBuffer) java.nio.ByteBuffer.wrap(new byte[2]);
         record.url = fieldSetFlags()[1] ? this.url : (java.lang.CharSequence) defaultValue(fields()[1]);
         record.timestamp = fieldSetFlags()[2] ? this.timestamp : (java.lang.Long) defaultValue(fields()[2]);
         record.ip = fieldSetFlags()[3] ? this.ip : (java.lang.CharSequence) defaultValue(fields()[3]);
@@ -581,6 +569,10 @@ public class Pageview extends org.apache
   	return TOMBSTONE;
   }
 
+  public Pageview newInstance(){
+    return newBuilder().build();
+  }
+
   private static final Tombstone TOMBSTONE = new Tombstone();
   
   public static final class Tombstone extends Pageview implements org.apache.gora.persistency.Tombstone {



Mime
View raw message