Tracing.trace("Acquiring {} counter locks", cfIds.size());
for (UUID cfId : cfIds)
{
Lock lock = keyspace.getColumnFamilyStore(cfId).counterLockFor(key());
if (!lock.tryLock(getTimeout(), TimeUnit.MILLISECONDS))
throw new WriteTimeoutException(WriteType.COUNTER, consistency(), 0, consistency().blockFor(keyspace));
locks.add(lock);
}
for (ColumnFamily cf : getColumnFamilies())
result.add(processModifications(cf));
result.apply();
updateCounterCache(result, keyspace);
return result;
}
catch (InterruptedException e)
{
throw new WriteTimeoutException(WriteType.COUNTER, consistency(), 0, consistency().blockFor(keyspace));
}
finally
{
for (Lock lock : locks)
lock.unlock();