gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lewis John McGibbney (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GORA-204) Don't store empty arrays in CassandraClient#addGenericArray(), addStatefulHashMap() and CassandraStore#addOrUpdateField()
Date Sat, 09 Feb 2013 22:15:12 GMT

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

Lewis John McGibbney updated GORA-204:
--------------------------------------

    Description: 
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.

  was:
We have two 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}

and 

{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}

in assGenericArray and addStateulHashMap respectively.

    
> 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, storage-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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message