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

cihad güzel updated GORA-487:
-----------------------------
    Summary: Using IOUtils methods instead of duplicate code lines  (was: 
Editing AccumuloStore.java duplicate code lines)

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

Reply via email to