gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-487) Using IOUtils methods instead of duplicate code lines
Date Fri, 19 Aug 2016 11:35:20 GMT

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

Hudson commented on GORA-487:
-----------------------------

SUCCESS: Integrated in Jenkins build gora-trunk #1677 (See [https://builds.apache.org/job/gora-trunk/1677/])
GORA-487 Edited AccumuloStore.java duplicate code lines (cguzelg: rev 6428e5d0d82aec4dfc8511f9e9d9ff5477b4dc31)
* (edit) gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
GORA-487 Edited AvroUtils.java duplicate code lines (cguzelg: rev 4192c8751e546890e50da550cc7b8f737c91e502)
* (edit) gora-core/src/main/java/org/apache/gora/util/AvroUtils.java


> Using IOUtils methods instead of 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
>             Fix For: 0.7
>
>
> 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