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 Wed, 17 Aug 2016 23:15:21 GMT

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

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

GitHub user cguzel opened a pull request:

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

    GORA-487 Edited AccumuloStore.java duplicate code lines

    The code lines have already been in org.apache.gora.util.IOUtils

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cguzel/gora-couchdb GORA-487

Alternatively you can review and apply these changes as the patch at:

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

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #76
    
----
commit 6428e5d0d82aec4dfc8511f9e9d9ff5477b4dc31
Author: cihad guzel <cguzelg@gmail.com>
Date:   2016-08-17T19:45:50Z

    GORA-487 Edited AccumuloStore.java duplicate code lines

----


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



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

Mime
View raw message