use of com.couchbase.client.core.deps.io.netty.handler.timeout.TimeoutException in project connectors-se by Talend.
the class BinaryParser method parse.
@Override
public Record parse(Collection collection, String id) {
GetResult result;
try {
result = collection.get(id, GetOptions.getOptions().transcoder(RawBinaryTranscoder.INSTANCE));
} catch (TimeoutException | CouchbaseException e) {
LOG.error(e.getMessage());
throw new ComponentException(e.getMessage());
}
byte[] data = result.contentAs(byte[].class);
final Record.Builder recordBuilder = builderFactory.newRecordBuilder(schemaBinaryDocument);
recordBuilder.withString("id", id);
recordBuilder.withBytes("content", data);
return recordBuilder.build();
}
Aggregations