use of org.apache.geode.internal.cache.AbstractRegionMap.ARMLockTestHook in project geode by apache.
the class DistributedRegion method lockLocallyForClear.
/**
* pause local operations so that a clear() can be performed and flush comm channels to the given
* member
*/
void lockLocallyForClear(DM dm, InternalDistributedMember locker, CacheEvent event) {
RegionVersionVector rvv = getVersionVector();
ARMLockTestHook armLockTestHook = getRegionMap().getARMLockTestHook();
if (armLockTestHook != null) {
armLockTestHook.beforeLock(this, event);
}
if (rvv != null) {
// block new operations from being applied to the region map
rvv.lockForClear(getFullPath(), dm, locker);
// Check for region destroyed after we have locked, to make sure
// we don't continue a clear if the region has been destroyed.
checkReadiness();
// Only need to flush if NOACK at this point
if (this.getAttributes().getScope().isDistributedNoAck()) {
Set<InternalDistributedMember> members = getDistributionAdvisor().adviseCacheOp();
StateFlushOperation.flushTo(members, this);
}
}
if (armLockTestHook != null) {
armLockTestHook.afterLock(this, null);
}
}
use of org.apache.geode.internal.cache.AbstractRegionMap.ARMLockTestHook in project geode by apache.
the class DistributedRegion method releaseWriteLocksForClear.
/**
* releases the locks obtained in obtainWriteLocksForClear
*/
private void releaseWriteLocksForClear(RegionEventImpl regionEvent, Set<InternalDistributedMember> participants) {
ARMLockTestHook armLockTestHook = getRegionMap().getARMLockTestHook();
if (armLockTestHook != null) {
armLockTestHook.beforeRelease(this, regionEvent);
}
getVersionVector().unlockForClear(getMyId());
DistributedClearOperation.releaseLocks(regionEvent, participants);
if (armLockTestHook != null) {
armLockTestHook.afterRelease(this, regionEvent);
}
}
Aggregations