Repository: gora Updated Branches: refs/heads/master 1242a61db -> 7c0e34eb9
Resolve errorneous error logging in reading HBase mapping file Project: http://git-wip-us.apache.org/repos/asf/gora/repo Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/7c0e34eb Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/7c0e34eb Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/7c0e34eb Branch: refs/heads/master Commit: 7c0e34eb942ae2fb990795c6ffce1632edfdccac Parents: 1242a61 Author: nishadi <[email protected]> Authored: Sat May 27 12:29:35 2017 +0530 Committer: nishadi <[email protected]> Committed: Sat May 27 12:29:35 2017 +0530 ---------------------------------------------------------------------- .../src/main/java/org/apache/gora/hbase/store/HBaseStore.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/gora/blob/7c0e34eb/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java ---------------------------------------------------------------------- diff --git a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java index 389f5df..869b7aa 100644 --- a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java +++ b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java @@ -759,12 +759,14 @@ implements Configurable { } List<Element> classElements = root.getChildren("class"); + boolean keyClassMatches = false; for(Element classElement: classElements) { if(classElement.getAttributeValue("keyClass").equals( keyClass.getCanonicalName()) && classElement.getAttributeValue("name").equals( persistentClass.getCanonicalName())) { LOG.debug("Keyclass and nameclass match."); + keyClassMatches = true; String tableNameFromMapping = classElement.getAttributeValue("table"); String tableName = getSchemaName(tableNameFromMapping, persistentClass); @@ -790,10 +792,10 @@ implements Configurable { //we found a matching key and value class definition, //do not continue on other class definitions break; - } else { - LOG.error("KeyClass in gora-hbase-mapping is not the same as the one in the databean."); } } + if(!keyClassMatches) + LOG.error("KeyClass in gora-hbase-mapping is not the same as the one in the databean."); } catch (MalformedURLException ex) { LOG.error("Error while trying to read the mapping file {}. " + "Expected to be in the classpath "
