in hbase-client/src/main/java/org/apache/omid/transaction/HBaseSyncPostCommitter.java [99:133]
public ListenableFuture<Void> updateShadowCells(AbstractTransaction<? extends CellId> transaction) {
SettableFuture<Void> updateSCFuture = SettableFuture.create();
HBaseTransaction tx = HBaseTransactionManager.enforceHBaseTransactionAsParam(transaction);
shadowCellsUpdateTimer.start();
try {
Map<TableName,List<Mutation>> mutations = new HashMap<>();
// Add shadow cells
for (HBaseCellId cell : tx.getWriteSet()) {
addShadowCell(cell, tx, updateSCFuture, mutations);
}
for (HBaseCellId cell : tx.getConflictFreeWriteSet()) {
addShadowCell(cell, tx, updateSCFuture, mutations);
}
for (Map.Entry<TableName,List<Mutation>> entry: mutations.entrySet()) {
flushMutations(entry.getKey(), entry.getValue());
}
//Only if all is well we set to null and delete commit entry from commit table
updateSCFuture.set(null);
} catch (IOException | InterruptedException e) {
LOG.warn("{}: Error inserting shadow cells", tx, e);
updateSCFuture.setException(
new TransactionManagerException(tx + ": Error inserting shadow cells ", e));
} finally {
shadowCellsUpdateTimer.stop();
}
return updateSCFuture;
}