@Test public void removeAndNotifyKeysIsNotInvokedIfKeysNotLocked() throws Exception { PutAllPRMessage message = spy(new PutAllPRMessage(bucketId, 1, false, false, false, null)); RegionDestroyedException regionDestroyedException = new RegionDestroyedException("", ""); message.addEntry(entryData); doReturn(keys).when(message).getKeysToBeLocked(); when(bucketRegion.waitUntilLocked(keys)).thenThrow(regionDestroyedException); message.doLocalPutAll(partitionedRegion, mock(InternalDistributedMember.class), 1); verify(bucketRegion, never()).removeAndNotifyKeys(eq(keys)); verify(dataStore).checkRegionDestroyedOnBucket(eq(bucketRegion), eq(true), eq(regionDestroyedException)); }
@Test public void removeAndNotifyKeysIsNotInvokedIfKeysNotLocked() throws Exception { RemoveAllPRMessage message = spy(new RemoveAllPRMessage(bucketId, 1, false, false, true, null)); message.addEntry(entryData); doReturn(keys).when(message).getKeysToBeLocked(); RegionDestroyedException regionDestroyedException = new RegionDestroyedException("", ""); when(bucketRegion.waitUntilLocked(keys)).thenThrow(regionDestroyedException); message.doLocalRemoveAll(partitionedRegion, mock(InternalDistributedMember.class), true); verify(bucketRegion, never()).removeAndNotifyKeys(eq(keys)); verify(dataStore).checkRegionDestroyedOnBucket(eq(bucketRegion), eq(true), eq(regionDestroyedException)); } }
public void updateEntryVersionLocally(Integer bucketId, EntryEventImpl event) throws ForceReattemptException { if (logger.isDebugEnabled()) { logger.debug("updateEntryVersionLocally: bucketId={}{}{} for key={}", this.partitionedRegion.getPRId(), PartitionedRegion.BUCKET_ID_SEPARATOR, bucketId, event.getKey()); } final BucketRegion bucketRegion = getInitializedBucketForId(event.getKey(), bucketId); try { event.setRegion(bucketRegion); bucketRegion.basicUpdateEntryVersion(event); // bug 34361: don't send a reply if bucket was destroyed during the op bucketRegion.checkReadiness(); } catch (RegionDestroyedException rde) { checkRegionDestroyedOnBucket(bucketRegion, event.isOriginRemote(), rde); } } }
public boolean putLocally(final BucketRegion bucketRegion, final EntryEventImpl event, boolean ifNew, boolean ifOld, Object expectedOldValue, boolean requireOldValue, final long lastModified) throws PrimaryBucketException, ForceReattemptException { boolean didPut = false; // false if entry put fails // final BucketRegion bucketRegion = getInitializedBucketForId(event.getKey(), bucketId); try { event.setRegion(bucketRegion); if (event.isOriginRemote()) { didPut = bucketRegion.basicUpdate(event, ifNew, ifOld, lastModified, false); } else { // Skip yet another validation didPut = bucketRegion.virtualPut(event, ifNew, ifOld, expectedOldValue, requireOldValue, lastModified, false); } // bug 34361: don't send a reply if bucket was destroyed during the op bucketRegion.checkReadiness(); } catch (RegionDestroyedException rde) { checkRegionDestroyedOnBucket(bucketRegion, event.isOriginRemote(), rde); } return didPut; }
checkRegionDestroyedOnBucket(bucketRegion, event.isOriginRemote(), rde);
checkRegionDestroyedOnBucket(bucketRegion, event.isOriginRemote(), new RegionDestroyedException( "Region has been destroyed", checkRegionDestroyedOnBucket(bucketRegion, event.isOriginRemote(), rde);
checkRegionDestroyedOnBucket(bucketRegion, event.isOriginRemote(), rde);
ds.checkRegionDestroyedOnBucket(bucketRegion, true, e); } finally { if (locked) {
ds.checkRegionDestroyedOnBucket(bucketRegion, true, e); } finally { if (locked) {