final void lockPendingGII() { if (!this.pendingGIITXLocked) { this.pendingGIITXLocked = this.region.getImageState() .lockPendingTXRegionStates(false, false); } }
public final void unlockGII() { final ImageState imgState = this.region.getImageState(); imgState.unlockPendingTXRegionStates(false); }
private void unlockRIReadLock() { assert getImageState().isClient(); getImageState().readUnlockRI(); }
private void unlockRIReadLock() { assert getImageState().isClient(); getImageState().readUnlockRI(); }
/** * Callers of this method should always follow the call with: if (lockRIReadLock()) { * try { } finally { unlockRIReadLock(); } } * * @return true if lock obtained and unlock needs to be called */ private boolean lockRIReadLock() { if (getImageState().isClient()) { getImageState().readLockRI(); return true; } else { return false; } }
/** * Callers of this method should always follow the call with: if (lockRIReadLock()) { * try { } finally { unlockRIReadLock(); } } * * @return true if lock obtained and unlock needs to be called */ private boolean lockRIReadLock() { if (getImageState().isClient()) { getImageState().readLockRI(); return true; } else { return false; } }
public void startRegisterInterest() { getImageState().writeLockRI(); try { cache.registerInterestStarted(); this.riCnt++; } finally { getImageState().writeUnlockRI(); } }
/** * Check if GII for the underlying region including for TXRegionState, if any, * is complete. In case it is not complete, then it will also acquire the lock * to sync against a concurrent GII for this TXRegionState. The lock should be * released by invoking {@link #unlockGII()} or * {@link #addPendingTXOpAndUnlockGII}. * * @return true if the underlying region has been initialized at least for * this TXRegionState, and false otherwise in which case it will lock * GII ops on this TXRegionState until {@link #unlockGII()} is invoked */ public final boolean isInitializedAndLockGII() { if (this.pendingTXOps == null) { return true; } // if region is in the process of final initialization, then wait // for it since GII will also bring TXRegionState up-to-date final ImageState imgState = this.region.getImageState(); return !imgState.lockPendingTXRegionStates(false, false); }
public void startRegisterInterest() { getImageState().writeLockRI(); try { cache.registerInterestStarted(); this.riCnt++; } finally { getImageState().writeUnlockRI(); } }
/** removes any destroyed entries from the region and clear the destroyedKeys * assert: Caller must be holding writeLock on is */ private void destroyEntriesAndClearDestroyedKeysSet() { ImageState is = getImageState(); Iterator iter = is.getDestroyedEntries(); while (iter.hasNext()) { Object key = iter.next(); // destroy the entry which has value Token.DESTROYED // If it is Token.DESTROYED then only destroy it. this.entries.removeIfDestroyed(key); // fixes bug 41957 } }
/** removes any destroyed entries from the region and clear the destroyedKeys * assert: Caller must be holding writeLock on is */ private void destroyEntriesAndClearDestroyedKeysSet() { ImageState is = getImageState(); Iterator iter = is.getDestroyedEntries(); while (iter.hasNext()) { Object key = iter.next(); // destroy the entry which has value Token.DESTROYED // If it is Token.DESTROYED then only destroy it. this.entries.removeIfDestroyed(key); // fixes bug 41957 } }
void unlockGII() { ImageState is = getImageState(); assert is.isReplicate(); is.unlockGII(); }
void unlockGII() { ImageState is = getImageState(); assert is.isReplicate(); is.unlockGII(); }
/** * Called by lower levels, while still holding the write sync lock, and the * low level has completed its part of the basic destroy */ void txApplyDestroyPart2(RegionEntry re, Object key, boolean inTokenMode, boolean clearConflict) { if (this.testCallable != null) { this.testCallable.call(this, Operation.DESTROY, re); } if (inTokenMode) { getImageState().addDestroyedEntry(key); } else { updateStatsForDestroy(); } if (this.entryUserAttributes != null) { this.entryUserAttributes.remove(key); } }
/** * Called by lower levels, while still holding the write sync lock, and the * low level has completed its part of the basic destroy */ void txApplyDestroyPart2(RegionEntry re, Object key, boolean inTokenMode, boolean clearConflict) { if (this.testCallable != null) { this.testCallable.call(this, Operation.DESTROY, re); } if (inTokenMode) { getImageState().addDestroyedEntry(key); } else { updateStatsForDestroy(); } if (this.entryUserAttributes != null) { this.entryUserAttributes.remove(key); } }
public void afterRegionClear(RegionEvent event) { getLogWriter().info("**********Received clear event in VM0 . "); Region rgn = event.getRegion(); wasGIIInProgressDuringClear = ((LocalRegion) rgn).getImageState() .wasRegionClearedDuringGII(); InitialImageOperation.slowImageProcessing = 0; InitialImageOperation.slowImageSleeps = 0; getLogWriter().info( "wasGIIInProgressDuringClear when clear event was received= " + wasGIIInProgressDuringClear); } }
/** * Callers of this method should always follow the call with: if (lockGII()) { * try { } finally { unlockGII(); } } * * @return true if lock obtained and unlock needs to be called */ boolean lockGII() { ImageState is = getImageState(); if (is.isReplicate() && !isInitialized()) { is.lockGII(); // recheck initialized while holding lock if (isInitialized()) { // we didn't need to lock after all so clear and return false is.unlockGII(); } else { return true; } } return false; }
/** * Callers of this method should always follow the call with: if (lockGII()) { * try { } finally { unlockGII(); } } * * @return true if lock obtained and unlock needs to be called */ boolean lockGII() { ImageState is = getImageState(); if (is.isReplicate() && !isInitialized()) { is.lockGII(); // recheck initialized while holding lock if (isInitialized()) { // we didn't need to lock after all so clear and return false is.unlockGII(); } else { return true; } } return false; }
protected void createEntry(EntryEventImpl event, final LocalRegion owner, RegionEntry re) throws RegionClearedException { final boolean wasTombstone = re.isTombstone(); processVersionTag(re, event); event.putNewEntry(owner, re); updateSize(event, 0, false, wasTombstone); if (!event.getLocalRegion().isInitialized()) { owner.getImageState().removeDestroyedEntry(event.getKey()); } }
protected void createEntry(EntryEventImpl event, final LocalRegion owner, RegionEntry re) throws RegionClearedException { final boolean wasTombstone = re.isTombstone(); processVersionTag(re, event); event.putNewEntry(owner, re); updateSize(event, 0, false, wasTombstone); if (!event.getLocalRegion().isInitialized()) { owner.getImageState().removeDestroyedEntry(event.getKey()); } }