blurIndex.replaceRow(mutation.waitToBeVisible, mutation.wal, updateMetrics(newRow));
}
private static void doUpdateRecordMutation(RecordMutation recordMutation, Record existingRecord, Row newRow) {
Record mutationRecord = recordMutation.record;
switch (recordMutation.recordMutationType) {
case DELETE_ENTIRE_RECORD:
return;
case APPEND_COLUMN_VALUES:
for (Column column : mutationRecord.columns) {
existingRecord.addToColumns(column);
}
newRow.addToRecords(existingRecord);
break;
case REPLACE_ENTIRE_RECORD:
newRow.addToRecords(mutationRecord);
break;
case REPLACE_COLUMNS:
Set<String> columnNames = new HashSet<String>();
for (Column column : mutationRecord.columns) {
columnNames.add(column.name);
}
LOOP: for (Column column : existingRecord.columns) {
// skip columns in existing record that are contained in the mutation
// record
if (columnNames.contains(column.name)) {
continue LOOP;
}
mutationRecord.addToColumns(column);
}
newRow.addToRecords(mutationRecord);
break;
default:
break;