@Override
public Row<T, K> mutate(K row, Mutator<T> tMutator, Creator<T> tCreator) throws AvroBaseException {
Row<T, K> tRow;
do {
tRow = get(row);
if (tRow == null && tCreator != null) {
final T newValue = tCreator.create();
if (newValue != null) {
tRow = new Row<T,K>(newValue, row, 0);
}
}
if (tRow != null) {
T value = tMutator.mutate(tRow.value);
if (value == null) return tRow;
if (put(row, value, tRow.version)) {
return new Row<T, K>(value, row, tRow.version + 1);
}
} else {
return null;
}
} while (true);
}