gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hsapu...@apache.org
Subject svn commit: r1490107 - in /gora/trunk: CHANGES.txt gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
Date Thu, 06 Jun 2013 01:25:25 GMT
Author: hsaputra
Date: Thu Jun  6 01:25:24 2013
New Revision: 1490107

URL: http://svn.apache.org/r1490107
Log:
GORA-239 Add null checks and better message in AccumuloStore. By David Medinets (thanks)

Modified:
    gora/trunk/CHANGES.txt
    gora/trunk/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java

Modified: gora/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/gora/trunk/CHANGES.txt?rev=1490107&r1=1490106&r2=1490107&view=diff
==============================================================================
--- gora/trunk/CHANGES.txt (original)
+++ gora/trunk/CHANGES.txt Thu Jun  6 01:25:24 2013
@@ -4,6 +4,8 @@
 
 Gora Change Log
 
+* GORA-239 Add null checks and better message in AccumuloStore (David Medinets via hsaputra)
+
 0.3 release: 05/03/2013 (mm/dd/yyyy)
 Release Report: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311172&version=12317954
 

Modified: gora/trunk/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java?rev=1490107&r1=1490106&r2=1490107&view=diff
==============================================================================
--- gora/trunk/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
(original)
+++ gora/trunk/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
Thu Jun  6 01:25:24 2013
@@ -93,6 +93,7 @@ import org.apache.gora.query.impl.Partit
 import org.apache.gora.store.DataStoreFactory;
 import org.apache.gora.store.impl.DataStoreBase;
 import org.apache.gora.util.AvroUtils;
+import org.apache.gora.util.GoraException;
 import org.apache.hadoop.io.Text;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -322,6 +323,10 @@ public class AccumuloStore<K,T extends P
         }
 
       }
+
+      if (mapping.tableName == null) {
+        throw new GoraException("Please define the gora to accumulo mapping in " + filename
+ " for " + persistentClass.getCanonicalName());
+      }
       
       nl = root.getElementsByTagName("table");
       for (int i = 0; i < nl.getLength(); i++) {
@@ -535,6 +540,11 @@ public class AccumuloStore<K,T extends P
         
         Object o = val.get(i);
         Pair<Text,Text> col = mapping.fieldMap.get(field.name());
+
+        if (col == null) {
+          throw new GoraException("Please define the gora to accumulo mapping for field "
+ field.name());
+        }
+
   
         switch (field.schema().getType()) {
           case MAP:



Mime
View raw message