*
* @param record The record to be translated into an HBase {@code Put}
* @return Put which can be directly written to HBase
*/
public Put buildPut(Record record) throws InterruptedException, RepositoryException {
RecordEvent recordEvent = new RecordEvent();
recordEvent.setType(Type.CREATE);
recordEvent.setTableName(hbaseRepo.getTableName());
// set empty IndexRecordFilterData to omit the warnings in the IndexEditFilter
recordEvent.setIndexRecordFilterData(new RecordEvent.IndexRecordFilterData());
if (record.getId() == null) {
record.setId(getIdGenerator().newRecordId());
}
Put put = hbaseRepo.buildPut(record, 1L, fieldTypes, recordEvent, Sets.<BlobReference>newHashSet(),
Sets.<BlobReference>newHashSet(), 1L);
put.add(LilyHBaseSchema.RecordCf.DATA.bytes, LilyHBaseSchema.RecordColumn.PAYLOAD.bytes, recordEvent.toJsonBytes());
return put;
}