gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renato Javier Marroquín Mogrovejo (JIRA) <j...@apache.org>
Subject [jira] [Commented] (GORA-204) Don't store empty arrays in CassandraClient#addGenericArray(), addStatefulHashMap() and CassandraStore#addOrUpdateField()
Date Sat, 29 Mar 2014 22:40:15 GMT

    [ https://issues.apache.org/jira/browse/GORA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13954493#comment-13954493
] 

Renato Javier Marroquín Mogrovejo commented on GORA-204:
--------------------------------------------------------

This has been already fixed in GORA-94 branch during GORA-245.
Let's way until we merge the two branches and then we can close this.

> 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)

Mime
View raw message