public boolean finishCommit(CommitData cd, Stamp commitStamp) throws TableNotFoundException,
MutationsRejectedException {
long commitTs = commitStamp.getTxTimestamp();
ArrayList<Mutation> mutations = new ArrayList<>(updates.size() + 1);
for (Entry<Bytes, Map<Column, Bytes>> rowUpdates : updates.entrySet()) {
Flutation m = new Flutation(env, rowUpdates.getKey());
boolean isTriggerRow = isTriggerRow(rowUpdates.getKey());
for (Entry<Column, Bytes> colUpdates : rowUpdates.getValue().entrySet()) {
ColumnUtil.commitColumn(env,
isTriggerRow && colUpdates.getKey().equals(notification.getColumn()), false,
colUpdates.getKey(), colUpdates.getValue() != null, colUpdates.getValue() == DELETE,
startTs, commitTs, observedColumns, m);
}
mutations.add(m);
}
ArrayList<Mutation> afterFlushMutations = new ArrayList<>(2);
Flutation m = new Flutation(env, cd.prow);
m.put(cd.pcol, ColumnConstants.TX_DONE_PREFIX | commitTs, EMPTY);
afterFlushMutations.add(m);
if (weakNotification != null) {
afterFlushMutations.add(weakNotification.newDelete(env, startTs));
}
if (notification != null) {
afterFlushMutations.add(notification.newDelete(env, startTs));
}
env.getSharedResources().getBatchWriter().writeMutationsAsync(mutations, afterFlushMutations);
return true;
}