gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cihad güzel (JIRA) <j...@apache.org>
Subject [jira] [Created] (GORA-487) Editing AccumuloStore.java duplicate code lines
Date Wed, 17 Aug 2016 23:01:20 GMT
cihad güzel created GORA-487:
--------------------------------

             Summary: 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