/** * Release the lock on the bucket that makes the bucket * stay the primary during a write. */ private void endLocalWrite(EntryEventImpl event) { doUnlockForPrimary(); removeAndNotifyKey(event.getKey()); }
if (!isPrimary) { if (moveWriteLock) doUnlockForPrimaryMove(); else doUnlockForPrimary();
/** * Release the lock on the bucket that makes the bucket * stay the primary during a write. */ private void endLocalWrite(EntryEventImpl event) { if(!needWriteLock(event)) { return; } doUnlockForPrimary(); Object keys[] = new Object[1]; keys[0] = event.getKey(); removeAndNotifyKeys(keys); }
if (r instanceof BucketRegion && (((BucketRegion)r).getBucketAdvisor().isPrimary())) { try { ((BucketRegion)r).doUnlockForPrimary(); } catch(RegionDestroyedException rde) {
/** * lock this bucket and, if present, its colocated "parent" * @param tryLock - whether to use tryLock (true) or a blocking lock (false) * @return true if locks were obtained and are still held */ public boolean doLockForPrimary(boolean tryLock) { boolean locked = lockPrimaryStateReadLock(tryLock); if(!locked) { return false; } boolean isPrimary = false; try { // Throw a PrimaryBucketException if this VM is assumed to be the // primary but isn't, preventing update and distribution checkForPrimary(); if (cache.isCacheAtShutdownAll()) { throw new CacheClosedException("Cache is shutting down"); } isPrimary = true; } finally { if(!isPrimary) { doUnlockForPrimary(); } } return true; }
br.doUnlockForPrimary(); } catch (Exception e) {
@Override final void performExpiryTimeout(ExpiryTask p_task) throws CacheException { ExpiryTask task = p_task; boolean isEvictDestroy = isEntryEvictDestroyEnabled(); //Fix for bug 43805 - get the primary lock before //synchronizing on pendingSecondaryExpires, to match the lock //ordering in other place (like acquiredPrimaryLock) lockPrimaryStateReadLock(false); try { // Why do we care if evict destroy is configured? // See bug 41096 for the answer. if(!getBucketAdvisor().isPrimary() && !isEvictDestroy) { synchronized (this.pendingSecondaryExpires) { if (task.isPending()) { Object key = task.getKey(); if (key != null) { this.pendingSecondaryExpires.put(key, task); } } } } else { super.performExpiryTimeout(task); } } finally { doUnlockForPrimary(); } }
@Override final void performExpiryTimeout(ExpiryTask p_task) throws CacheException { ExpiryTask task = p_task; boolean isEvictDestroy = isEntryEvictDestroyEnabled(); //Fix for bug 43805 - get the primary lock before //synchronizing on pendingSecondaryExpires, to match the lock //ordering in other place (like acquiredPrimaryLock) lockPrimaryStateReadLock(false); try { // Why do we care if evict destroy is configured? // See bug 41096 for the answer. if(!getBucketAdvisor().isPrimary() && !isEvictDestroy) { synchronized (this.pendingSecondaryExpires) { if (task.isPending()) { Object key = task.getKey(); if (key != null) { this.pendingSecondaryExpires.put(key, task); } } } } else { super.performExpiryTimeout(task); } } finally { doUnlockForPrimary(); } }
} finally { if (lockedForPrimary) { bucketRegion.doUnlockForPrimary();
} finally { if (lockedForPrimary) { bucketRegion.doUnlockForPrimary();
bucketRegion.doUnlockForPrimary();