synchronized CountingReentrantLock<K> getLock(K key) { CountingReentrantLock<K> lock = locks.get(key); if (lock == null) { lock = new CountingReentrantLock<K>(key); locks.put(key, lock); } lock.count++; return lock; }
writeLocks.getLock(new EntityIdentifier(entity.getEntityId(), entity.getEntityType())); lock.lock(); WriteBatch writeBatch = null; List<EntityIdentifier> relatedEntitiesWithoutStartTimes = handleError(entity, response, TimelinePutError.IO_EXCEPTION); } finally { lock.unlock(); writeLocks.returnLock(lock); IOUtils.cleanupWithLogger(LOG, writeBatch); lock.lock(); try { StartAndInsertTime relatedEntityStartAndInsertTime = handleError(entity, response, TimelinePutError.IO_EXCEPTION); } finally { lock.unlock(); writeLocks.returnLock(lock);
writeLocks.getLock(new EntityIdentifier(entity.getEntityId(), entity.getEntityType())); lock.lock(); WriteBatch writeBatch = null; List<EntityIdentifier> relatedEntitiesWithoutStartTimes = handleError(entity, response, TimelinePutError.IO_EXCEPTION); } finally { lock.unlock(); writeLocks.returnLock(lock); IOUtils.cleanup(LOG, writeBatch); lock.lock(); try { StartAndInsertTime relatedEntityStartAndInsertTime = handleError(entity, response, TimelinePutError.IO_EXCEPTION); } finally { lock.unlock(); writeLocks.returnLock(lock);
writeLocks.getLock(new EntityIdentifier(entity.getEntityId(), entity.getEntityType())); lock.lock(); WriteBatch writeBatch = null; List<EntityIdentifier> relatedEntitiesWithoutStartTimes = handleError(entity, response, TimelinePutError.IO_EXCEPTION); } finally { lock.unlock(); writeLocks.returnLock(lock); IOUtils.cleanup(LOG, writeBatch); lock.lock(); try { StartAndInsertTime relatedEntityStartAndInsertTime = handleError(entity, response, TimelinePutError.IO_EXCEPTION); } finally { lock.unlock(); writeLocks.returnLock(lock);
synchronized CountingReentrantLock<K> getLock(K key) { CountingReentrantLock<K> lock = locks.get(key); if (lock == null) { lock = new CountingReentrantLock<K>(key); locks.put(key, lock); } lock.count++; return lock; }
synchronized CountingReentrantLock<K> getLock(K key) { CountingReentrantLock<K> lock = locks.get(key); if (lock == null) { lock = new CountingReentrantLock<K>(key); locks.put(key, lock); } lock.count++; return lock; }