// If we haven't got any rows in our batch, we should block to
// get the next one.
boolean shouldBlock = numReadyToWrite == 0;
boolean failedToAcquire = false;
Integer acquiredLockId = null;
HashedBytes currentRow = new HashedBytes(mutation.getRow());
try {
if (providedLockId != null || !rowsAlreadyLocked.contains(currentRow)) {
acquiredLockId = getLock(providedLockId, currentRow, shouldBlock);
if (acquiredLockId == null) {
failedToAcquire = true;