/** * Checks to make sure that this node is primary, and locks the bucket * to make sure the bucket stays the primary bucket while the write * is in progress. Any call to this method must be followed with a call * to endLocalWrite(). * @param event */ private boolean beginLocalWrite(EntryEventImpl event) { if (skipWriteLock(event)) { return false; } if (cache.isCacheAtShutdownAll()) { throw new CacheClosedException("Cache is shutting down"); } final Object key = event.getKey(); waitUntilLocked(key); // it might wait for long time boolean lockedForPrimary = false; try { doLockForPrimary(false, false); return (lockedForPrimary = true); } finally { if (!lockedForPrimary) { removeAndNotifyKey(key); } } }
/** * Checks to make sure that this node is primary, and locks the bucket * to make sure the bucket stays the primary bucket while the write * is in progress. Any call to this method must be followed with a call * to endLocalWrite(). * @param event */ private boolean beginLocalWrite(EntryEventImpl event) { if(!needWriteLock(event)) { return false; } if (cache.isCacheAtShutdownAll()) { throw new CacheClosedException("Cache is shutting down"); } Object keys[] = new Object[1]; keys[0] = event.getKey(); waitUntilLocked(keys); // it might wait for long time boolean lockedForPrimary = false; try { doLockForPrimary(false); return lockedForPrimary = true; } finally { if (!lockedForPrimary) { removeAndNotifyKeys(keys); } } }
bucketRegion.recordBulkOpStart(membershipID); bucketRegion.waitUntilLocked(keys); boolean lockedForPrimary = false; final ArrayList<Object> succeeded = new ArrayList<Object>();
bucketRegion.recordBulkOpStart(membershipID); bucketRegion.waitUntilLocked(keys); boolean lockedForPrimary = false; final HashMap succeeded = new HashMap();
bucketRegion.waitUntilLocked(keys);