use of org.apache.gobblin.converter.SingleRecordIterable in project incubator-gobblin by apache.
the class AvroToCouchbaseTupleConverter method convertRecord.
@Override
public Iterable<TupleDocument> convertRecord(String outputSchema, GenericRecord inputRecord, WorkUnitState workUnit) throws DataConversionException {
String key = inputRecord.get(keyField).toString();
GenericRecord data = (GenericRecord) inputRecord.get(dataRecordField);
ByteBuffer dataBytes = (ByteBuffer) data.get(valueField);
Integer flags = (Integer) data.get(flagsField);
ByteBuf buffer = Unpooled.copiedBuffer(dataBytes);
return new SingleRecordIterable<>(new TupleDocument(key, Tuple.create(buffer, flags)));
}
Aggregations