/** * Returns the lock lease value to use for DistributedLock and RegionDistributedLock. -1 is * supported as non-expiring lock. */ long getLockLeaseForLock() { // package-private to avoid synthetic accessor if (getCache().getLockLease() == -1) { return -1; } return (getCache().getLockLease()) * 1000L; }
when(lr.getCache()).thenReturn(cache); when(lr.getCacheDistributionAdvisor()).thenReturn(advisor); when(lr.getDistributionManager()).thenReturn(dm);
@Override public long postRemoveAllSend(DistributedRemoveAllOperation op, VersionedObjectList successfulOps) { long token = -1; if (op.removeAllDataSize > 0) { token = op.startOperation(); } else { getCache().getLogger().fine("DR.postRemoveAll: no data to distribute"); } return token; }
/** * Return the DistributedLockService associated with this Region. This method will lazily create * that service the first time it is invoked on this region. */ public DistributedLockService getLockService() { synchronized (this.dlockMonitor) { String dlsName = getFullPath(); if (this.dlockService == null) { this.dlockService = DistributedLockService.getServiceNamed(dlsName); if (this.dlockService == null) { // region destroy will destroy dls and manual freeResources only this.dlockService = DLockService.create(getFullPath(), getSystem(), true, false, false); } // handle is-lock-grantor region attribute... if (this.isLockGrantor) { this.dlockService.becomeLockGrantor(); } if (logger.isDebugEnabled()) { logger.debug("LockService for {} is using LockLease={}, LockTimeout={}", dlsName, getCache().getLockLease(), getCache().getLockTimeout()); } } return this.dlockService; } }
@Override @Retained protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { EntryEventImpl ev = createEntryEvent(rgn); boolean evReturned = false; try { ev.setEventId(this.eventId); ev.setOldValueFromRegion(); if (this.filterRouting != null) { ev.setLocalFilterInfo(this.filterRouting.getFilterInfo(rgn.getCache().getMyId())); } ev.setTailKey(tailKey); evReturned = true; return ev; } finally { if (!evReturned) ev.release(); } }
if (rgn.getCache().isClosed()) { return false;
synchronized (rgn.getCache().getTombstoneService().getBlockGCLock()) { if (goWithFullGII(rgn, this.versionVector)) { if (isGiiDebugEnabled) { } else { int count = rgn.getCache().getTombstoneService().incrementGCBlockCount(); markedOngoingGII = true; if (isGiiDebugEnabled) { } finally { if (markedOngoingGII) { int count = rgn.getCache().getTombstoneService().decrementGCBlockCount(); assert count >= 0; if (count == 0) {
ev.context = context; Object entryValue = entry.getValue(rgn.getCache()); if (entryValue == null && rgn.getDataPolicy() == DataPolicy.NORMAL) { ev.setLocalInvalid(true);