You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by "Renato Javier Marroquín Mogrovejo (JIRA)" <ji...@apache.org> on 2014/03/30 12:22:16 UTC

[jira] [Resolved] (GORA-204) Don't store empty arrays in CassandraClient#addGenericArray(), addStatefulHashMap() and CassandraStore#addOrUpdateField()

     [ https://issues.apache.org/jira/browse/GORA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Renato Javier Marroquín Mogrovejo resolved GORA-204.
----------------------------------------------------

    Resolution: Fixed

> Don't store empty arrays in CassandraClient#addGenericArray(), addStatefulHashMap() and CassandraStore#addOrUpdateField()
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GORA-204
>                 URL: https://issues.apache.org/jira/browse/GORA-204
>             Project: Apache Gora
>          Issue Type: Improvement
>          Components: avro, gora-cassandra
>    Affects Versions: 0.2.1
>            Reporter: Lewis John McGibbney
>            Priority: Minor
>             Fix For: 0.4
>
>
> We have three TODO's in this issue.
> Namely 
> {code}
>         // TODO: hack, do not store empty arrays
>         if (itemValue instanceof GenericArray<?>) {
>           if (((GenericArray)itemValue).size() == 0) {
>             continue;
>           }
>         } else if (itemValue instanceof StatefulHashMap<?,?>) {
>           if (((StatefulHashMap)itemValue).size() == 0) {
>             continue;
>           }
>         }
> {code}
> {code}
>         // TODO: hack, do not store empty arrays
>         Object mapValue = map.get(mapKey);
>         if (mapValue instanceof GenericArray<?>) {
>           if (((GenericArray)mapValue).size() == 0) {
>             continue;
>           }
>         } else if (mapValue instanceof StatefulHashMap<?,?>) {
>           if (((StatefulHashMap)mapValue).size() == 0) {
>             continue;
>           }
>         }
> {code}
> and
> {code}
>       case RECORD:
>         if (value != null) {
>           if (value instanceof PersistentBase) {
>             PersistentBase persistentBase = (PersistentBase) value;
>             for (Field member: schema.getFields()) {
>               
>               // TODO: hack, do not store empty arrays
>               Object memberValue = persistentBase.get(member.pos());
>               if (memberValue instanceof GenericArray<?>) {
>                 if (((GenericArray)memberValue).size() == 0) {
>                   continue;
>                 }
>               } else if (memberValue instanceof StatefulHashMap<?,?>) {
>                 if (((StatefulHashMap)memberValue).size() == 0) {
>                   continue;
>                 }
>               }
>               this.cassandraClient.addSubColumn(key, field.name(), member.name(), memberValue);
>             }
>           } else {
>             LOG.info("Record not supported: " + value.toString());
>             
>           }
>         }
>         break;
> {code}
> in addGenericArray and addStateulHashMap in CassandraClient and CassandraStore#addOrUpdateField respectively.



--
This message was sent by Atlassian JIRA
(v6.2#6252)