gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-487) Editing AccumuloStore.java duplicate code lines
Date Fri, 19 Aug 2016 09:17:22 GMT

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

ASF GitHub Bot commented on GORA-487:
-------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/gora/pull/76


> Editing AccumuloStore.java duplicate code lines
> -----------------------------------------------
>
>                 Key: GORA-487
>                 URL: https://issues.apache.org/jira/browse/GORA-487
>             Project: Apache Gora
>          Issue Type: Improvement
>            Reporter: cihad güzel
>            Assignee: cihad güzel
>            Priority: Trivial
>
> You can use
> {code:borderStyle=solid} 
> final SpecificDatumWriter<Object> writer = new SpecificDatumWriter<>(field.schema());
>           final byte[] byteData = IOUtils.serialize(writer,o);
>           m.put(col.getFirst(), col.getSecond(), new Value(byteData));
>           count++;
>           break;
> {code}
> instead of 
> {code:title=AccumuloStore.java|borderStyle=solid}
> case RECORD:
>           SpecificDatumWriter<Object> writer = new SpecificDatumWriter<>(field.schema());
>           ByteArrayOutputStream os = new ByteArrayOutputStream();
>           org.apache.avro.io.BinaryEncoder encoder = EncoderFactory.get().binaryEncoder(os,
null);
>           writer.write(o, encoder);
>           encoder.flush();
>           m.put(col.getFirst(), col.getSecond(), new Value(os.toByteArray()));
>           count++;
>           break;
> {code}
> The code lines have already been in org.apache.gora.util.IOUtils



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message