@Override
public TimelineWriteResponse write(TimelineCollectorContext context,
TimelineDomain domain)
throws IOException {
TimelineWriteResponse putStatus = new TimelineWriteResponse();
String clusterId = context.getClusterId();
String domainId = domain.getId();
if (clusterId == null) {
LOG.warn(
"Found null for clusterId. Not proceeding with writing to hbase");
return putStatus;
}
DomainRowKey domainRowKey = new DomainRowKey(clusterId, domainId);
byte[] rowKey = domainRowKey.getRowKey();
ColumnRWHelper.store(rowKey, domainTable, DomainColumn.CREATED_TIME, null,
domain.getCreatedTime());
ColumnRWHelper.store(rowKey, domainTable, DomainColumn.DESCRIPTION, null,
domain.getDescription());
ColumnRWHelper
.store(rowKey, domainTable, DomainColumn.MODIFICATION_TIME, null,
domain.getModifiedTime());
ColumnRWHelper.store(rowKey, domainTable, DomainColumn.OWNER, null,
domain.getOwner());
ColumnRWHelper.store(rowKey, domainTable, DomainColumn.READERS, null,
domain.getReaders());
ColumnRWHelper.store(rowKey, domainTable, DomainColumn.WRITERS, null,
domain.getWriters());
return putStatus;
}