Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
0.6.1
-
None
Description
You can use
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;
instead of
AccumuloStore.java
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;
The code lines have already been in org.apache.gora.util.IOUtils
Attachments
Issue Links
- links to