You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2019/04/04 22:44:06 UTC
[geode] branch develop updated: GEODE-6534: Remove unnecessary uses
of this in LocalRegion
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new e1c15bb GEODE-6534: Remove unnecessary uses of this in LocalRegion
e1c15bb is described below
commit e1c15bbd4e01fd935ebb6740b56f283d1a252b56
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Wed Apr 3 13:45:20 2019 -0700
GEODE-6534: Remove unnecessary uses of this in LocalRegion
---
.../apache/geode/internal/cache/LocalRegion.java | 1240 ++++++++++----------
1 file changed, 620 insertions(+), 620 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index 3ba3494..2c3ef63 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -515,7 +515,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public CancelCriterion getCancelCriterion() {
- return this.stopper;
+ return stopper;
}
private final CopyOnWriteHashMap<String, CacheServiceProfile> cacheServiceProfiles =
@@ -560,20 +560,20 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
this.entryEventFactory = entryEventFactory;
// Initialized here (and defers to parent) to fix GEODE-128
- this.EXPIRY_UNITS_MS = parentRegion != null ? parentRegion.EXPIRY_UNITS_MS
+ EXPIRY_UNITS_MS = parentRegion != null ? parentRegion.EXPIRY_UNITS_MS
: Boolean.getBoolean(EXPIRY_MS_PROPERTY);
Assert.assertTrue(regionName != null, "regionName must not be null");
- this.sharedDataView = internalDataView;
+ sharedDataView = internalDataView;
this.regionName = regionName;
this.parentRegion = parentRegion;
- this.fullPath = calcFullPath(regionName, parentRegion);
+ fullPath = calcFullPath(regionName, parentRegion);
String myName = getFullPath();
if (internalRegionArgs.getPartitionedRegion() != null) {
myName = internalRegionArgs.getPartitionedRegion().getFullPath();
}
- this.offHeap = attrs.getOffHeap() || Boolean.getBoolean(myName + ":OFF_HEAP");
+ offHeap = attrs.getOffHeap() || Boolean.getBoolean(myName + ":OFF_HEAP");
if (getOffHeap()) {
if (cache.getOffHeapStore() == null) {
throw new IllegalStateException(
@@ -583,9 +583,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
}
- this.initializationLatchBeforeGetInitialImage = new StoppableCountDownLatch(this.stopper, 1);
- this.initializationLatchAfterGetInitialImage = new StoppableCountDownLatch(this.stopper, 1);
- this.afterRegionCreateEventLatch = new StoppableCountDownLatch(this.stopper, 1);
+ initializationLatchBeforeGetInitialImage = new StoppableCountDownLatch(stopper, 1);
+ initializationLatchAfterGetInitialImage = new StoppableCountDownLatch(stopper, 1);
+ afterRegionCreateEventLatch = new StoppableCountDownLatch(stopper, 1);
if (internalRegionArgs.getUserAttribute() != null) {
setUserAttribute(internalRegionArgs.getUserAttribute());
@@ -593,25 +593,25 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
initializingRegion.set(this);
if (internalRegionArgs.getCachePerfStatsHolder() != null) {
- this.hasOwnStats = false;
- this.cachePerfStats = internalRegionArgs.getCachePerfStatsHolder().getCachePerfStats();
+ hasOwnStats = false;
+ cachePerfStats = internalRegionArgs.getCachePerfStatsHolder().getCachePerfStats();
} else {
if (attrs.getPartitionAttributes() != null || isInternalRegion()
|| internalRegionArgs.isUsedForMetaRegion()) {
- this.hasOwnStats = false;
- this.cachePerfStats = cache.getCachePerfStats();
+ hasOwnStats = false;
+ cachePerfStats = cache.getCachePerfStats();
} else {
- this.hasOwnStats = true;
- this.cachePerfStats = new RegionPerfStats(
+ hasOwnStats = true;
+ cachePerfStats = new RegionPerfStats(
cache.getInternalDistributedSystem().getStatisticsManager(), cache.getCachePerfStats(),
regionName);
}
}
- this.diskStoreImpl = findDiskStore(attrs, internalRegionArgs);
- this.diskRegion = createDiskRegion(internalRegionArgs);
- this.entries = createRegionMap(internalRegionArgs);
- this.subregions = new ConcurrentHashMap();
+ diskStoreImpl = findDiskStore(attrs, internalRegionArgs);
+ diskRegion = createDiskRegion(internalRegionArgs);
+ entries = createRegionMap(internalRegionArgs);
+ subregions = new ConcurrentHashMap();
// we only need a destroy lock if this is a root
if (parentRegion == null) {
@@ -619,19 +619,19 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
if (internalRegionArgs.getLoaderHelperFactory() != null) {
- this.loaderHelperFactory = internalRegionArgs.getLoaderHelperFactory();
+ loaderHelperFactory = internalRegionArgs.getLoaderHelperFactory();
} else {
- this.loaderHelperFactory = this;
+ loaderHelperFactory = this;
}
- this.isUsedForPartitionedRegionAdmin = internalRegionArgs.isUsedForPartitionedRegionAdmin();
- this.isUsedForPartitionedRegionBucket = internalRegionArgs.isUsedForPartitionedRegionBucket();
- this.isUsedForMetaRegion = internalRegionArgs.isUsedForMetaRegion();
- this.isMetaRegionWithTransactions = internalRegionArgs.isMetaRegionWithTransactions();
- this.isUsedForSerialGatewaySenderQueue = internalRegionArgs.isUsedForSerialGatewaySenderQueue();
- this.isUsedForParallelGatewaySenderQueue =
+ isUsedForPartitionedRegionAdmin = internalRegionArgs.isUsedForPartitionedRegionAdmin();
+ isUsedForPartitionedRegionBucket = internalRegionArgs.isUsedForPartitionedRegionBucket();
+ isUsedForMetaRegion = internalRegionArgs.isUsedForMetaRegion();
+ isMetaRegionWithTransactions = internalRegionArgs.isMetaRegionWithTransactions();
+ isUsedForSerialGatewaySenderQueue = internalRegionArgs.isUsedForSerialGatewaySenderQueue();
+ isUsedForParallelGatewaySenderQueue =
internalRegionArgs.isUsedForParallelGatewaySenderQueue();
- this.serialGatewaySender = internalRegionArgs.getSerialGatewaySender();
+ serialGatewaySender = internalRegionArgs.getSerialGatewaySender();
if (internalRegionArgs.getCacheServiceProfiles() != null) {
addCacheServiceProfiles(internalRegionArgs);
}
@@ -639,21 +639,21 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (!isUsedForMetaRegion && !isUsedForPartitionedRegionAdmin
&& !isUsedForPartitionedRegionBucket && !isUsedForSerialGatewaySenderQueue
&& !isUsedForParallelGatewaySenderQueue) {
- this.filterProfile = new FilterProfile(this);
+ filterProfile = new FilterProfile(this);
}
// initialize client to server proxy
- this.serverRegionProxy =
- this.getPoolName() != null ? serverRegionProxyConstructor.create(this) : null;
- this.imageState = new UnsharedImageState(getPoolName() != null,
+ serverRegionProxy =
+ getPoolName() != null ? serverRegionProxyConstructor.create(this) : null;
+ imageState = new UnsharedImageState(getPoolName() != null,
getDataPolicy().withReplication() || getDataPolicy().isPreloaded(),
- getAttributes().getDataPolicy().withPersistence(), this.stopper);
+ getAttributes().getDataPolicy().withPersistence(), stopper);
// prevent internal regions from participating in a TX, bug 38709
- this.supportsTX = !isSecret() && !isUsedForPartitionedRegionAdmin() && !isUsedForMetaRegion()
+ supportsTX = !isSecret() && !isUsedForPartitionedRegionAdmin() && !isUsedForMetaRegion()
|| isMetaRegionWithTransactions();
- this.testCallable = internalRegionArgs.getTestCallable();
+ testCallable = internalRegionArgs.getTestCallable();
eventTracker = createEventTracker();
versionVector = createRegionVersionVector();
@@ -712,7 +712,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private void addCacheServiceProfiles(InternalRegionArguments internalRegionArgs) {
cacheServiceProfileUpdateLock.lock();
try {
- this.cacheServiceProfiles.putAll(internalRegionArgs.getCacheServiceProfiles());
+ cacheServiceProfiles.putAll(internalRegionArgs.getCacheServiceProfiles());
} finally {
cacheServiceProfileUpdateLock.unlock();
}
@@ -724,15 +724,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private RegionMap createRegionMap(InternalRegionArguments internalRegionArgs) {
RegionMap result = null;
- if (this.diskRegion != null) {
- result = this.diskRegion.useExistingRegionMap(this);
+ if (diskRegion != null) {
+ result = diskRegion.useExistingRegionMap(this);
}
if (result == null) {
RegionMap.Attributes ma = new RegionMap.Attributes();
- ma.statisticsEnabled = this.statisticsEnabled;
- ma.loadFactor = this.loadFactor;
- ma.initialCapacity = this.initialCapacity;
- ma.concurrencyLevel = this.concurrencyLevel;
+ ma.statisticsEnabled = statisticsEnabled;
+ ma.loadFactor = loadFactor;
+ ma.initialCapacity = initialCapacity;
+ ma.concurrencyLevel = concurrencyLevel;
result = regionMapConstructor.create(this, ma, internalRegionArgs);
}
return result;
@@ -749,16 +749,16 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
/** returns the regions version-vector */
@Override
public RegionVersionVector getVersionVector() {
- return this.versionVector;
+ return versionVector;
}
/** returns object used to guard the size() operation during tombstone removal */
Object getSizeGuard() {
- if (!this.getConcurrencyChecksEnabled()) {
+ if (!getConcurrencyChecksEnabled()) {
return new Object();
} else {
- return this.fullPath; // avoids creating another sync object - could be anything unique to
- // this region
+ return fullPath; // avoids creating another sync object - could be anything unique to
+ // this region
}
}
@@ -773,12 +773,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private RegionVersionVector createVersionVector() {
RegionVersionVector regionVersionVector = RegionVersionVector.create(getVersionMember(), this);
- if (this.getDataPolicy().withPersistence()) {
+ if (getDataPolicy().withPersistence()) {
// copy the versions that we have recovered from disk into
// the version vector.
RegionVersionVector diskVector = diskRegion.getRegionVersionVector();
regionVersionVector.recordVersions(diskVector.getCloneForTransmission());
- } else if (!this.getDataPolicy().withStorage()) {
+ } else if (!getDataPolicy().withStorage()) {
// version vectors are currently only necessary in empty regions for
// tracking canonical member IDs
regionVersionVector.turnOffRecordingForEmptyRegion();
@@ -800,12 +800,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
boolean isCacheClosing() {
- return this.cache.isClosed();
+ return cache.isClosed();
}
@Override
public RegionEntry getRegionEntry(Object key) {
- return this.entries.getEntry(key);
+ return entries.getEntry(key);
}
/**
@@ -835,7 +835,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
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
+ entries.removeIfDestroyed(key); // fixes bug 41957
}
}
@@ -848,12 +848,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public ServerRegionProxy getServerProxy() {
- return this.serverRegionProxy;
+ return serverRegionProxy;
}
@Override
public boolean hasServerProxy() {
- return this.serverRegionProxy != null;
+ return serverRegionProxy != null;
}
/** Returns true if the ExpiryTask is currently allowed to expire. */
@@ -868,7 +868,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
private void initRoot() {
- this.destroyLock = new Semaphore(1);
+ destroyLock = new Semaphore(1);
}
public void handleMarker() {
@@ -904,15 +904,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public InternalDistributedMember getMyId() {
- return this.cache.getInternalDistributedSystem().getDistributedMember();
+ return cache.getInternalDistributedSystem().getDistributedMember();
}
@Override
public VersionSource getVersionMember() {
- if (this.getDataPolicy().withPersistence()) {
+ if (getDataPolicy().withPersistence()) {
return getDiskStore().getDiskStoreID();
} else {
- return this.cache.getInternalDistributedSystem().getDistributedMember();
+ return cache.getInternalDistributedSystem().getDistributedMember();
}
}
@@ -925,7 +925,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
checkReadiness();
RegionAttributes regionAttributes = attrs;
// TODO: attrs is reassigned but never used
- attrs = this.cache.invokeRegionBefore(this, subregionName, attrs, internalRegionArgs);
+ attrs = cache.invokeRegionBefore(this, subregionName, attrs, internalRegionArgs);
final InputStream snapshotInputStream = internalRegionArgs.getSnapshotInputStream();
final boolean getDestroyLock = internalRegionArgs.getDestroyLockFlag();
@@ -938,7 +938,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
LocalRegion existing = null;
try {
if (isDestroyed()) {
- if (this.reinitialized_old) {
+ if (reinitialized_old) {
throw new RegionReinitializedException(toString(), getFullPath());
}
throw new RegionDestroyedException(toString(), getFullPath());
@@ -951,9 +951,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// to prevent other threads from adding a region to it in toRegion
// but don't wait on initialization while synchronized (distributed
// deadlock)
- synchronized (this.subregionsLock) {
+ synchronized (subregionsLock) {
- existing = (LocalRegion) this.subregions.get(subregionName);
+ existing = (LocalRegion) subregions.get(subregionName);
if (existing == null) {
if (regionAttributes.getScope().isDistributed()
@@ -961,24 +961,24 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
final PartitionedRegion pr = internalRegionArgs.getPartitionedRegion();
internalRegionArgs.setUserAttribute(pr.getUserAttribute());
if (pr.isShadowPR()) {
- newRegion = new BucketRegionQueue(subregionName, regionAttributes, this, this.cache,
+ newRegion = new BucketRegionQueue(subregionName, regionAttributes, this, cache,
internalRegionArgs);
} else {
- newRegion = new BucketRegion(subregionName, regionAttributes, this, this.cache,
+ newRegion = new BucketRegion(subregionName, regionAttributes, this, cache,
internalRegionArgs);
}
} else if (regionAttributes.getPartitionAttributes() != null) {
- newRegion = new PartitionedRegion(subregionName, regionAttributes, this, this.cache,
+ newRegion = new PartitionedRegion(subregionName, regionAttributes, this, cache,
internalRegionArgs);
} else {
boolean local = regionAttributes.getScope().isLocal();
newRegion = local
- ? new LocalRegion(subregionName, regionAttributes, this, this.cache,
+ ? new LocalRegion(subregionName, regionAttributes, this, cache,
internalRegionArgs)
- : new DistributedRegion(subregionName, regionAttributes, this, this.cache,
+ : new DistributedRegion(subregionName, regionAttributes, this, cache,
internalRegionArgs);
}
- Object previousValue = this.subregions.putIfAbsent(subregionName, newRegion);
+ Object previousValue = subregions.putIfAbsent(subregionName, newRegion);
Assert.assertTrue(previousValue == null);
@@ -989,7 +989,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
if (snapshotInputStream != null || imageTarget != null
|| internalRegionArgs.getRecreateFlag()) {
- this.cache.regionReinitialized(newRegion); // fix for bug 33534
+ cache.regionReinitialized(newRegion); // fix for bug 33534
}
} // endif: existing == null
@@ -1013,7 +1013,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean success = false;
try {
newRegion.checkReadiness();
- this.cache.setRegionByPath(newRegion.getFullPath(), newRegion);
+ cache.setRegionByPath(newRegion.getFullPath(), newRegion);
if (regionAttributes instanceof UserSpecifiedRegionAttributes) {
internalRegionArgs
.setIndexes(((UserSpecifiedRegionAttributes) regionAttributes).getIndexes());
@@ -1025,26 +1025,26 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// register the region with resource manager to get memory events
if (!newRegion.isInternalRegion()) {
if (!newRegion.isDestroyed) {
- this.cache.getInternalResourceManager().addResourceListener(ResourceType.MEMORY,
+ cache.getInternalResourceManager().addResourceListener(ResourceType.MEMORY,
newRegion);
if (!newRegion.getOffHeap()) {
newRegion.initialCriticalMembers(
- this.cache.getInternalResourceManager().getHeapMonitor().getState().isCritical(),
- this.cache.getResourceAdvisor().adviseCriticalMembers());
+ cache.getInternalResourceManager().getHeapMonitor().getState().isCritical(),
+ cache.getResourceAdvisor().adviseCriticalMembers());
} else {
newRegion.initialCriticalMembers(
- this.cache.getInternalResourceManager().getHeapMonitor().getState().isCritical()
- || this.cache.getInternalResourceManager().getOffHeapMonitor().getState()
+ cache.getInternalResourceManager().getHeapMonitor().getState().isCritical()
+ || cache.getInternalResourceManager().getOffHeapMonitor().getState()
.isCritical(),
- this.cache.getResourceAdvisor().adviseCriticalMembers());
+ cache.getResourceAdvisor().adviseCriticalMembers());
}
// synchronization would be done on ManagementAdapter.regionOpLock
// instead of destroyLock in LocalRegion? ManagementAdapter is one
// of the Resource Event listeners
- InternalDistributedSystem system = this.cache.getInternalDistributedSystem();
+ InternalDistributedSystem system = cache.getInternalDistributedSystem();
system.handleResourceEvent(ResourceEvent.REGION_CREATE, newRegion);
}
}
@@ -1059,9 +1059,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
throw validationException;
} finally {
if (!success) {
- this.cache.setRegionByPath(newRegion.getFullPath(), null);
+ cache.setRegionByPath(newRegion.getFullPath(), null);
initializationFailed(newRegion);
- this.cache.getInternalResourceManager(false).removeResourceListener(newRegion);
+ cache.getInternalResourceManager(false).removeResourceListener(newRegion);
}
}
@@ -1078,7 +1078,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
}
- this.cache.invokeRegionAfter(newRegion);
+ cache.invokeRegionAfter(newRegion);
return newRegion;
}
@@ -1101,7 +1101,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
throws TimeoutException, EntryExistsException, CacheWriterException {
if (event.getEventId() == null && generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
// Fix for 42448 - Only make create with null a local invalidate for
// normal regions. Otherwise, it will become a distributed invalidate.
@@ -1167,7 +1167,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
Object validatedDestroy(Object key, EntryEventImpl event)
throws TimeoutException, EntryNotFoundException, CacheWriterException {
if (event.getEventId() == null && generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
basicDestroy(event, true, // cacheWrite
null); // expectedOldValue
@@ -1191,7 +1191,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void destroyRegion(Object aCallbackArgument)
throws CacheWriterException, TimeoutException {
- this.cache.invokeBeforeDestroyed(this);
+ cache.invokeBeforeDestroyed(this);
getDataView().checkSupportsRegionDestroy();
checkForLimitedOrNoAccess();
@@ -1204,7 +1204,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public InternalDataView getDataView() {
final TXStateInterface tx = getTXState();
if (tx == null) {
- return this.sharedDataView;
+ return sharedDataView;
}
return tx;
}
@@ -1224,12 +1224,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public Object getDeserializedValue(RegionEntry regionEntry, final KeyInfo keyInfo,
final boolean updateStats, boolean disableCopyOnRead, boolean preferCachedDeserializable,
EntryEventImpl clientEvent, boolean returnTombstones, boolean retainResult) {
- if (this.diskRegion != null) {
- this.diskRegion.setClearCountReference();
+ if (diskRegion != null) {
+ diskRegion.setClearCountReference();
}
try {
if (regionEntry == null) {
- regionEntry = this.entries.getEntry(keyInfo.getKey());
+ regionEntry = entries.getEntry(keyInfo.getKey());
}
// skip updating the stats if the value is null
// TODO - We need to clean up the callers of the this class so that we can
@@ -1240,7 +1240,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
final Object value;
if (clientEvent != null && regionEntry.getVersionStamp() != null) {
// defer the lruUpdateCallback to prevent a deadlock (see bug 51121).
- final boolean disabled = this.entries.disableLruUpdateCallback();
+ final boolean disabled = entries.disableLruUpdateCallback();
try {
synchronized (regionEntry) { // bug #51059 value & version must be obtained atomically
clientEvent.setVersionTag(regionEntry.getVersionStamp().asVersionTag());
@@ -1249,12 +1249,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
} finally {
if (disabled) {
- this.entries.enableLruUpdateCallback();
+ entries.enableLruUpdateCallback();
}
try {
- this.entries.lruUpdateCallback();
+ entries.lruUpdateCallback();
} catch (DiskAccessException dae) {
- this.handleDiskAccessException(dae);
+ handleDiskAccessException(dae);
throw dae;
}
}
@@ -1271,8 +1271,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
return value;
} finally {
- if (this.diskRegion != null) {
- this.diskRegion.removeClearCountReference();
+ if (diskRegion != null) {
+ diskRegion.removeClearCountReference();
}
}
}
@@ -1292,7 +1292,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
Object getDeserialized(RegionEntry regionEntry, boolean updateStats, boolean disableCopyOnRead,
boolean preferCachedDeserializable, boolean retainResult) {
assert !retainResult || preferCachedDeserializable;
- boolean disabledLRUCallback = this.entries.disableLruUpdateCallback();
+ boolean disabledLRUCallback = entries.disableLruUpdateCallback();
try {
@Retained
Object value;
@@ -1303,7 +1303,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
value = regionEntry.getValue(this);
}
} catch (DiskAccessException dae) {
- this.handleDiskAccessException(dae);
+ handleDiskAccessException(dae);
throw dae;
}
@@ -1336,8 +1336,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
"Error while deserializing value for key=" + regionEntry.getKey()), i);
} finally {
if (disabledLRUCallback) {
- this.entries.enableLruUpdateCallback();
- this.entries.lruUpdateCallback();
+ entries.enableLruUpdateCallback();
+ entries.lruUpdateCallback();
}
}
}
@@ -1454,7 +1454,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @param key the key used to fetch the region entry
*/
public void recordMiss(final RegionEntry re, Object key) {
- if (!this.statisticsEnabled) {
+ if (!statisticsEnabled) {
return;
}
final RegionEntry e;
@@ -1484,8 +1484,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Retained
Object result = null;
- FutureResult thisFuture = new FutureResult(this.stopper);
- Future otherFuture = (Future) this.getFutures.putIfAbsent(keyInfo.getKey(), thisFuture);
+ FutureResult thisFuture = new FutureResult(stopper);
+ Future otherFuture = (Future) getFutures.putIfAbsent(keyInfo.getKey(), thisFuture);
// only one thread can get their future into the map for this key at a time
if (otherFuture != null) {
try {
@@ -1529,7 +1529,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// didn't find a future, do one more probe for the entry to catch a race
// condition where the future was just removed by another thread
try {
- boolean partitioned = this.getDataPolicy().withPartitioning();
+ boolean partitioned = getDataPolicy().withPartitioning();
if (!partitioned) {
localValue = getDeserializedValue(null, keyInfo, isCreate, disableCopyOnRead, preferCD,
clientEvent, false, false);
@@ -1565,7 +1565,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
} else {
thisFuture.set(null);
}
- this.getFutures.remove(keyInfo.getKey());
+ getFutures.remove(keyInfo.getKey());
}
if (!disableCopyOnRead) {
result = conditionalCopy(result);
@@ -1580,8 +1580,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public boolean isCopyOnRead() {
- return this.compressor == null && this.cache.isCopyOnRead()
- && !this.isUsedForPartitionedRegionAdmin && !this.isUsedForMetaRegion && !getOffHeap()
+ return compressor == null && cache.isCopyOnRead()
+ && !isUsedForPartitionedRegionAdmin && !isUsedForMetaRegion && !getOffHeap()
&& !isSecret();
}
@@ -1602,12 +1602,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public String getFullPath() {
- return this.fullPath;
+ return fullPath;
}
@Override
public Region getParentRegion() {
- return this.parentRegion;
+ return parentRegion;
}
@Override
@@ -1646,7 +1646,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
throws TimeoutException, CacheWriterException {
if (event.getEventId() == null && generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
Object oldValue = null;
if (basicPut(event, false, // ifNew
@@ -1714,7 +1714,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// How costly is this if check?
if (getSystem().getConfig().getDeltaPropagation() && value instanceof Delta) {
boolean extractDelta = false;
- if (!this.hasServerProxy()) {
+ if (!hasServerProxy()) {
if (this instanceof PartitionedRegion) {
if (((PartitionedRegion) this).getRedundantCopies() > 0) {
extractDelta = true;
@@ -1722,7 +1722,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
InternalDistributedMember ids = (InternalDistributedMember) PartitionRegionHelper
.getPrimaryMemberForKey(this, event.getKey());
if (ids != null) {
- extractDelta = !this.getSystem().getMemberId().equals(ids.getId())
+ extractDelta = !getSystem().getMemberId().equals(ids.getId())
|| hasAdjunctRecipientsNeedingDelta(event);
} else {
extractDelta = true;
@@ -1754,7 +1754,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
e);
}
event.setDeltaBytes(hdos.toByteArray());
- this.getCachePerfStats().endDeltaPrepared(start);
+ getCachePerfStats().endDeltaPrepared(start);
}
}
} catch (RuntimeException re) {
@@ -1821,13 +1821,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
/** a fast estimate of total number of entries locally in the region */
long getEstimatedLocalSize() {
- if (!this.isDestroyed) {
+ if (!isDestroyed) {
long size;
// if region has not been initialized yet, then get the estimate from
// disk region's recovery map if available
RegionMap regionMap;
- if (!this.initialized && this.diskRegion != null
- && (regionMap = this.diskRegion.getRecoveredEntryMap()) != null
+ if (!initialized && diskRegion != null
+ && (regionMap = diskRegion.getRecoveredEntryMap()) != null
&& (size = regionMap.size()) > 0) {
return size;
}
@@ -1844,7 +1844,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
Region.Entry nonTXGetEntry(KeyInfo keyInfo, boolean access, boolean allowTombstones) {
final Object key = keyInfo.getKey();
- RegionEntry re = this.entries.getEntry(key);
+ RegionEntry re = entries.getEntry(key);
boolean miss = re == null || re.isDestroyedOrRemoved();
if (access) {
updateStatsForGet(re, !miss);
@@ -1864,7 +1864,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
boolean isClosed() {
- return this.cache.isClosed();
+ return cache.isClosed();
}
/**
@@ -1874,7 +1874,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public boolean isThisRegionBeingClosedOrDestroyed() {
- return this.isDestroyed;
+ return isDestroyed;
}
/** returns true if this region has been destroyed */
@@ -1886,7 +1886,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean isTraceEnabled = logger.isTraceEnabled();
- if (this.isDestroyed) {
+ if (isDestroyed) {
if (isTraceEnabled) {
logger.trace("isDestroyed: true, this.isDestroyed: {}", getFullPath());
}
@@ -1971,13 +1971,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public Object getUserAttribute() {
- return this.regionUserAttribute;
+ return regionUserAttribute;
}
@Override
public void setUserAttribute(Object value) {
checkReadiness();
- this.regionUserAttribute = value;
+ regionUserAttribute = value;
}
@Override
@@ -1993,7 +1993,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public boolean containsTombstone(Object key) {
checkReadiness();
checkForNoAccess();
- if (!this.getConcurrencyChecksEnabled()) {
+ if (!getConcurrencyChecksEnabled()) {
return false;
} else {
try {
@@ -2007,10 +2007,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean nonTXContainsKey(KeyInfo keyInfo) {
boolean contains = getRegionMap().containsKey(keyInfo.getKey());
- if (contains && this.imageState.isClient()) {
+ if (contains && imageState.isClient()) {
// fix for bug #40871 - concurrent RI causes containsKey for destroyed entry
// to return true
- RegionEntry regionEntry = this.entries.getEntry(keyInfo.getKey());
+ RegionEntry regionEntry = entries.getEntry(keyInfo.getKey());
if (regionEntry == null || regionEntry.isDestroyedOrRemoved()) {
contains = false;
}
@@ -2029,11 +2029,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean nonTXContainsValueForKey(KeyInfo keyInfo) {
checkReadiness();
checkForNoAccess();
- if (this.diskRegion != null) {
- this.diskRegion.setClearCountReference();
+ if (diskRegion != null) {
+ diskRegion.setClearCountReference();
}
try {
- RegionEntry entry = this.entries.getEntry(keyInfo.getKey());
+ RegionEntry entry = entries.getEntry(keyInfo.getKey());
boolean result = entry != null;
if (result) {
ReferenceCountHelper.skipRefCountTracking();
@@ -2053,8 +2053,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
return result;
} finally {
- if (this.diskRegion != null) {
- this.diskRegion.removeClearCountReference();
+ if (diskRegion != null) {
+ diskRegion.removeClearCountReference();
}
}
}
@@ -2067,7 +2067,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public String getName() {
- return this.regionName;
+ return regionName;
}
/**
@@ -2078,10 +2078,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public String getDisplayName() {
- if (this.isUsedForPartitionedRegionBucket()) {
- return this.getPartitionedRegion().getName();
+ if (isUsedForPartitionedRegionBucket()) {
+ return getPartitionedRegion().getName();
}
- return this.regionName;
+ return regionName;
}
/**
@@ -2114,10 +2114,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
int result = getRegionMap().size();
// if this is a client with no tombstones then we subtract the number
// of entries being affected by register-interest refresh
- if (this.imageState.isClient() && !this.getConcurrencyChecksEnabled()) {
- return result - this.imageState.getDestroyedEntriesCount();
+ if (imageState.isClient() && !getConcurrencyChecksEnabled()) {
+ return result - imageState.getDestroyedEntriesCount();
}
- return result - this.tombstoneCount.get();
+ return result - tombstoneCount.get();
}
}
@@ -2130,7 +2130,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public DiskRegion getDiskRegion() {
- return this.diskRegion;
+ return diskRegion;
}
@Override
@@ -2143,7 +2143,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
public void evictValue(Object key) {
if (getDiskRegion() != null) {
- this.entries.evictValue(key);
+ entries.evictValue(key);
}
}
@@ -2154,7 +2154,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void writeToDisk() {
- if (this.diskRegion == null) {
+ if (diskRegion == null) {
DataPolicy dp = getDataPolicy();
if (dp.isEmpty()) {
throw new IllegalStateException(
@@ -2165,7 +2165,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
"Cannot write a region that is not configured to access disks.");
}
} else {
- this.diskRegion.asynchForceFlush();
+ diskRegion.asynchForceFlush();
}
}
@@ -2173,8 +2173,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* Used by tests to force everything out to disk.
*/
public void forceFlush() {
- if (this.diskRegion != null) {
- this.diskRegion.flushForTesting();
+ if (diskRegion != null) {
+ diskRegion.flushForTesting();
}
}
@@ -2223,7 +2223,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
aCallbackArgument, false, getMyId());
try {
if (generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
basicInvalidate(event);
} finally {
@@ -2240,7 +2240,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
EntryEventImpl event = entryEventFactory.create(this, Operation.LOCAL_DESTROY, key, null,
aCallbackArgument, false, getMyId());
if (generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
try {
basicDestroy(event, false, null); // expectedOldValue
@@ -2313,7 +2313,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
null, aCallbackArgument, false, getMyId());
try {
if (generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
event.setLocalInvalid(true);
basicInvalidate(event);
@@ -2348,35 +2348,35 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (!isInternalRegion()) {
// Subclasses may have already called this method, but this is
// acceptable because addResourceListener won't add it twice
- if (!this.isDestroyed) {
- this.cache.getInternalResourceManager().addResourceListener(ResourceType.MEMORY, this);
+ if (!isDestroyed) {
+ cache.getInternalResourceManager().addResourceListener(ResourceType.MEMORY, this);
}
}
// if not local, then recovery happens in InitialImageOperation
- if (this.scope.isLocal()) {
+ if (scope.isLocal()) {
createOQLIndexes(internalRegionArgs);
- if (this.diskRegion != null) {
+ if (diskRegion != null) {
try {
- this.diskRegion.initializeOwner(this);
- this.diskRegion.finishInitializeOwner(this, GIIStatus.NO_GII);
+ diskRegion.initializeOwner(this);
+ diskRegion.finishInitializeOwner(this, GIIStatus.NO_GII);
// This block was added so that early recovery could figure out that
// this data needs to be recovered from disk. Local regions used to
// not bother assigning a memberId but that is what the early
// recovery
// code uses to figure out that a region needs to be recovered.
- PersistentMemberID oldId = this.diskRegion.getMyInitializingID();
+ PersistentMemberID oldId = diskRegion.getMyInitializingID();
if (oldId == null) {
- oldId = this.diskRegion.getMyPersistentID();
+ oldId = diskRegion.getMyPersistentID();
}
if (oldId == null) {
- PersistentMemberID newId = this.diskRegion.generatePersistentID();
- this.diskRegion.setInitializing(newId);
- this.diskRegion.setInitialized();
+ PersistentMemberID newId = diskRegion.generatePersistentID();
+ diskRegion.setInitializing(newId);
+ diskRegion.setInitialized();
}
} catch (DiskAccessException dae) {
releaseAfterRegionCreateEventLatch();
- this.handleDiskAccessException(dae, true);
+ handleDiskAccessException(dae, true);
throw dae;
}
}
@@ -2384,12 +2384,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// make sure latches are released if they haven't been by now already
releaseBeforeGetInitialImageLatch();
- if (snapshotInputStream != null && this.scope.isLocal()) {
+ if (snapshotInputStream != null && scope.isLocal()) {
try {
loadSnapshotDuringInitialization(snapshotInputStream);
} catch (DiskAccessException dae) {
releaseAfterRegionCreateEventLatch();
- this.handleDiskAccessException(dae);
+ handleDiskAccessException(dae);
throw dae;
}
}
@@ -2428,15 +2428,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return;
}
if (logger.isDebugEnabled()) {
- logger.debug("LocalRegion.createOQLIndexes on region {}", this.getFullPath());
+ logger.debug("LocalRegion.createOQLIndexes on region {}", getFullPath());
}
long start = getCachePerfStats().startIndexInitialization();
List oqlIndexes = internalRegionArgs.getIndexes();
- if (this.indexManager == null) {
- this.indexManager = IndexUtils.getIndexManager(cache, this, true);
+ if (indexManager == null) {
+ indexManager = IndexUtils.getIndexManager(cache, this, true);
}
- DiskRegion dr = this.getDiskRegion();
+ DiskRegion dr = getDiskRegion();
boolean isOverflowToDisk = false;
if (dr != null) {
isOverflowToDisk = dr.isOverflowEnabled();
@@ -2459,7 +2459,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
IndexCreationData icd = (IndexCreationData) o;
try {
if (icd.getPartitionedIndex() != null) {
- ExecutionContext externalContext = new ExecutionContext(null, this.cache);
+ ExecutionContext externalContext = new ExecutionContext(null, cache);
if (internalRegionArgs.getPartitionedRegion() != null) {
externalContext.setBucketRegion(internalRegionArgs.getPartitionedRegion(),
(BucketRegion) this);
@@ -2469,7 +2469,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
// load entries during initialization only for non overflow regions
- indexes.add(this.indexManager.createIndex(icd.getIndexName(), icd.getIndexType(),
+ indexes.add(indexManager.createIndex(icd.getIndexName(), icd.getIndexType(),
icd.getIndexExpression(), icd.getIndexFromClause(), icd.getIndexImportString(),
externalContext, icd.getPartitionedIndex(), !isOverflowToDisk));
prIndexes.add(icd.getPartitionedIndex());
@@ -2480,7 +2480,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
DefaultQueryService qs = (DefaultQueryService) getGemFireCache().getLocalQueryService();
String fromClause =
icd.getIndexType() == IndexType.FUNCTIONAL || icd.getIndexType() == IndexType.HASH
- ? icd.getIndexFromClause() : this.getFullPath();
+ ? icd.getIndexFromClause() : getFullPath();
// load entries during initialization only for non overflow regions
indexes.add(
qs.createIndex(icd.getIndexName(), icd.getIndexType(), icd.getIndexExpression(),
@@ -2489,7 +2489,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
} catch (Exception ex) {
logger.info("Failed to create index {} on region {} with exception: {}",
- icd.getIndexName(), this.getFullPath(), ex);
+ icd.getIndexName(), getFullPath(), ex);
}
}
@@ -2505,11 +2505,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// Empty indexes are created for overflow regions but not populated at this stage
// since this is not recovery.
// Setting the populate flag to true so that the indexes can apply updates.
- this.indexManager.setPopulateFlagForIndexes(indexes);
+ indexManager.setPopulateFlagForIndexes(indexes);
}
// due to bug #52096, the pr index populate flags were not being set
// we should revisit and clean up the index creation code paths
- this.indexManager.setPopulateFlagForIndexes(prIndexes);
+ indexManager.setPopulateFlagForIndexes(prIndexes);
}
getCachePerfStats().endIndexInitialization(start);
}
@@ -2520,9 +2520,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private void populateOQLIndexes(Set<Index> indexes) {
logger.info("Loading data into the indexes");
try {
- this.indexManager.populateIndexes(indexes);
+ indexManager.populateIndexes(indexes);
} catch (MultiIndexCreationException ex) {
- logger.info("Failed to update index on region {}: {}", this.getFullPath(), ex.getMessage());
+ logger.info("Failed to update index on region {}: {}", getFullPath(), ex.getMessage());
}
}
@@ -2543,14 +2543,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (logger.isDebugEnabled()) {
logger.debug("Releasing Initialization Latch (before initial image) for {}", getFullPath());
}
- releaseLatch(this.getInitializationLatchBeforeGetInitialImage());
+ releaseLatch(getInitializationLatchBeforeGetInitialImage());
}
void releaseAfterGetInitialImageLatch() {
if (logger.isDebugEnabled()) {
logger.debug("Releasing Initialization Latch (after initial image) for {}", getFullPath());
}
- releaseLatch(this.getInitializationLatchAfterGetInitialImage());
+ releaseLatch(getInitializationLatchAfterGetInitialImage());
}
/**
@@ -2559,7 +2559,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @since GemFire 5.0
*/
private void releaseAfterRegionCreateEventLatch() {
- releaseLatch(this.afterRegionCreateEventLatch);
+ releaseLatch(afterRegionCreateEventLatch);
}
/**
@@ -2568,7 +2568,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @since GemFire 5.0
*/
private void waitForRegionCreateEvent() {
- StoppableCountDownLatch latch = this.afterRegionCreateEventLatch;
+ StoppableCountDownLatch latch = afterRegionCreateEventLatch;
if (latch != null && latch.getCount() == 0) {
return;
}
@@ -2596,7 +2596,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
cacheWriteBeforeRegionDestroy(regionEvent);
} catch (CancelException e) {
// I don't think this should ever happens: bulletproofing for bug 39454
- if (!this.cache.forcedDisconnect()) {
+ if (!cache.forcedDisconnect()) {
logger.warn("recursiveDestroyRegion: problem in cacheWriteBeforeRegionDestroy",
e);
}
@@ -2614,7 +2614,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (!isInternalRegion()) {
getCachePerfStats().incRegions(-1);
}
- this.cache.getInternalResourceManager(false).removeResourceListener(this);
+ cache.getInternalResourceManager(false).removeResourceListener(this);
if (getMembershipAttributes().hasRequiredRoles()) {
if (!isInternalRegion()) {
getCachePerfStats().incReliableRegions(-1);
@@ -2632,7 +2632,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
try {
// call recursiveDestroyRegion on each subregion and remove it
// from this subregion map
- Collection values = this.subregions.values();
+ Collection values = subregions.values();
for (Iterator itr = values.iterator(); itr.hasNext();) {
// element is a LocalRegion
Object element = itr.next();
@@ -2672,7 +2672,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
} catch (CancelException e) {
// I don't think this should ever happen: bulletproofing for bug 39454
- if (!this.cache.forcedDisconnect()) {
+ if (!cache.forcedDisconnect()) {
logger.warn(String.format(
"recursiveDestroyRegion: recursion failed due to cache closure. region, %s",
region.getFullPath()),
@@ -2684,19 +2684,19 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
} // for
try {
- if (this.indexManager != null) {
+ if (indexManager != null) {
try {
if (this instanceof BucketRegion) {
- this.indexManager.removeBucketIndexes(getPartitionedRegion());
+ indexManager.removeBucketIndexes(getPartitionedRegion());
}
- this.indexManager.destroy();
+ indexManager.destroy();
} catch (QueryException e) {
throw new IndexMaintenanceException(e);
}
}
} catch (CancelException e) {
// I don't think this should ever happens: bulletproofing for bug 39454
- if (!this.cache.forcedDisconnect()) {
+ if (!cache.forcedDisconnect()) {
logger.warn(String.format(
"basicDestroyRegion: index removal failed due to cache closure. region, %s",
getFullPath()),
@@ -2706,19 +2706,19 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
} finally {
// mark this region as destroyed.
if (regionEvent.isReinitializing()) {
- this.reinitialized_old = true;
+ reinitialized_old = true;
}
- this.cache.setRegionByPath(getFullPath(), null);
+ cache.setRegionByPath(getFullPath(), null);
getEventTracker().stop();
- if (this.diskRegion != null) {
- this.diskRegion.prepareForClose(this);
+ if (diskRegion != null) {
+ diskRegion.prepareForClose(this);
}
- this.isDestroyed = true;
+ isDestroyed = true;
// after isDestroyed is set to true call removeResourceListener to fix bug 49555
- this.cache.getInternalResourceManager(false).removeResourceListener(this);
+ cache.getInternalResourceManager(false).removeResourceListener(this);
closeEntries();
if (logger.isDebugEnabled()) {
logger.debug("recursiveDestroyRegion: Region Destroyed: {}", getFullPath());
@@ -2748,22 +2748,22 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
} else {
closeAllCallbacks();
}
- if (this.getConcurrencyChecksEnabled() && this.getDataPolicy().withReplication()
- && !this.cache.isClosed()) {
- this.cache.getTombstoneService().unscheduleTombstones(this);
+ if (getConcurrencyChecksEnabled() && getDataPolicy().withReplication()
+ && !cache.isClosed()) {
+ cache.getTombstoneService().unscheduleTombstones(this);
}
- if (this.hasOwnStats) {
- this.cachePerfStats.close();
+ if (hasOwnStats) {
+ cachePerfStats.close();
}
}
}
public void closeEntries() {
- this.entries.close(null);
+ entries.close(null);
}
public Set<VersionSource> clearEntries(RegionVersionVector rvv) {
- return this.entries.clear(rvv, null);
+ return entries.clear(rvv, null);
}
@Override
@@ -2838,7 +2838,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// don't allow tombstones into a client cache if it doesn't
// have concurrency checks enabled
- if (fromServer && value == Token.TOMBSTONE && !this.getConcurrencyChecksEnabled()) {
+ if (fromServer && value == Token.TOMBSTONE && !getConcurrencyChecksEnabled()) {
value = null;
}
@@ -2879,7 +2879,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// set the event id so that we can progagate
// the value to the server
if (!fromServer) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
try {
try {
@@ -2919,10 +2919,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@SuppressWarnings({"rawtypes", "unchecked"})
Object callCacheLoader(CacheLoader loader, final Object key,
final Object aCallbackArgument, boolean preferCD) {
- LoaderHelper loaderHelper = this.loaderHelperFactory.createLoaderHelper(key, aCallbackArgument,
+ LoaderHelper loaderHelper = loaderHelperFactory.createLoaderHelper(key, aCallbackArgument,
false /* netSearchAllowed */, true /* netloadAllowed */, null /* searcher */);
Object result = loader.load(loaderHelper);
- result = this.getCache().convertPdxInstanceIfNeeded(result, preferCD);
+ result = getCache().convertPdxInstanceIfNeeded(result, preferCD);
return result;
}
@@ -2941,7 +2941,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Unretained(ENTRY_EVENT_NEW_VALUE)
Object newValue = event.getRawNewValue();
if (newValue == null || Token.isInvalid(newValue)) {
- RegionEntry entry = this.entries.getEntry(key);
+ RegionEntry entry = entries.getEntry(key);
if (entry != null) {
synchronized (entry) {
if (entry.isInvalid()) {
@@ -3223,11 +3223,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
// check validity of key against keyConstraint
- if (this.keyConstraint != null) {
- if (!this.keyConstraint.isInstance(key))
+ if (keyConstraint != null) {
+ if (!keyConstraint.isInstance(key))
throw new ClassCastException(
String.format("key ( %s ) does not satisfy keyConstraint ( %s )",
- key.getClass().getName(), this.keyConstraint.getName()));
+ key.getClass().getName(), keyConstraint.getName()));
}
// We don't need to check that the key is Serializable. Instead,
@@ -3256,16 +3256,16 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
private void validateValue(Object value) {
// check validity of value against valueConstraint
- if (this.valueConstraint != null) {
+ if (valueConstraint != null) {
if (value != null) {
if (value instanceof CachedDeserializable) {
- if (this.doExpensiveValidations) {
+ if (doExpensiveValidations) {
value = ((CachedDeserializable) value).getDeserializedValue(null, null);
} else {
return;
}
}
- if (!this.valueConstraint.isInstance(value)) {
+ if (!valueConstraint.isInstance(value)) {
String valueClassName = value.getClass().getName();
// check for a REST object, which has a @type field denoting its class
if (value instanceof PdxInstance) {
@@ -3278,13 +3278,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return;
}
}
- if (valueClassName.equals(this.valueConstraint.getName())) {
+ if (valueClassName.equals(valueConstraint.getName())) {
return;
}
}
throw new ClassCastException(
String.format("value ( %s ) does not satisfy valueConstraint ( %s )",
- valueClassName, this.valueConstraint.getName()));
+ valueClassName, valueConstraint.getName()));
}
}
}
@@ -3293,25 +3293,25 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public CachePerfStats getCachePerfStats() {
// return this.cache.getCachePerfStats();
- return this.cachePerfStats;
+ return cachePerfStats;
}
public CachePerfStats getRegionPerfStats() {
- return this.cachePerfStats;
+ return cachePerfStats;
}
/** regions track the number of tombstones their map holds for size calculations */
public void incTombstoneCount(int delta) {
- this.tombstoneCount.addAndGet(delta);
- this.cachePerfStats.incTombstoneCount(delta);
+ tombstoneCount.addAndGet(delta);
+ cachePerfStats.incTombstoneCount(delta);
// Fix for 45204 - don't include the tombstones in
// any of our entry count stats.
- this.cachePerfStats.incEntryCount(-delta);
+ cachePerfStats.incEntryCount(-delta);
}
public int getTombstoneCount() {
- return this.tombstoneCount.get();
+ return tombstoneCount.get();
}
@Override
@@ -3334,8 +3334,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
logger.trace(LogMarker.TOMBSTONE_COUNT_VERBOSE,
"{} tombstone for {} version={} count is {} entryMap size is {}",
reschedule ? "rescheduling" : "scheduling", entry.getKey(),
- entry.getVersionStamp().asVersionTag(), this.tombstoneCount.get(),
- this.entries.size()/* , new Exception("stack trace") */);
+ entry.getVersionStamp().asVersionTag(), tombstoneCount.get(),
+ entries.size()/* , new Exception("stack trace") */);
}
getGemFireCache().getTombstoneService().scheduleTombstone(this, entry, destroyedVersion);
}
@@ -3355,11 +3355,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (logger.isTraceEnabled(LogMarker.TOMBSTONE_VERBOSE)) {
logger.trace(LogMarker.TOMBSTONE_VERBOSE,
"unscheduling tombstone for {} count is {} entryMap size is {}", entry.getKey(),
- this.tombstoneCount.get(), this.entries.size()/* , new Exception("stack trace") */);
+ tombstoneCount.get(), entries.size()/* , new Exception("stack trace") */);
}
if (logger.isTraceEnabled(LogMarker.TOMBSTONE_COUNT_VERBOSE) && validate) {
- if (this.entries instanceof AbstractRegionMap) {
- ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount);
+ if (entries instanceof AbstractRegionMap) {
+ ((AbstractRegionMap) entries).verifyTombstoneCount(tombstoneCount);
}
}
// we don't have to remove the entry from the sweeper since the version has
@@ -3376,12 +3376,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
public void expireTombstones(Map<VersionSource, Long> regionGCVersions, EventID eventID,
FilterInfo clientRouting) {
- if (!this.getConcurrencyChecksEnabled()) {
+ if (!getConcurrencyChecksEnabled()) {
return;
}
Set<Object> keys = null;
- if (!this.versionVector.containsTombstoneGCVersions(regionGCVersions)) {
- keys = this.cache.getTombstoneService().gcTombstones(this, regionGCVersions,
+ if (!versionVector.containsTombstoneGCVersions(regionGCVersions)) {
+ keys = cache.getTombstoneService().gcTombstones(this, regionGCVersions,
needsTombstoneGCKeysForClients(eventID, clientRouting));
if (keys == null) {
// deltaGII prevented tombstone GC
@@ -3394,8 +3394,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
public void expireTombstoneKeys(Set<Object> tombstoneKeys) {
- if (this.getConcurrencyChecksEnabled()) {
- this.cache.getTombstoneService().gcTombstoneKeys(this, tombstoneKeys);
+ if (getConcurrencyChecksEnabled()) {
+ cache.getTombstoneService().gcTombstoneKeys(this, tombstoneKeys);
}
}
@@ -3435,21 +3435,21 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
/** local regions do not perform versioning */
boolean shouldGenerateVersionTag(RegionEntry entry, EntryEventImpl event) {
- if (this.getDataPolicy().withPersistence()) {
+ if (getDataPolicy().withPersistence()) {
return true;
} else {
- return this.getConcurrencyChecksEnabled()
- && (entry.getVersionStamp().hasValidVersion() || this.getDataPolicy().withReplication());
+ return getConcurrencyChecksEnabled()
+ && (entry.getVersionStamp().hasValidVersion() || getDataPolicy().withReplication());
}
}
void enableConcurrencyChecks() {
- this.setConcurrencyChecksEnabled(true);
- if (this.getDataPolicy().withStorage()) {
- RegionEntryFactory versionedEntryFactory = this.entries.getEntryFactory().makeVersioned();
- Assert.assertTrue(this.entries.isEmpty(),
- "RegionMap should be empty but was of size:" + this.entries.size());
- this.entries.setEntryFactory(versionedEntryFactory);
+ setConcurrencyChecksEnabled(true);
+ if (getDataPolicy().withStorage()) {
+ RegionEntryFactory versionedEntryFactory = entries.getEntryFactory().makeVersioned();
+ Assert.assertTrue(entries.isEmpty(),
+ "RegionMap should be empty but was of size:" + entries.size());
+ entries.setEntryFactory(versionedEntryFactory);
}
}
@@ -3464,7 +3464,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
throw new IllegalArgumentException(
"region attributes must not be null");
}
- if (this.scope == Scope.LOCAL && attrs.getScope() != Scope.LOCAL) {
+ if (scope == Scope.LOCAL && attrs.getScope() != Scope.LOCAL) {
throw new IllegalStateException(
"A region with Scope.LOCAL can only have subregions with Scope.LOCAL");
}
@@ -3498,7 +3498,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Retained
Object nonTXbasicGetValueInVM(KeyInfo keyInfo) {
- RegionEntry regionEntry = this.entries.getEntry(keyInfo.getKey());
+ RegionEntry regionEntry = entries.getEntry(keyInfo.getKey());
if (regionEntry == null) {
checkEntryNotFound(keyInfo.getKey());
}
@@ -3554,7 +3554,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public Object getValueOnDisk(Object key) throws EntryNotFoundException {
// Ok for this to ignore tx state
- RegionEntry re = this.entries.getEntry(key);
+ RegionEntry re = entries.getEntry(key);
if (re == null) {
throw new EntryNotFoundException(key.toString());
}
@@ -3566,7 +3566,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public Object getValueInVMOrDiskWithoutFaultIn(Object key) throws EntryNotFoundException {
- RegionEntry re = this.entries.getEntry(key);
+ RegionEntry re = entries.getEntry(key);
if (re == null) {
throw new EntryNotFoundException(key.toString());
}
@@ -3589,7 +3589,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public Object getValueOnDiskOrBuffer(Object key) throws EntryNotFoundException {
// Ok for this to ignore tx state
- RegionEntry re = this.entries.getEntry(key);
+ RegionEntry re = entries.getEntry(key);
if (re == null) {
throw new EntryNotFoundException(key.toString());
}
@@ -3737,8 +3737,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public void startRegisterInterest() {
getImageState().writeLockRI();
try {
- this.cache.registerInterestStarted();
- this.riCnt++;
+ cache.registerInterestStarted();
+ riCnt++;
} finally {
getImageState().writeUnlockRI();
}
@@ -3764,14 +3764,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
try {
getImageState().writeLockRI();
gotLock = true;
- this.riCnt--;
- Assert.assertTrue(this.riCnt >= 0, "register interest count can not be < 0 ");
- if (this.riCnt == 0) {
+ riCnt--;
+ Assert.assertTrue(riCnt >= 0, "register interest count can not be < 0 ");
+ if (riCnt == 0) {
// remove any destroyed entries from the region and clear the hashset
destroyEntriesAndClearDestroyedKeysSet();
}
} finally {
- this.cache.registerInterestCompleted();
+ cache.registerInterestCompleted();
if (gotLock) {
getImageState().writeUnlockRI();
}
@@ -3820,7 +3820,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
startRegisterInterest();
try {
- this.clearKeysOfInterest(key, interestType, interestResultPolicy);
+ clearKeysOfInterest(key, interestType, interestResultPolicy);
// Checking for the Dunit test(testRegisterInterst_Destroy_Concurrent) flag
if (PoolImpl.BEFORE_REGISTER_CALLBACK_FLAG) {
ClientServerObserver bo = ClientServerObserverHolder.getInstance();
@@ -4029,7 +4029,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
Pattern keyPattern = Pattern.compile((String) interestArg);
- for (Object entryKey : this.keySet(allowTombstones)) {
+ for (Object entryKey : keySet(allowTombstones)) {
if (!(entryKey instanceof String)) {
// key is not a String, cannot apply regex to this entry
continue;
@@ -4048,14 +4048,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
List keyList = (List) interestArg;
for (Iterator it = keyList.iterator(); it.hasNext();) {
Object entryKey = it.next();
- if (this.containsKey(entryKey) || allowTombstones && this.containsTombstone(entryKey)) {
+ if (containsKey(entryKey) || allowTombstones && containsTombstone(entryKey)) {
ret.add(entryKey);
}
}
} else {
ret = new HashSet();
- if (this.containsKey(interestArg)
- || (allowTombstones && this.containsTombstone(interestArg))) {
+ if (containsKey(interestArg)
+ || (allowTombstones && containsTombstone(interestArg))) {
ret.add(interestArg);
}
}
@@ -4202,7 +4202,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private void clearViaRegEx(String key) {
// TODO: if (key.equals(".*)) then cmnClearRegionNoCallbacks
Pattern keyPattern = Pattern.compile(key);
- for (Iterator it = this.entrySet(false).iterator(); it.hasNext();) {
+ for (Iterator it = entrySet(false).iterator(); it.hasNext();) {
Region.Entry entry = (Region.Entry) it.next();
try {
Object entryKey = entry.getKey();
@@ -4316,7 +4316,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// Attempt to create an invalid in without overwriting
if (!isProxy()) {
for (Object currentKey : list) {
- this.entries.initialImagePut(currentKey, 0, Token.LOCAL_INVALID, false, false, null,
+ entries.initialImagePut(currentKey, 0, Token.LOCAL_INVALID, false, false, null,
null, false);
}
}
@@ -4340,7 +4340,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
Object val = entry.getObject();
boolean isBytes = entry.isBytes();
boolean isKeyOnServer = !entry.isKeyNotOnServer();
- boolean isTombstone = this.getConcurrencyChecksEnabled() && entry.isKeyNotOnServer()
+ boolean isTombstone = getConcurrencyChecksEnabled() && entry.isKeyNotOnServer()
&& entry.getVersionTag() != null;
final VersionTag tag = entry.getVersionTag();
if (val instanceof Throwable) {
@@ -4372,18 +4372,18 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// Sneakily drop in the value into our local cache,
// but don't overwrite
if (!isProxy()) {
- this.entries.initialImagePut(currentKey, 0, val, false, false, tag, null, false);
+ entries.initialImagePut(currentKey, 0, val, false, false, tag, null, false);
}
} else {
- RegionEntry regionEntry = this.entries.getEntry(currentKey);
+ RegionEntry regionEntry = entries.getEntry(currentKey);
if (!isProxy() && isKeyOnServer) {
- this.entries.initialImagePut(currentKey, 0, Token.LOCAL_INVALID, false, false, tag,
+ entries.initialImagePut(currentKey, 0, Token.LOCAL_INVALID, false, false, tag,
null, false);
} else {
if (regionEntry != null) {
synchronized (regionEntry) {
if (regionEntry.isDestroyedOrRemovedButNotTombstone()) {
- this.entries.removeEntry(currentKey, regionEntry, false);
+ entries.removeEntry(currentKey, regionEntry, false);
}
}
}
@@ -4394,7 +4394,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
}
} catch (DiskAccessException dae) {
- this.handleDiskAccessException(dae);
+ handleDiskAccessException(dae);
throw dae;
} finally {
EntryLogger.clearSource();
@@ -4501,14 +4501,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* recreated region
*/
boolean reinitialized_new() {
- return this.reinitialized_new;
+ return reinitialized_new;
}
/** must be holding destroy lock */
void reinitialize_destroy(RegionEventImpl event) throws CacheWriterException, TimeoutException {
final boolean cacheWrite = !event.originRemote;
// register this region as reinitializing
- this.cache.regionReinitializing(getFullPath());
+ cache.regionReinitializing(getFullPath());
basicDestroyRegion(event, cacheWrite, false/* lock */, true);
}
@@ -4520,13 +4520,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// recreate new region with snapshot data
try {
- LocalRegion parent = this.parentRegion;
+ LocalRegion parent = parentRegion;
// If specified diskDir in DEFAULT diskstore, we should not use null
// as diskstore name any more
- if (this.diskStoreImpl != null
- && this.diskStoreImpl.getName().equals(DiskStoreFactory.DEFAULT_DISK_STORE_NAME)
- && this.diskStoreName == null && !useDefaultDiskStore()) {
- this.diskStoreName = this.diskStoreImpl.getName();
+ if (diskStoreImpl != null
+ && diskStoreImpl.getName().equals(DiskStoreFactory.DEFAULT_DISK_STORE_NAME)
+ && diskStoreName == null && !useDefaultDiskStore()) {
+ diskStoreName = diskStoreImpl.getName();
}
RegionAttributes attrs = this;
boolean getDestroyLock = false;
@@ -4539,9 +4539,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
if (parent == null) {
- newRegion = this.cache.createVMRegion(this.regionName, attrs, internalRegionArguments);
+ newRegion = cache.createVMRegion(regionName, attrs, internalRegionArguments);
} else {
- newRegion = parent.createSubregion(this.regionName, attrs, internalRegionArguments);
+ newRegion = parent.createSubregion(regionName, attrs, internalRegionArguments);
}
// note that createVMRegion and createSubregion now call regionReinitialized
@@ -4553,7 +4553,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
} finally {
if (newRegion == null) {
// failed to create region
- this.cache.unregisterReinitializingRegion(thePath);
+ cache.unregisterReinitializingRegion(thePath);
}
}
}
@@ -4593,7 +4593,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// If versioning is enabled, we will give the entry a "fake" version.
VersionTag tag = null;
- if (this.getConcurrencyChecksEnabled()) {
+ if (getConcurrencyChecksEnabled()) {
tag = VersionTag.create(getVersionMember());
}
map.initialImagePut(key, cacheTimeMillis(), value, false, false, tag, null, false);
@@ -4601,7 +4601,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
} finally {
in.close();
}
- this.reinitialized_new = true;
+ reinitialized_new = true;
}
/**
@@ -4716,14 +4716,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public boolean checkForInitialization() {
- if (this.initialized) {
+ if (initialized) {
return true;
}
switch (threadInitLevelRequirement()) {
case AFTER_INITIAL_IMAGE:
- return checkForInitialization(this.getInitializationLatchAfterGetInitialImage());
+ return checkForInitialization(getInitializationLatchAfterGetInitialImage());
case BEFORE_INITIAL_IMAGE:
- return checkForInitialization(this.getInitializationLatchBeforeGetInitialImage());
+ return checkForInitialization(getInitializationLatchBeforeGetInitialImage());
case ANY_INIT:
return true;
default:
@@ -4739,15 +4739,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
/** wait on the initialization Latch based on thread requirements */
@Override
public void waitOnInitialization() {
- if (this.initialized) {
+ if (initialized) {
return;
}
switch (threadInitLevelRequirement()) {
case AFTER_INITIAL_IMAGE:
- waitOnInitialization(this.getInitializationLatchAfterGetInitialImage());
+ waitOnInitialization(getInitializationLatchAfterGetInitialImage());
break;
case BEFORE_INITIAL_IMAGE:
- waitOnInitialization(this.getInitializationLatchBeforeGetInitialImage());
+ waitOnInitialization(getInitializationLatchBeforeGetInitialImage());
break;
case ANY_INIT:
return;
@@ -4763,14 +4763,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return; // latch resource has been freed
}
while (true) {
- this.cache.getCancelCriterion().checkCancelInProgress(null);
+ cache.getCancelCriterion().checkCancelInProgress(null);
boolean interrupted = Thread.interrupted();
try {
latch.await();
break;
} catch (InterruptedException e) {
interrupted = true;
- this.cache.getCancelCriterion().checkCancelInProgress(e);
+ cache.getCancelCriterion().checkCancelInProgress(e);
// continue waiting
} finally {
if (interrupted) {
@@ -4785,17 +4785,17 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* Wait until data is ready in this region
*/
public void waitForData() {
- if (this.initialized) {
+ if (initialized) {
return;
}
- waitOnInitialization(this.getInitializationLatchAfterGetInitialImage());
+ waitOnInitialization(getInitializationLatchAfterGetInitialImage());
}
/** return null if not found */
@Override
public RegionEntry basicGetEntry(Object key) {
// ok to ignore tx state; all callers are non-transactional
- RegionEntry regionEntry = this.entries.getEntry(key);
+ RegionEntry regionEntry = entries.getEntry(key);
if (regionEntry != null && regionEntry.isRemoved()) {
regionEntry = null;
}
@@ -4818,9 +4818,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public DiskEntry initializeRecoveredEntry(Object key, DiskEntry.RecoveredEntry re) {
- Assert.assertTrue(this.diskRegion != null);
+ Assert.assertTrue(diskRegion != null);
// region operation so it is ok to ignore tx state
- RegionEntry regionEntry = this.entries.initRecoveredEntry(key, re);
+ RegionEntry regionEntry = entries.initRecoveredEntry(key, re);
if (regionEntry == null) {
throw new InternalGemFireError(
String.format("Entry already existed: %s", key));
@@ -4835,15 +4835,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public DiskEntry updateRecoveredEntry(Object key, DiskEntry.RecoveredEntry re) {
- Assert.assertTrue(this.diskRegion != null);
+ Assert.assertTrue(diskRegion != null);
// region operation so it is ok to ignore tx state
- RegionEntry regionEntry = this.entries.updateRecoveredEntry(key, re);
+ RegionEntry regionEntry = entries.updateRecoveredEntry(key, re);
return (DiskEntry) regionEntry;
}
@Override
public void copyRecoveredEntries(RegionMap rm) {
- this.entries.copyRecoveredEntries(rm);
+ entries.copyRecoveredEntries(rm);
}
@Override
@@ -4851,10 +4851,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// TODO - RVV - I'm not sure about this recordGCVersion method. It seems like it's not doing the
// right thing if the current member is the member we just recovered. We need to update the RVV
// in memory
- this.versionVector.recordGCVersion(member, gcVersion);
+ versionVector.recordGCVersion(member, gcVersion);
// We also need to update the RVV that represents what we have persisted on disk
- DiskRegion region = this.getDiskRegion();
+ DiskRegion region = getDiskRegion();
if (region != null) {
region.recordRecoveredGCVersion(member, gcVersion);
}
@@ -4863,10 +4863,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void recordRecoveredVersonHolder(VersionSource member, RegionVersionHolder versionHolder,
boolean latestOplog) {
- if (this.getConcurrencyChecksEnabled()) {
+ if (getConcurrencyChecksEnabled()) {
// We need to update the RVV in memory
- this.versionVector.initRecoveredVersion(member, versionHolder, latestOplog);
- DiskRegion region = this.getDiskRegion();
+ versionVector.initRecoveredVersion(member, versionHolder, latestOplog);
+ DiskRegion region = getDiskRegion();
// We also need to update the RVV that represents what we have persisted on disk
if (region != null) {
region.recordRecoveredVersonHolder(member, versionHolder, latestOplog);
@@ -4876,9 +4876,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void recordRecoveredVersionTag(VersionTag tag) {
- if (this.getConcurrencyChecksEnabled()) {
- this.versionVector.recordVersion(tag.getMemberID(), tag.getRegionVersion());
- DiskRegion region = this.getDiskRegion();
+ if (getConcurrencyChecksEnabled()) {
+ versionVector.recordVersion(tag.getMemberID(), tag.getRegionVersion());
+ DiskRegion region = getDiskRegion();
// We also need to update the RVV that represents what we have persisted on disk
if (region != null) {
region.recordRecoveredVersionTag(tag);
@@ -4888,8 +4888,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void setRVVTrusted(boolean rvvTrusted) {
- if (this.getConcurrencyChecksEnabled()) {
- DiskRegion region = this.getDiskRegion();
+ if (getConcurrencyChecksEnabled()) {
+ DiskRegion region = getDiskRegion();
// Update whether or not the RVV we have recovered is trusted (accurately represents what we
// have on disk).
if (region != null) {
@@ -4906,7 +4906,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return ((DistributedRegion) this).getBestIterator(includeValues);
}
- return this.entries.regionEntries().iterator();
+ return entries.regionEntries().iterator();
}
/**
@@ -4931,7 +4931,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*
*/
void repairRVV() {
- RegionVersionVector rvv = this.getVersionVector();
+ RegionVersionVector rvv = getVersionVector();
if (rvv == null) {
// No need to do anything.
@@ -4961,7 +4961,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
private void basicInvalidate(final EntryEventImpl event, boolean invokeCallbacks)
throws EntryNotFoundException {
- final boolean forceNewEntryInClientCache = this.serverRegionProxy != null
+ final boolean forceNewEntryInClientCache = serverRegionProxy != null
&& getConcurrencyChecksEnabled();
basicInvalidate(event, invokeCallbacks, forceNewEntryInClientCache);
}
@@ -4987,7 +4987,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
logger.trace(LogMarker.DM_VERBOSE,
"LR.basicInvalidate: this cache has already seen this event {}", event);
}
- if (this.getConcurrencyChecksEnabled() && event.getVersionTag() != null
+ if (getConcurrencyChecksEnabled() && event.getVersionTag() != null
&& !event.getVersionTag().isRecorded()) {
getVersionVector().recordVersion((InternalDistributedMember) event.getDistributedMember(),
event.getVersionTag());
@@ -5008,7 +5008,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
regionEntry.dispatchListenerEvents(event);
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
}
} else {
event.callbacksInvoked(true);
@@ -5057,7 +5057,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
FilterRoutingInfo filterRoutingInfo, ClientProxyMembershipID bridgeContext,
TXEntryState txEntryState, VersionTag versionTag, long tailKey) {
- this.entries.txApplyInvalidate(key, newValue, didDestroy, transactionId, event, localOp,
+ entries.txApplyInvalidate(key, newValue, didDestroy, transactionId, event, localOp,
eventId, aCallbackArgument, pendingCallbacks, filterRoutingInfo, bridgeContext,
txEntryState, versionTag, tailKey);
}
@@ -5068,8 +5068,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
void txApplyInvalidatePart2(RegionEntry regionEntry, Object key, boolean didDestroy,
boolean didInvalidate) {
- if (this.testCallable != null) {
- this.testCallable.call(this, Operation.INVALIDATE, regionEntry);
+ if (testCallable != null) {
+ testCallable.call(this, Operation.INVALIDATE, regionEntry);
}
if (didInvalidate) {
updateStatsForInvalidate();
@@ -5131,7 +5131,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
ClientProxyMembershipID bridgeContext, TXEntryState txEntryState, VersionTag versionTag,
long tailKey) {
long startPut = CachePerfStats.getStatTime();
- this.entries.txApplyPut(putOp, key, newValue, didDestroy, transactionId, event, eventId,
+ entries.txApplyPut(putOp, key, newValue, didDestroy, transactionId, event, eventId,
aCallbackArgument, pendingCallbacks, filterRoutingInfo, bridgeContext, txEntryState,
versionTag, tailKey);
updateStatsForPut(startPut);
@@ -5150,17 +5150,17 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void txApplyPutPart2(RegionEntry regionEntry, Object key, long lastModified,
boolean isCreate, boolean didDestroy, boolean clearConflict) {
- if (this.testCallable != null) {
+ if (testCallable != null) {
Operation op = isCreate ? Operation.CREATE : Operation.UPDATE;
- this.testCallable.call(this, op, regionEntry);
+ testCallable.call(this, op, regionEntry);
}
if (isCreate) {
updateStatsForCreate();
}
if (!isProxy() && !clearConflict) {
- if (this.indexManager != null) {
+ if (indexManager != null) {
try {
- this.indexManager.updateIndexes(regionEntry,
+ indexManager.updateIndexes(regionEntry,
isCreate ? IndexManager.ADD_ENTRY : IndexManager.UPDATE_ENTRY,
isCreate ? IndexProtocol.OTHER_OP : IndexProtocol.AFTER_UPDATE_OP);
} catch (QueryException e) {
@@ -5171,7 +5171,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (didDestroy) {
entryUserAttributes.remove(key);
}
- if (this.statisticsEnabled && !clearConflict) {
+ if (statisticsEnabled && !clearConflict) {
addExpiryTaskIfAbsent(regionEntry);
}
setLastModifiedTime(lastModified);
@@ -5242,7 +5242,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
clientEvent.setVersionTag(event.getVersionTag());
getCachePerfStats().endPut(startPut, event.isOriginRemote());
} else {
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
if (throwEntryExists) {
throw new EntryExistsException("" + key, event.getOldValue());
}
@@ -5311,7 +5311,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
clientEvent.setVersionTag(event.getVersionTag());
getCachePerfStats().endPut(startPut, event.isOriginRemote());
} else {
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
}
return success;
@@ -5325,10 +5325,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* expectations
*/
private void concurrencyConfigurationCheck(VersionTag tag) {
- if (!this.concurrencyMessageIssued && tag == null && this.getConcurrencyChecksEnabled()) {
- this.concurrencyMessageIssued = true;
+ if (!concurrencyMessageIssued && tag == null && getConcurrencyChecksEnabled()) {
+ concurrencyMessageIssued = true;
logger.info("Server has concurrencyChecksEnabled {} but client has {} for region {}",
- new Object[] {!this.getConcurrencyChecksEnabled(), this.getConcurrencyChecksEnabled(),
+ new Object[] {!getConcurrencyChecksEnabled(), getConcurrencyChecksEnabled(),
this});
}
}
@@ -5351,7 +5351,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// Generate EventID as it is possible that client is a cache server
// in hierarchical cache
- if (generateEventID() && !this.cache.getCacheServers().isEmpty()) {
+ if (generateEventID() && !cache.getCacheServers().isEmpty()) {
event.setNewEventId(cache.getDistributedSystem());
} else {
event.setEventId(eventID);
@@ -5412,7 +5412,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
event.setVersionTag(versionTag);
event.setFromServer(true);
- if (generateEventID() && !this.cache.getCacheServers().isEmpty()) {
+ if (generateEventID() && !cache.getCacheServers().isEmpty()) {
event.setNewEventId(cache.getDistributedSystem());
} else {
event.setEventId(eventID);
@@ -5424,7 +5424,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// callbacks.
if (processedMarker) {
// changed to force new entry creation for consistency
- final boolean forceNewEntry = this.getConcurrencyChecksEnabled();
+ final boolean forceNewEntry = getConcurrencyChecksEnabled();
basicInvalidate(event, true, forceNewEntry);
if (event.isConcurrencyConflict()) {
// bug #45520 - we must throw this for the CacheClientUpdater
@@ -5461,7 +5461,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
event.setFromServer(true);
event.setVersionTag(versionTag);
- if (generateEventID() && !this.cache.getCacheServers().isEmpty()) {
+ if (generateEventID() && !cache.getCacheServers().isEmpty()) {
event.setNewEventId(cache.getDistributedSystem());
} else {
event.setEventId(eventID);
@@ -5618,7 +5618,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
logger.trace(LogMarker.DM_VERBOSE,
"LR.basicDestroy: this cache has already seen this event {}", event);
}
- if (this.getConcurrencyChecksEnabled() && event.getVersionTag() != null
+ if (getConcurrencyChecksEnabled() && event.getVersionTag() != null
&& !event.getVersionTag().isRecorded()) {
getVersionVector().recordVersion((InternalDistributedMember) event.getDistributedMember(),
event.getVersionTag());
@@ -5651,11 +5651,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
throws TimeoutException, CacheWriterException {
// check validity of key against keyConstraint
- if (this.keyConstraint != null) {
- if (!this.keyConstraint.isInstance(event.getKey())) {
+ if (keyConstraint != null) {
+ if (!keyConstraint.isInstance(event.getKey())) {
throw new ClassCastException(
String.format("key ( %s ) does not satisfy keyConstraint ( %s )",
- event.getKey().getClass().getName(), this.keyConstraint.getName()));
+ event.getKey().getClass().getName(), keyConstraint.getName()));
}
}
@@ -5681,7 +5681,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
RegionEntry oldEntry;
try {
- oldEntry = this.entries.basicPut(event, lastModified, ifNew, ifOld, expectedOldValue,
+ oldEntry = entries.basicPut(event, lastModified, ifNew, ifOld, expectedOldValue,
requireOldValue, overwriteDestroyed);
} catch (ConcurrentCacheModificationException ignore) {
// this can happen in a client cache when another thread
@@ -5699,7 +5699,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// for EMPTY clients, see if a concurrent map operation had an entry on the server
ServerRegionProxy mySRP = getServerProxy();
- if (mySRP != null && this.getDataPolicy() == DataPolicy.EMPTY) {
+ if (mySRP != null && getDataPolicy() == DataPolicy.EMPTY) {
if (originalOp == Operation.PUT_IF_ABSENT) {
return !event.hasOldValue();
}
@@ -5740,7 +5740,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
Set<DistributedMember> membersThatReachedThreshold = info.getMembersThatReachedThreshold();
// #45603: trigger a background eviction since we're above the the critical
// threshold
- InternalResourceManager.getInternalResourceManager(this.cache).getHeapMonitor()
+ InternalResourceManager.getInternalResourceManager(cache).getHeapMonitor()
.updateStateAndSendEvent();
throw new LowMemoryException(
String.format(
@@ -5756,7 +5756,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return MemoryThresholdInfo.getNotReached();
}
return new MemoryThresholdInfo(isMemoryThresholdReached(),
- Collections.singleton(this.cache.getMyId()));
+ Collections.singleton(cache.getMyId()));
}
@Override
@@ -5817,10 +5817,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
updateStatsForPut(entry, lastModifiedTime, lruRecentUse);
if (!isProxy()) {
- if (!clearConflict && this.indexManager != null) {
+ if (!clearConflict && indexManager != null) {
try {
if (!entry.isInvalid()) {
- this.indexManager.updateIndexes(entry,
+ indexManager.updateIndexes(entry,
isNewKey ? IndexManager.ADD_ENTRY : IndexManager.UPDATE_ENTRY,
isNewKey ? IndexProtocol.OTHER_OP : IndexProtocol.AFTER_UPDATE_OP);
}
@@ -5840,13 +5840,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (event.isGenerateCallbacks()) {
doCallback = true;
}
- } else if (this.isUsedForPartitionedRegionBucket) {
+ } else if (isUsedForPartitionedRegionBucket) {
// invokePutCallbacks in BucketRegion will be more discriminating
doCallback = true;
}
if (doCallback) {
- if (event.isBulkOpInProgress() && this.isUsedForPartitionedRegionBucket) {
+ if (event.isBulkOpInProgress() && isUsedForPartitionedRegionBucket) {
if (logger.isDebugEnabled()) {
logger.debug(
"For bulk operation on bucket region, not to notify gateway sender earlier.");
@@ -5862,7 +5862,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
entry.dispatchListenerEvents(event);
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
}
}
}
@@ -5882,7 +5882,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean isEntryEvent = event.getOperation().isEntry();
EntryEventImpl entryEvent = isEntryEvent ? (EntryEventImpl) event : null;
- FilterProfile filterProfile = this.getFilterProfile();
+ FilterProfile filterProfile = getFilterProfile();
FilterInfo routing = event.getLocalFilterInfo();
if (filterProfile != null && routing == null) {
@@ -6036,7 +6036,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
EntryEventImpl entryEvent = (EntryEventImpl) event;
if (!entryEvent.isOriginRemote() && shouldGenerateVersionTag(entry, entryEvent)) {
boolean eventHasDelta = getSystem().getConfig().getDeltaPropagation()
- && !this.scope.isDistributedNoAck() && entryEvent.getDeltaBytes() != null;
+ && !scope.isDistributedNoAck() && entryEvent.getDeltaBytes() != null;
VersionTag v = entry.generateVersionTag(null, eventHasDelta, this, entryEvent);
if (logger.isDebugEnabled() && v != null) {
logger.debug("generated version tag {} for {}", v, entryEvent.getKey());
@@ -6135,7 +6135,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (shouldNotifyBridgeClients()) {
if (logger.isDebugEnabled()) {
- logger.debug("{}: notifying {} cache servers of event: {}", this.getName(), numBS,
+ logger.debug("{}: notifying {} cache servers of event: {}", getName(), numBS,
event);
}
@@ -6158,7 +6158,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
InternalCacheEvent ice = (InternalCacheEvent) event;
- if (!this.isUsedForPartitionedRegionBucket()) {
+ if (!isUsedForPartitionedRegionBucket()) {
generateLocalFilterRouting(ice);
}
@@ -6219,7 +6219,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
for (GatewaySender sender : getCache().getAllGatewaySenders()) {
if (allGatewaySenderIds.contains(sender.getId())) {
// TODO: This is a BUG. Why return and not continue?
- if (!this.getDataPolicy().withStorage() && sender.isParallel()) {
+ if (!getDataPolicy().withStorage() && sender.isParallel()) {
return;
}
if (logger.isDebugEnabled()) {
@@ -6248,7 +6248,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean callbackEvents) throws CacheWriterException, TimeoutException {
preDestroyChecks();
- final TXStateProxy tx = this.cache.getTXMgr().pauseTransaction();
+ final TXStateProxy tx = cache.getTXMgr().pauseTransaction();
try {
boolean acquiredLock = false;
if (lock) {
@@ -6281,19 +6281,19 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
cacheWrite, lock, callbackEvents);
}
- if (this.parentRegion != null) {
+ if (parentRegion != null) {
// "Bubble up" the cache statistics to parent if this regions are more recent
- this.parentRegion.updateStats();
+ parentRegion.updateStats();
}
try {
eventSet = callbackEvents ? new HashSet() : null;
- this.destroyedSubregionSerialNumbers = collectSubregionSerialNumbers();
+ destroyedSubregionSerialNumbers = collectSubregionSerialNumbers();
recursiveDestroyRegion(eventSet, event, cacheWrite);
} catch (CancelException e) {
// This should be properly caught and ignored; if we see this there is
// a serious problem.
- if (!this.cache.forcedDisconnect()) {
+ if (!cache.forcedDisconnect()) {
logger.warn(String.format(
"recursiveDestroyRegion: recursion failed due to cache closure. region, %s",
getFullPath()),
@@ -6307,25 +6307,25 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// at this point all subregions are destroyed and this region has been marked as destroyed
// and postDestroyRegion has been called for each region. The only detail left is
// unhooking this region from the parent subregion map, and sending listener events
- Assert.assertTrue(this.isDestroyed);
+ Assert.assertTrue(isDestroyed);
// Added for M&M : At this point we can safely call ResourceEvent to remove the region
// artifacts From Management Layer
if (!isInternalRegion()) {
- InternalDistributedSystem system = this.cache.getInternalDistributedSystem();
+ InternalDistributedSystem system = cache.getInternalDistributedSystem();
system.handleResourceEvent(ResourceEvent.REGION_REMOVE, this);
}
try {
- LocalRegion parent = this.parentRegion;
+ LocalRegion parent = parentRegion;
if (parent == null) {
- this.cache.removeRoot(this);
+ cache.removeRoot(this);
} else {
- parent.subregions.remove(this.regionName, this);
+ parent.subregions.remove(regionName, this);
}
} catch (CancelException e) {
// I don't think this should ever happens: bulletproofing for bug 39454
- if (!this.cache.forcedDisconnect()) {
+ if (!cache.forcedDisconnect()) {
logger.warn(String.format(
"basicDestroyRegion: parent removal failed due to cache closure. region, %s",
getFullPath()),
@@ -6365,7 +6365,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
} finally {
- this.cache.getTXMgr().unpauseTransaction(tx);
+ cache.getTXMgr().unpauseTransaction(tx);
}
}
@@ -6389,12 +6389,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void postCreateRegion() {
if (getEvictionAttributes().getAlgorithm().isLRUHeap()) {
- final LogWriter logWriter = this.cache.getLogger();
+ final LogWriter logWriter = cache.getLogger();
float evictionPercentage = DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE;
// This is new to 6.5. If a heap lru region is created
// we make sure that the eviction percentage is enabled.
- InternalResourceManager rm = this.cache.getInternalResourceManager();
+ InternalResourceManager rm = cache.getInternalResourceManager();
if (!getOffHeap()) {
if (!rm.getHeapMonitor().hasEvictionThreshold()) {
float criticalPercentage = rm.getCriticalHeapPercentage();
@@ -6452,16 +6452,16 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* This method is invoked after isDestroyed has been set to true
*/
void postDestroyRegion(boolean destroyDiskRegion, RegionEventImpl event) {
- if (this.diskRegion != null) {
+ if (diskRegion != null) {
if (destroyDiskRegion) {
- this.diskRegion.endDestroy(this);
+ diskRegion.endDestroy(this);
} else {
- this.diskRegion.close(this);
+ diskRegion.close(this);
}
}
- if (this.versionVector != null) {
+ if (versionVector != null) {
try {
- this.cache.getDistributionManager().removeMembershipListener(this.versionVector);
+ cache.getDistributionManager().removeMembershipListener(versionVector);
} catch (CancelException ignore) {
// ignore: cache close will remove the membership listener
}
@@ -6488,7 +6488,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
logger.trace(LogMarker.DM_VERBOSE,
"LR.basicDestroy: this cache has already seen this event {}", event);
}
- if (this.getConcurrencyChecksEnabled() && event.getVersionTag() != null
+ if (getConcurrencyChecksEnabled() && event.getVersionTag() != null
&& !event.getVersionTag().isRecorded()) {
getVersionVector().recordVersion((InternalDistributedMember) event.getDistributedMember(),
event.getVersionTag());
@@ -6572,11 +6572,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// whether a RI is in progress and that riCnt will not change during this
// destroy operation
try {
- final boolean needRIDestroyToken = inRI && this.riCnt > 0;
+ final boolean needRIDestroyToken = inRI && riCnt > 0;
final boolean inTokenMode = needTokensForGII || needRIDestroyToken;
// the following will call basicDestroyPart2 at the correct moment
- return this.entries.destroy(event, inTokenMode, needRIDestroyToken, cacheWrite, isEviction,
+ return entries.destroy(event, inTokenMode, needRIDestroyToken, cacheWrite, isEviction,
expectedOldValue, removeRecoveredEntry);
} catch (ConcurrentCacheModificationException ignore) {
@@ -6651,7 +6651,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
String msg =
String.format(
"A DiskAccessException has occurred while writing to the disk for region %s. The cache will be closed.",
- this.fullPath);
+ fullPath);
logger.error(msg, dae);
// forward the error to the disk store
@@ -6681,7 +6681,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// Fix for bug#36963
if (generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
return event;
}
@@ -6752,7 +6752,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* completes. RI does not create Tombstones because it would flood the TombstoneService with
* unnecessary work.
*/
- if (inTokenMode && !(this.getConcurrencyChecksEnabled() || event.isFromRILocalDestroy())) {
+ if (inTokenMode && !(getConcurrencyChecksEnabled() || event.isFromRILocalDestroy())) {
if (re.isDestroyed()) {
getImageState().addDestroyedEntry(event.getKey());
if (!(this instanceof HARegion)) {
@@ -6762,7 +6762,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
}
} else {
- if (this.getConcurrencyChecksEnabled() && !(this instanceof HARegion)) {
+ if (getConcurrencyChecksEnabled() && !(this instanceof HARegion)) {
if (logger.isDebugEnabled()) {
logger.debug("basicDestroyPart2: {}, version={}", event.getKey(), v);
}
@@ -6775,7 +6775,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* token.
*/
- if (event.isBulkOpInProgress() && this.isUsedForPartitionedRegionBucket) {
+ if (event.isBulkOpInProgress() && isUsedForPartitionedRegionBucket) {
if (logger.isDebugEnabled()) {
logger.debug("For bulk operation on bucket region, not to notify gateway sender earlier.");
}
@@ -6786,12 +6786,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// invoke callbacks if initialized and told to do so, or if this is a bucket in a partitioned
// region
if (invokeCallbacks && !event.isBulkOpInProgress()) {
- if (isInitialized() && (!inTokenMode || duringRI) || this.isUsedForPartitionedRegionBucket) {
+ if (isInitialized() && (!inTokenMode || duringRI) || isUsedForPartitionedRegionBucket) {
try {
re.dispatchListenerEvents(event);
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
}
} else {
event.callbacksInvoked(true);
@@ -6901,11 +6901,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
VersionTag versionTag, long tailKey) {
final boolean inRI = !needTokensForGII && lockRIReadLock();
- final boolean needRIDestroyToken = inRI && this.riCnt > 0;
+ final boolean needRIDestroyToken = inRI && riCnt > 0;
try {
final boolean inTokenMode = needTokensForGII || needRIDestroyToken;
- this.entries.txApplyDestroy(key, rmtOrigin, event, inTokenMode, needRIDestroyToken, op,
+ entries.txApplyDestroy(key, rmtOrigin, event, inTokenMode, needRIDestroyToken, op,
eventId, aCallbackArgument, pendingCallbacks, filterRoutingInfo, bridgeContext,
isOriginRemote, txEntryState, versionTag, tailKey);
} finally {
@@ -6921,8 +6921,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
void txApplyDestroyPart2(RegionEntry re, Object key, boolean inTokenMode, boolean clearConflict,
boolean alreadyDestroyedOrRemoved) {
- if (this.testCallable != null) {
- this.testCallable.call(this, Operation.DESTROY, re);
+ if (testCallable != null) {
+ testCallable.call(this, Operation.DESTROY, re);
}
if (inTokenMode) {
getImageState().addDestroyedEntry(key);
@@ -6933,9 +6933,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
void basicInvalidateRegion(RegionEventImpl event) {
- final TXStateProxy tx = this.cache.getTXMgr().pauseTransaction();
+ final TXStateProxy tx = cache.getTXMgr().pauseTransaction();
try {
- this.setRegionInvalid(true);
+ setRegionInvalid(true);
getImageState().setRegionInvalidated(true);
invalidateAllEntries(event);
@@ -6977,7 +6977,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
} finally {
- this.cache.getTXMgr().unpauseTransaction(tx);
+ cache.getTXMgr().unpauseTransaction(tx);
}
}
@@ -7038,12 +7038,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
}
- if (this.cache.getEventThreadPool() == null) {
+ if (cache.getEventThreadPool() == null) {
dispatchEvent(this, event, op);
} else {
final EventDispatcher eventDispatcher = new EventDispatcher(event, op);
try {
- this.cache.getEventThreadPool().execute(eventDispatcher);
+ cache.getEventThreadPool().execute(eventDispatcher);
} catch (RejectedExecutionException ignore) {
eventDispatcher.release();
dispatchEvent(this, event, op);
@@ -7068,18 +7068,18 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
/** @return true if initialization is complete */
@Override
public boolean isInitialized() {
- if (this.initialized) {
+ if (initialized) {
return true;
}
- StoppableCountDownLatch latch = this.getInitializationLatchAfterGetInitialImage();
+ StoppableCountDownLatch latch = getInitializationLatchAfterGetInitialImage();
if (latch == null) {
return true;
}
long count = latch.getCount();
if (count == 0) {
- this.initialized = true;
+ initialized = true;
return true;
}
@@ -7097,14 +7097,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
LocalRegion root = getRoot();
boolean acquired = false;
do {
- this.cache.getCancelCriterion().checkCancelInProgress(null);
+ cache.getCancelCriterion().checkCancelInProgress(null);
boolean interrupted = Thread.interrupted();
try {
root.destroyLock.acquire();
acquired = true;
} catch (InterruptedException ie) {
interrupted = true;
- this.cache.getCancelCriterion().checkCancelInProgress(ie);
+ cache.getCancelCriterion().checkCancelInProgress(ie);
} finally {
if (interrupted) {
Thread.currentThread().interrupt();
@@ -7130,23 +7130,23 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void cleanupFailedInitialization() {
// mark as destroyed fixes 49555.
- this.isDestroyed = true;
+ isDestroyed = true;
// after isDestroyed is set to true call removeResourceListener to fix bug 49555
- this.cache.getInternalResourceManager(false).removeResourceListener(this);
+ cache.getInternalResourceManager(false).removeResourceListener(this);
// fixes bug 41333
closeEntries();
- this.destroyedSubregionSerialNumbers = collectSubregionSerialNumbers();
+ destroyedSubregionSerialNumbers = collectSubregionSerialNumbers();
try {
getEventTracker().stop();
- if (this.diskRegion != null) {
+ if (diskRegion != null) {
// This was needed to fix bug 30937
try {
- this.diskRegion.cleanupFailedInitialization(this);
+ diskRegion.cleanupFailedInitialization(this);
} catch (IllegalStateException ignore) {
// just ignore this exception since whoever called us is going
// to report the exception that caused initialization to fail.
@@ -7154,10 +7154,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
// Clean up region in RegionListeners
- this.cache.invokeCleanupFailedInitialization(this);
+ cache.invokeCleanupFailedInitialization(this);
} finally {
// make sure any waiters on initializing Latch are released
- this.releaseLatches();
+ releaseLatches();
}
}
@@ -7171,8 +7171,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private void initializationFailed(LocalRegion subregion) {
// bugfix for bug#34883
- synchronized (this.subregionsLock) {
- this.subregions.remove(subregion.getName());
+ synchronized (subregionsLock) {
+ subregions.remove(subregion.getName());
}
subregion.cleanupFailedInitialization();
}
@@ -7198,7 +7198,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
entry.updateStatsForPut(lastModified, lastAccessed);
- if (this.statisticsEnabled && !isProxy()) {
+ if (statisticsEnabled && !isProxy()) {
// do not reschedule if there is already a task in the queue.
// this prevents bloat in the TimerTask since cancelled tasks
// do not actually get removed from the TimerQueue.
@@ -7218,7 +7218,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @return the region or null if not found, may be destroyed
*/
private LocalRegion basicGetSubregion(String name) {
- LocalRegion region = toRegion(this.subregions.get(name));
+ LocalRegion region = toRegion(subregions.get(name));
// don't wait for reinitialization if the init_level for this thread is
// ANY_INIT: We don't want CreateRegion messages to wait on a future
@@ -7230,7 +7230,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (logger.isDebugEnabled()) {
logger.debug("Trying reinitializing region, fullPath={}", thePath);
}
- region = (LocalRegion) this.cache.getReinitializingRegion(thePath);
+ region = (LocalRegion) cache.getReinitializingRegion(thePath);
if (logger.isDebugEnabled()) {
logger.debug("Reinitialized region is {}", region);
}
@@ -7259,7 +7259,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @param regionEntry the entry whose value was accessed
*/
void updateStatsForGet(final RegionEntry regionEntry, final boolean hit) {
- if (!this.statisticsEnabled) {
+ if (!statisticsEnabled) {
return;
}
@@ -7280,7 +7280,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
RegionEventImpl regionEventImpl = (RegionEventImpl) regionEvent;
regionEventImpl.region.dispatchListenerEvent(EnumListenerEvent.AFTER_REGION_DESTROY,
regionEventImpl);
- if (!this.cache.forcedDisconnect()) {
+ if (!cache.forcedDisconnect()) {
SystemMemberCacheEventProcessor.send(getCache(), regionEventImpl.getRegion(),
regionEventImpl.getOperation());
}
@@ -7317,8 +7317,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
ServerRegionProxy serverRegionProxy = getServerProxy();
if (serverRegionProxy != null) {
InternalCache internalCache = getCache();
- String poolName = this.getPoolName();
- PoolImpl pool = (PoolImpl) PoolManager.find(this.getPoolName());
+ String poolName = getPoolName();
+ PoolImpl pool = (PoolImpl) PoolManager.find(getPoolName());
if (poolName != null && pool != null) {
serverRegionProxy
.detach(internalCache.keepDurableSubscriptionsAlive() || pool.getKeepAlive());
@@ -7362,7 +7362,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public void handleCacheClose(Operation operation) {
RegionEventImpl event =
new RegionEventImpl(this, operation, null, false, getMyId(), generateEventID());
- if (!this.isDestroyed) { // don't destroy if already destroyed
+ if (!isDestroyed) { // don't destroy if already destroyed
try {
basicDestroyRegion(event, false, true, true);
} catch (CancelException ignore) {
@@ -7392,21 +7392,21 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
private void checkCacheClosed() {
- if (this.cache.isClosed()) {
- throw this.cache.getCacheClosedException(null, null);
+ if (cache.isClosed()) {
+ throw cache.getCacheClosedException(null, null);
}
}
private void checkRegionDestroyed(boolean checkCancel) {
if (checkCancel) {
- this.cache.getCancelCriterion().checkCancelInProgress(null);
+ cache.getCancelCriterion().checkCancelInProgress(null);
}
- if (this.isDestroyed) {
+ if (isDestroyed) {
RegionDestroyedException regionDestroyedException;
- if (this.reinitialized_old) {
+ if (reinitialized_old) {
regionDestroyedException = new RegionReinitializedException(toString(), getFullPath());
- } else if (this.cache.isCacheAtShutdownAll()) {
+ } else if (cache.isCacheAtShutdownAll()) {
throw cache.getCacheClosedException("Cache is being closed by ShutdownAll");
} else {
regionDestroyedException = new RegionDestroyedException(toString(), getFullPath());
@@ -7415,13 +7415,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// Race condition could cause the cache to be destroyed after the
// cache close check above, so we need to re-check before throwing.
if (checkCancel) {
- this.cache.getCancelCriterion().checkCancelInProgress(null);
+ cache.getCancelCriterion().checkCancelInProgress(null);
}
throw regionDestroyedException;
}
- if (this.isDestroyedForParallelWAN) {
+ if (isDestroyedForParallelWAN) {
throw new RegionDestroyedException(
"Region is being destroyed. Waiting for paralle queue to drain.",
getFullPath());
@@ -7435,7 +7435,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public void foreachRegionEntry(RegionEntryCallback callback) {
- for (RegionEntry regionEntry : this.entries.regionEntriesInVM()) {
+ for (RegionEntry regionEntry : entries.regionEntriesInVM()) {
callback.handleRegionEntry(regionEntry);
}
}
@@ -7455,7 +7455,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
private int allSubregionsSize() {
int size = 1; /* 1 for this region */
- for (Object regionObject : this.subregions.values()) {
+ for (Object regionObject : subregions.values()) {
LocalRegion region = (LocalRegion) regionObject;
if (region != null && region.isInitialized() && !region.isDestroyed()) {
size += region.allSubregionsSize();
@@ -7470,7 +7470,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
int allEntriesSize() {
int size = entryCount();
- for (Object regionObject : this.subregions.values()) {
+ for (Object regionObject : subregions.values()) {
LocalRegion region = toRegion(regionObject);
if (region != null && !region.isDestroyed()) {
size += region.allEntriesSize();
@@ -7523,7 +7523,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public DiskStoreImpl getDiskStore() {
- return this.diskStoreImpl;
+ return diskStoreImpl;
}
/**
@@ -7617,7 +7617,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return region;
}
- if (this.diskStoreImpl == null) {
+ if (diskStoreImpl == null) {
return null;
}
@@ -7632,12 +7632,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
EnumSet<DiskRegionFlag> diskFlags = EnumSet.noneOf(DiskRegionFlag.class);
// Add flag if this region has versioning enabled
- if (this.getAttributes().getConcurrencyChecksEnabled()) {
+ if (getAttributes().getConcurrencyChecksEnabled()) {
diskFlags.add(DiskRegionFlag.IS_WITH_VERSIONING);
}
// TODO: fix NO_PARTITITON typo
- return DiskRegion.create(this.diskStoreImpl, getFullPath(), false,
+ return DiskRegion.create(diskStoreImpl, getFullPath(), false,
getDataPolicy().withPersistence(), isOverflowEnabled(), isDiskSynchronous(), stats,
getCancelCriterion(), this, getAttributes(), diskFlags, "NO_PARTITITON", -1,
getCompressor(), getOffHeap());
@@ -7662,44 +7662,44 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* Add the Region TTL expiry task to the scheduler
*/
void addTTLExpiryTask() {
- synchronized (this.regionExpiryLock) {
- RegionTTLExpiryTask task = this.regionTTLExpiryTask;
+ synchronized (regionExpiryLock) {
+ RegionTTLExpiryTask task = regionTTLExpiryTask;
if (task != null) {
task.cancel();
}
- if (this.regionTimeToLive > 0) {
- this.regionTTLExpiryTask = (RegionTTLExpiryTask) this.cache.getExpirationScheduler()
+ if (regionTimeToLive > 0) {
+ regionTTLExpiryTask = (RegionTTLExpiryTask) cache.getExpirationScheduler()
.addExpiryTask(new RegionTTLExpiryTask(this));
- if (this.regionTTLExpiryTask != null) {
+ if (regionTTLExpiryTask != null) {
if (logger.isDebugEnabled()) {
- logger.debug("Initialized Region TTL Expiry Task {}", this.regionTTLExpiryTask);
+ logger.debug("Initialized Region TTL Expiry Task {}", regionTTLExpiryTask);
}
}
} else {
- this.regionTTLExpiryTask = null;
+ regionTTLExpiryTask = null;
}
}
}
void addTTLExpiryTask(RegionTTLExpiryTask callingTask) {
- synchronized (this.regionExpiryLock) {
- if (this.regionTTLExpiryTask != null && this.regionTTLExpiryTask != callingTask) {
+ synchronized (regionExpiryLock) {
+ if (regionTTLExpiryTask != null && regionTTLExpiryTask != callingTask) {
return;
}
- if (this.regionTimeToLive <= 0) {
- this.regionTTLExpiryTask = null;
+ if (regionTimeToLive <= 0) {
+ regionTTLExpiryTask = null;
return;
}
RegionTTLExpiryTask task = new RegionTTLExpiryTask(this);
if (logger.isDebugEnabled()) {
logger.debug("Scheduling Region TTL Expiry Task {} which replaces {}", task,
- this.regionTTLExpiryTask);
+ regionTTLExpiryTask);
}
- this.regionTTLExpiryTask =
- (RegionTTLExpiryTask) this.cache.getExpirationScheduler().addExpiryTask(task);
+ regionTTLExpiryTask =
+ (RegionTTLExpiryTask) cache.getExpirationScheduler().addExpiryTask(task);
}
}
@@ -7707,44 +7707,44 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* Add the Region Idle expiry task to the scheduler
*/
void addIdleExpiryTask() {
- synchronized (this.regionExpiryLock) {
- RegionIdleExpiryTask task = this.regionIdleExpiryTask;
+ synchronized (regionExpiryLock) {
+ RegionIdleExpiryTask task = regionIdleExpiryTask;
if (task != null) {
task.cancel();
}
- if (this.regionIdleTimeout > 0) {
- this.regionIdleExpiryTask = (RegionIdleExpiryTask) this.cache.getExpirationScheduler()
+ if (regionIdleTimeout > 0) {
+ regionIdleExpiryTask = (RegionIdleExpiryTask) cache.getExpirationScheduler()
.addExpiryTask(new RegionIdleExpiryTask(this));
- if (this.regionIdleExpiryTask != null) {
+ if (regionIdleExpiryTask != null) {
if (logger.isDebugEnabled()) {
- logger.debug("Initialized Region Idle Expiry Task {}", this.regionIdleExpiryTask);
+ logger.debug("Initialized Region Idle Expiry Task {}", regionIdleExpiryTask);
}
}
} else {
- this.regionIdleExpiryTask = null;
+ regionIdleExpiryTask = null;
}
}
}
void addIdleExpiryTask(RegionIdleExpiryTask callingTask) {
- synchronized (this.regionExpiryLock) {
- if (this.regionIdleExpiryTask != null && this.regionIdleExpiryTask != callingTask) {
+ synchronized (regionExpiryLock) {
+ if (regionIdleExpiryTask != null && regionIdleExpiryTask != callingTask) {
return;
}
- if (this.regionIdleTimeout <= 0) {
- this.regionIdleExpiryTask = null;
+ if (regionIdleTimeout <= 0) {
+ regionIdleExpiryTask = null;
return;
}
RegionIdleExpiryTask task = new RegionIdleExpiryTask(this);
if (logger.isDebugEnabled()) {
logger.debug("Scheduling Region Idle Expiry Task {} which replaces {}", task,
- this.regionIdleExpiryTask);
+ regionIdleExpiryTask);
}
- this.regionIdleExpiryTask =
- (RegionIdleExpiryTask) this.cache.getExpirationScheduler().addExpiryTask(task);
+ regionIdleExpiryTask =
+ (RegionIdleExpiryTask) cache.getExpirationScheduler().addExpiryTask(task);
}
}
@@ -7752,15 +7752,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* Added to fix bug 31204
*/
boolean isEntryIdleExpiryPossible() {
- return this.entryIdleTimeout > 0 || this.customEntryIdleTimeout != null;
+ return entryIdleTimeout > 0 || customEntryIdleTimeout != null;
}
private void cancelTTLExpiryTask() {
RegionTTLExpiryTask task;
- synchronized (this.regionExpiryLock) {
- task = this.regionTTLExpiryTask;
+ synchronized (regionExpiryLock) {
+ task = regionTTLExpiryTask;
if (task != null) {
- this.regionTTLExpiryTask = null;
+ regionTTLExpiryTask = null;
}
}
if (task != null) {
@@ -7770,10 +7770,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private void cancelIdleExpiryTask() {
RegionIdleExpiryTask task;
- synchronized (this.regionExpiryLock) {
- task = this.regionIdleExpiryTask;
+ synchronized (regionExpiryLock) {
+ task = regionIdleExpiryTask;
if (task != null) {
- this.regionIdleExpiryTask = null;
+ regionIdleExpiryTask = null;
}
}
if (task != null) {
@@ -7794,10 +7794,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
void timeToLiveChanged(ExpirationAttributes oldTimeToLive) {
int oldTimeout = oldTimeToLive.getTimeout();
- if (this.customEntryTimeToLive != null) {
+ if (customEntryTimeToLive != null) {
rescheduleEntryExpiryTasks();
}
- if (this.entryTimeToLive > 0 && (oldTimeout == 0 || this.entryTimeToLive < oldTimeout)) {
+ if (entryTimeToLive > 0 && (oldTimeout == 0 || entryTimeToLive < oldTimeout)) {
rescheduleEntryExpiryTasks();
}
// else it's safe to let them get rescheduled lazily, as the old expiration time will cause the
@@ -7807,10 +7807,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
void idleTimeoutChanged(ExpirationAttributes oldIdleTimeout) {
int oldTimeout = oldIdleTimeout.getTimeout();
- if (this.customEntryIdleTimeout != null) {
+ if (customEntryIdleTimeout != null) {
rescheduleEntryExpiryTasks();
}
- if (this.entryIdleTimeout > 0 && (oldTimeout == 0 || this.entryIdleTimeout < oldTimeout)) {
+ if (entryIdleTimeout > 0 && (oldTimeout == 0 || entryIdleTimeout < oldTimeout)) {
rescheduleEntryExpiryTasks();
}
// else it's safe to let them get rescheduled lazily, as the old expiration time will cause the
@@ -7828,7 +7828,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return;
}
// OK to ignore transaction since Expiry only done non-tran
- Iterator<RegionEntry> it = this.entries.regionEntries().iterator();
+ Iterator<RegionEntry> it = entries.regionEntries().iterator();
if (it.hasNext()) {
ExpiryTask.doWithNowSet(this, () -> {
while (it.hasNext()) {
@@ -7857,18 +7857,18 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (regionEntry == null || regionEntry.isDestroyedOrRemoved()) {
return null;
}
- if (this.customEntryIdleTimeout != null || this.customEntryTimeToLive != null) {
+ if (customEntryIdleTimeout != null || customEntryTimeToLive != null) {
ExpiryRegionEntry expiryRegionEntry = new ExpiryRegionEntry(this, regionEntry);
ExpirationAttributes ttlAttributes = null;
ExpirationAttributes idleAttributes = null;
- final RegionAttributes<?, ?> regionAttributes = this.getAttributes();
+ final RegionAttributes<?, ?> regionAttributes = getAttributes();
final CustomExpiry<?, ?> customTTL = regionAttributes.getCustomEntryTimeToLive();
if (customTTL != null) {
try {
ttlAttributes = customTTL.getExpiry(expiryRegionEntry);
if (ttlAttributes != null) {
- this.checkEntryTimeoutAction("timeToLive", ttlAttributes.getAction());
+ checkEntryTimeoutAction("timeToLive", ttlAttributes.getAction());
}
} catch (RegionDestroyedException ignore) {
// Ignore - #42273
@@ -7890,7 +7890,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
try {
idleAttributes = customIdle.getExpiry(expiryRegionEntry);
if (idleAttributes != null) {
- this.checkEntryTimeoutAction("idleTimeout", idleAttributes.getAction());
+ checkEntryTimeoutAction("idleTimeout", idleAttributes.getAction());
}
} catch (RegionDestroyedException ignore) {
// Ignore - #42273
@@ -7929,11 +7929,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public EntryExpiryTask getEntryExpiryTask(Object key) {
- RegionEntry re = this.getRegionEntry(key);
+ RegionEntry re = getRegionEntry(key);
if (re == null) {
throw new EntryNotFoundException("Entry for key " + key + " does not exist.");
}
- return this.entryExpiryTasks.get(re);
+ return entryExpiryTasks.get(re);
}
/**
@@ -7942,7 +7942,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public RegionIdleExpiryTask getRegionIdleExpiryTask() {
- return this.regionIdleExpiryTask;
+ return regionIdleExpiryTask;
}
/**
@@ -7951,7 +7951,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public RegionTTLExpiryTask getRegionTTLExpiryTask() {
- return this.regionTTLExpiryTask;
+ return regionTTLExpiryTask;
}
private void addExpiryTask(RegionEntry regionEntry, boolean ifAbsent) {
@@ -7966,10 +7966,10 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
EntryExpiryTask newTask = null;
EntryExpiryTask oldTask;
if (ifAbsent) {
- oldTask = this.entryExpiryTasks.get(regionEntry);
+ oldTask = entryExpiryTasks.get(regionEntry);
if (oldTask != null) {
boolean keepOldTask = true;
- if (this.customEntryIdleTimeout != null || this.customEntryTimeToLive != null) {
+ if (customEntryIdleTimeout != null || customEntryTimeToLive != null) {
newTask = createExpiryTask(regionEntry);
if (newTask == null) {
return;
@@ -8002,15 +8002,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return;
}
}
- oldTask = this.entryExpiryTasks.put(regionEntry, newTask);
- ExpirationScheduler scheduler = this.cache.getExpirationScheduler();
+ oldTask = entryExpiryTasks.put(regionEntry, newTask);
+ ExpirationScheduler scheduler = cache.getExpirationScheduler();
if (oldTask != null) {
if (oldTask.cancel()) {
scheduler.incCancels();
}
}
if (!scheduler.addEntryExpiryTask(newTask)) {
- this.entryExpiryTasks.remove(regionEntry);
+ entryExpiryTasks.remove(regionEntry);
} else {
if (ExpiryTask.expiryTaskListener != null) {
ExpiryTask.expiryTaskListener.afterSchedule(newTask);
@@ -8030,15 +8030,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
void cancelExpiryTask(RegionEntry regionEntry, ExpiryTask expiryTask) {
if (expiryTask != null) {
- this.entryExpiryTasks.remove(regionEntry, expiryTask);
+ entryExpiryTasks.remove(regionEntry, expiryTask);
if (expiryTask.cancel()) {
- this.cache.getExpirationScheduler().incCancels();
+ cache.getExpirationScheduler().incCancels();
}
} else {
- EntryExpiryTask oldTask = this.entryExpiryTasks.remove(regionEntry);
+ EntryExpiryTask oldTask = entryExpiryTasks.remove(regionEntry);
if (oldTask != null) {
if (oldTask.cancel()) {
- this.cache.getExpirationScheduler().incCancels();
+ cache.getExpirationScheduler().incCancels();
}
}
}
@@ -8047,19 +8047,19 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private void cancelAllEntryExpiryTasks() {
// This method gets called during LocalRegion construction
// in which case the final entryExpiryTasks field can still be null
- if (this.entryExpiryTasks == null)
+ if (entryExpiryTasks == null)
return;
- if (this.entryExpiryTasks.isEmpty())
+ if (entryExpiryTasks.isEmpty())
return;
boolean doPurge = false;
- for (EntryExpiryTask task : this.entryExpiryTasks.values()) {
+ for (EntryExpiryTask task : entryExpiryTasks.values()) {
// no need to call incCancels since we will call forcePurge
task.cancel();
doPurge = true;
}
if (doPurge) {
// do a force to not leave any refs to this region
- this.cache.getExpirationScheduler().forcePurge();
+ cache.getExpirationScheduler().forcePurge();
}
}
@@ -8068,7 +8068,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public ImageState getImageState() {
- return this.imageState;
+ return imageState;
}
/**
@@ -8122,7 +8122,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
/** doesn't throw RegionDestroyedException, used by CacheDistributionAdvisor */
LocalRegion basicGetParentRegion() {
- return this.parentRegion;
+ return parentRegion;
}
@Override
@@ -8132,7 +8132,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@VisibleForTesting
public TXStateProxy getTXState() {
- if (this.supportsTX) {
+ if (supportsTX) {
return TXManagerImpl.getCurrentTXState();
} else {
return null;
@@ -8161,7 +8161,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public TXEntryState createReadEntry(TXRegionState txRegionState, KeyInfo keyInfo,
boolean createIfAbsent) {
TXEntryState result = null;
- final RegionEntry regionEntry = this.basicGetTXEntry(keyInfo);
+ final RegionEntry regionEntry = basicGetTXEntry(keyInfo);
if (regionEntry != null) {
boolean needsLRUCleanup = false;
try {
@@ -8203,7 +8203,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
private TXStateInterface getJTAEnlistedTX() {
- if (this.ignoreJTA) {
+ if (ignoreJTA) {
// fixes bug 45541
return null;
}
@@ -8212,9 +8212,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
return txState;
} else {
try {
- if (!this.ignoreJTA && this.cache.getJTATransactionManager() != null) {
+ if (!ignoreJTA && cache.getJTATransactionManager() != null) {
- Transaction jtaTransaction = this.cache.getJTATransactionManager().getTransaction();
+ Transaction jtaTransaction = cache.getJTATransactionManager().getTransaction();
if (jtaTransaction == null
|| jtaTransaction.getStatus() == Status.STATUS_NO_TRANSACTION) {
return null;
@@ -8223,7 +8223,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// Do not bootstrap JTA again, if the transaction has been paused.
return null;
}
- txState = this.cache.getTXMgr().beginJTA();
+ txState = cache.getTXMgr().beginJTA();
jtaTransaction.registerSynchronization(txState);
return txState;
} else {
@@ -8231,7 +8231,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
} catch (SystemException se) {
// this can be thrown when the system is shutting down (see bug #39728)
- this.stopper.checkCancelInProgress(se);
+ stopper.checkCancelInProgress(se);
jtaEnlistmentFailureCleanup(txState, se);
return null;
} catch (RollbackException | IllegalStateException re) {
@@ -8242,18 +8242,18 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
private void jtaEnlistmentFailureCleanup(TXStateInterface txState, Exception reason) {
- if (this.cache == null) {
+ if (cache == null) {
return;
}
- this.cache.getTXMgr().setTXState(null);
+ cache.getTXMgr().setTXState(null);
if (txState != null) {
txState.rollback();
}
String jtaTransName = null;
try {
- jtaTransName = this.cache.getJTATransactionManager().getTransaction().toString();
+ jtaTransName = cache.getJTATransactionManager().getTransaction().toString();
} catch (VirtualMachineError err) {
SystemFailure.initiateFailure(err);
// If this ever returns, rethrow the error. We're poisoned
@@ -8276,14 +8276,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public boolean txLRUStart() {
- return this.entries.disableLruUpdateCallback();
+ return entries.disableLruUpdateCallback();
}
@Override
public void txLRUEnd() {
- this.entries.enableLruUpdateCallback();
+ entries.enableLruUpdateCallback();
try {
- this.entries.lruUpdateCallback();
+ entries.lruUpdateCallback();
} catch (DiskAccessException dae) {
handleDiskAccessException(dae);
throw dae;
@@ -8292,20 +8292,20 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void txDecRefCount(RegionEntry regionEntry) {
- this.entries.decTxRefCount(regionEntry);
+ entries.decTxRefCount(regionEntry);
}
/** Does not throw RegionDestroyedException even if destroyed */
List debugGetSubregionNames() {
List names = new ArrayList();
- names.addAll(this.subregions.keySet());
+ names.addAll(subregions.keySet());
return names;
}
@Override
public void incRecentlyUsed() {
// nothing
- this.entries.incRecentlyUsed();
+ entries.incRecentlyUsed();
}
private static void dispatchEvent(LocalRegion region, InternalCacheEvent event,
@@ -8366,7 +8366,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public RegionMap getRegionMap() {
// OK to ignore tx state
- return this.entries;
+ return entries;
}
/**
@@ -8382,7 +8382,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
checkReadiness();
checkForNoAccess();
discoverJTA();
- boolean isClient = this.imageState.isClient();
+ boolean isClient = imageState.isClient();
if (isClient) {
// bug #40871 - test sees wrong size for region during RI
lockRIReadLock();
@@ -8404,7 +8404,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @return the estimated size of this region
*/
int sizeEstimate() {
- boolean isClient = this.imageState.isClient();
+ boolean isClient = imageState.isClient();
if (isClient) {
throw new UnsupportedOperationException("Method not supported on a client");
}
@@ -8417,7 +8417,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public boolean isEmpty() {
// checkForNoAccess(); // size does this check
- return this.size() <= 0;
+ return size() <= 0;
}
/**
@@ -8531,8 +8531,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// TODO: what does cmn refer to?
void cmnClearRegion(RegionEventImpl regionEvent, boolean cacheWrite, boolean useRVV) {
RegionVersionVector rvv = null;
- if (useRVV && this.getDataPolicy().withReplication() && this.getConcurrencyChecksEnabled()) {
- rvv = this.versionVector.getCloneForTransmission();
+ if (useRVV && getDataPolicy().withReplication() && getConcurrencyChecksEnabled()) {
+ rvv = versionVector.getCloneForTransmission();
}
clearRegionLocally(regionEvent, cacheWrite, rvv);
}
@@ -8550,21 +8550,21 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
final boolean isRvvDebugEnabled = logger.isTraceEnabled(LogMarker.RVV_VERBOSE);
RegionVersionVector rvv = vector;
- if (this.serverRegionProxy != null) {
+ if (serverRegionProxy != null) {
// clients and local regions do not maintain a full RVV. can't use it with clear()
rvv = null;
}
- if (rvv != null && this.getDataPolicy().withStorage()) {
+ if (rvv != null && getDataPolicy().withStorage()) {
if (isRvvDebugEnabled) {
logger.trace(LogMarker.RVV_VERBOSE,
"waiting for my version vector to dominate{}mine={}{} other={}", getLineSeparator(),
- getLineSeparator(), this.versionVector.fullToString(), rvv);
+ getLineSeparator(), versionVector.fullToString(), rvv);
}
- boolean result = this.versionVector.waitToDominate(rvv, this);
+ boolean result = versionVector.waitToDominate(rvv, this);
if (!result) {
if (isRvvDebugEnabled) {
logger.trace(LogMarker.RVV_VERBOSE, "incrementing clearTimeouts for {} rvv={}", getName(),
- this.versionVector.fullToString());
+ versionVector.fullToString());
}
getCachePerfStats().incClearTimeouts();
}
@@ -8585,7 +8585,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
if (cacheWrite && !isGIIinProgress) {
- this.cacheWriteBeforeRegionClear(regionEvent);
+ cacheWriteBeforeRegionClear(regionEvent);
}
RegionVersionVector myVector = getVersionVector();
@@ -8618,7 +8618,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// after clearing it some new entries may get added before issuing clear
// on the map , but that should be OK, as the expiration thread will
// silently move ahead if the entry to be expired no longer existed
- this.cancelAllEntryExpiryTasks();
+ cancelAllEntryExpiryTasks();
entryUserAttributes.clear();
// if all current content has been removed then the version vector
@@ -8634,20 +8634,20 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
// clear the disk region if present
- if (this.diskRegion != null) {
+ if (diskRegion != null) {
// persist current rvv and rvvgc which contained version for clear() itself
- if (this.getDataPolicy().withPersistence()) {
+ if (getDataPolicy().withPersistence()) {
// null means not to change dr.rvvTrust
if (isRvvDebugEnabled) {
logger.trace(LogMarker.RVV_VERBOSE, "Clear: Saved current rvv: {}",
- this.diskRegion.getRegionVersionVector());
+ diskRegion.getRegionVersionVector());
}
- this.diskRegion.writeRVV(this, null);
- this.diskRegion.writeRVVGC(this);
+ diskRegion.writeRVV(this, null);
+ diskRegion.writeRVVGC(this);
}
// clear the entries in disk
- this.diskRegion.clear(this, rvv);
+ diskRegion.clear(this, rvv);
}
// this will be done in diskRegion.clear if it is not null else it has to be
// done here
@@ -8656,7 +8656,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
txClearRegion();
// Now clear the map of committed entries
Set<VersionSource> remainingIDs = clearEntries(rvv);
- if (!this.getDataPolicy().withPersistence()) {
+ if (!getDataPolicy().withPersistence()) {
// persistent regions do not reap IDs
if (myVector != null) {
myVector.removeOldMembers(remainingIDs);
@@ -8672,9 +8672,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// of entries.
// TODO made indexManager variable is made volatile. Is it necessary?
- if (this.indexManager != null) {
+ if (indexManager != null) {
try {
- this.indexManager.rerunIndexCreationQuery();
+ indexManager.rerunIndexCreationQuery();
} catch (QueryException qe) {
// Create an anonymous inner class of CacheRuntimeException so
// that a RuntimeException is thrown
@@ -8772,7 +8772,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// in 8.0 we added transfer of tombstones with RI/getAll results for bug #40791
boolean createTombstone = false;
if (notOnServer) {
- createTombstone = entry.getVersionTag() != null && this.getConcurrencyChecksEnabled();
+ createTombstone = entry.getVersionTag() != null && getConcurrencyChecksEnabled();
allResults.put(key, null);
if (isDebugEnabled) {
logger.debug("Added remote result for missing key: {}", key);
@@ -8810,7 +8810,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (!alreadyInvalid(key, event)) {
// bug #47716 - don't update if it's already here & invalid
- TXStateProxy txState = this.cache.getTXMgr().pauseTransaction();
+ TXStateProxy txState = cache.getTXMgr().pauseTransaction();
try {
basicPutEntry(event, 0L);
} catch (ConcurrentCacheModificationException e) {
@@ -8820,7 +8820,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
key, e);
}
} finally {
- this.cache.getTXMgr().unpauseTransaction(txState);
+ cache.getTXMgr().unpauseTransaction(txState);
}
getCachePerfStats().endPut(startPut, event.isOriginRemote());
}
@@ -8857,7 +8857,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* Return false if it will never store entry ekys and values locally; otherwise return true.
*/
boolean hasStorage() {
- return this.getDataPolicy().withStorage();
+ return getDataPolicy().withStorage();
}
private void verifyPutAllMap(Map map) {
@@ -9042,7 +9042,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
EventID eventId = event.getEventId();
if (eventId == null && generateEventID()) {
// We need to "reserve" the eventIds for the entries in map here
- event.reserveNewEventId(this.cache.getDistributedSystem(), map.size());
+ event.reserveNewEventId(cache.getDistributedSystem(), map.size());
eventId = event.getEventId();
}
@@ -9053,7 +9053,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (hasServerProxy()) {
// send message to cache server
if (isTX()) {
- TXStateProxyImpl txState = (TXStateProxyImpl) this.cache.getTxManager().getTXState();
+ TXStateProxyImpl txState = (TXStateProxyImpl) cache.getTxManager().getTXState();
txState.getRealDeal(null, this);
}
try {
@@ -9093,13 +9093,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
final VersionedObjectList succeeded =
- new VersionedObjectList(map.size(), true, this.getConcurrencyChecksEnabled());
+ new VersionedObjectList(map.size(), true, getConcurrencyChecksEnabled());
// if this is a transactional putAll, we will not have version information as it is only
// generated at commit
// so treat transactional putAll as if the server is not versioned
final boolean serverIsVersioned = proxyResult != null && proxyResult.regionIsVersioned()
- && !isTX() && this.getDataPolicy() != DataPolicy.EMPTY;
+ && !isTX() && getDataPolicy() != DataPolicy.EMPTY;
if (!serverIsVersioned && !partialResult) {
// we don't need server information if it isn't versioned or if the region is empty
proxyResult = null;
@@ -9262,7 +9262,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
EventID eventId = event.getEventId();
if (eventId == null && generateEventID()) {
// We need to "reserve" the eventIds for the entries in map here
- event.reserveNewEventId(this.cache.getDistributedSystem(), keys.size());
+ event.reserveNewEventId(cache.getDistributedSystem(), keys.size());
eventId = event.getEventId();
}
@@ -9274,7 +9274,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (hasServerProxy()) {
// send message to cache server
if (isTX()) {
- TXStateProxyImpl txState = (TXStateProxyImpl) this.cache.getTxManager().getTXState();
+ TXStateProxyImpl txState = (TXStateProxyImpl) cache.getTxManager().getTXState();
txState.getRealDeal(null, this);
}
try {
@@ -9313,7 +9313,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
final VersionedObjectList succeeded =
- new VersionedObjectList(keys.size(), true, this.getConcurrencyChecksEnabled());
+ new VersionedObjectList(keys.size(), true, getConcurrencyChecksEnabled());
// If this is a transactional removeAll, we will not have version information as it is only
// generated at commit
@@ -9488,8 +9488,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
testHook.beforeBulkLock(this);
}
- if (this.versionVector != null && this.getDataPolicy().withReplication()) {
- this.versionVector.lockForCacheModification(this);
+ if (versionVector != null && getDataPolicy().withReplication()) {
+ versionVector.lockForCacheModification(this);
}
if (testHook != null) {
@@ -9503,8 +9503,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
testHook.beforeBulkRelease(this);
}
- if (this.versionVector != null && this.getDataPolicy().withReplication()) {
- this.versionVector.releaseCacheModificationLock(this);
+ if (versionVector != null && getDataPolicy().withReplication()) {
+ versionVector.releaseCacheModificationLock(this);
}
if (testHook != null) {
@@ -9671,7 +9671,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public void postPutAllFireEvents(DistributedPutAllOperation putAllOp,
VersionedObjectList successfulPuts) {
- if (!this.getDataPolicy().withStorage() && this.getConcurrencyChecksEnabled()
+ if (!getDataPolicy().withStorage() && getConcurrencyChecksEnabled()
&& putAllOp.getBaseEvent().isBridgeEvent()) {
// if there is no local storage we need to transfer version information
// to the successfulPuts list for transmission back to the client
@@ -9692,7 +9692,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
EnumListenerEvent op = event.getOperation().isCreate() ? EnumListenerEvent.AFTER_CREATE
: EnumListenerEvent.AFTER_UPDATE;
invokePutCallbacks(op, event, !event.callbacksInvoked() && !event.isPossibleDuplicate(),
- this.isUsedForPartitionedRegionBucket
+ isUsedForPartitionedRegionBucket
/*
* If this is replicated region, use "false". We must notify gateways inside RegionEntry
* lock, NOT here, to preserve the order of events sent by gateways for same key. If this is
@@ -9706,7 +9706,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public void postRemoveAllFireEvents(DistributedRemoveAllOperation removeAllOp,
VersionedObjectList successfulOps) {
- if (!this.getDataPolicy().withStorage() && this.getConcurrencyChecksEnabled()
+ if (!getDataPolicy().withStorage() && getConcurrencyChecksEnabled()
&& removeAllOp.getBaseEvent().isBridgeEvent()) {
// if there is no local storage we need to transfer version information
// to the successfulOps list for transmission back to the client
@@ -9726,7 +9726,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (successfulKeys.contains(event.getKey())) {
invokeDestroyCallbacks(EnumListenerEvent.AFTER_DESTROY, event,
!event.callbacksInvoked() && !event.isPossibleDuplicate(),
- this.isUsedForPartitionedRegionBucket
+ isUsedForPartitionedRegionBucket
/*
* If this is replicated region, use "false". We must notify gateways inside RegionEntry
* lock, NOT here, to preserve the order of events sent by gateways for same key. If this is
@@ -9814,7 +9814,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
removeSenderFromAdvisor(sender, serialForThisRegion, regionDestroyed);
// process subregions...
- for (Object regionObject : this.subregions.values()) {
+ for (Object regionObject : subregions.values()) {
LocalRegion region = toRegion(regionObject);
if (region != null && !region.isDestroyed()) {
// recursively call basicHandleRemoteLocalRegionDestroyOrClose for subregions
@@ -9836,7 +9836,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public boolean isUsedForPartitionedRegionAdmin() {
- return this.isUsedForPartitionedRegionAdmin;
+ return isUsedForPartitionedRegionAdmin;
}
/**
@@ -9847,9 +9847,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @return true if synchronization should be attempted
*/
public boolean shouldSyncForCrashedMember(InternalDistributedMember id) {
- return this.getConcurrencyChecksEnabled() && this.getDataPolicy().withReplication()
- && !this.isUsedForPartitionedRegionAdmin && !this.isUsedForMetaRegion
- && !this.isUsedForSerialGatewaySenderQueue;
+ return getConcurrencyChecksEnabled() && getDataPolicy().withReplication()
+ && !isUsedForPartitionedRegionAdmin && !isUsedForMetaRegion
+ && !isUsedForSerialGatewaySenderQueue;
}
/**
@@ -9859,8 +9859,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public void forceRolling() throws DiskAccessException {
- if (this.diskRegion != null) {
- this.diskRegion.forceRolling();
+ if (diskRegion != null) {
+ diskRegion.forceRolling();
}
}
@@ -9897,7 +9897,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (getDiskStore() != null) {
return getDiskStore().getDiskDirs();
} else {
- return this.diskDirs;
+ return diskDirs;
}
}
@@ -9906,7 +9906,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (getDiskStore() != null) {
return getDiskStore().getDiskDirSizes();
} else {
- return this.diskSizes;
+ return diskSizes;
}
}
@@ -9915,21 +9915,21 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public boolean isUsedForPartitionedRegionBucket() {
- return this.isUsedForPartitionedRegionBucket;
+ return isUsedForPartitionedRegionBucket;
}
protected boolean isUsedForSerialGatewaySenderQueue() {
- return this.isUsedForSerialGatewaySenderQueue;
+ return isUsedForSerialGatewaySenderQueue;
}
protected boolean isUsedForParallelGatewaySenderQueue() {
- return this.isUsedForParallelGatewaySenderQueue;
+ return isUsedForParallelGatewaySenderQueue;
}
public void removeCacheServiceProfile(String profileID) {
cacheServiceProfileUpdateLock.lock();
try {
- this.cacheServiceProfiles.remove(profileID);
+ cacheServiceProfiles.remove(profileID);
} finally {
cacheServiceProfileUpdateLock.unlock();
}
@@ -9937,11 +9937,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
public AbstractGatewaySender getSerialGatewaySender() {
- return this.serialGatewaySender;
+ return serialGatewaySender;
}
boolean isParallelWanEnabled() {
- Set<String> regionGatewaySenderIds = this.getAllGatewaySenderIds();
+ Set<String> regionGatewaySenderIds = getAllGatewaySenderIds();
if (regionGatewaySenderIds.isEmpty()) {
return false;
}
@@ -9962,7 +9962,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public PartitionedRegion getPartitionedRegion() {
- if (!this.isUsedForPartitionedRegionBucket) {
+ if (!isUsedForPartitionedRegionBucket) {
throw new IllegalArgumentException();
}
return ((Bucket) this).getPartitionedRegion();
@@ -9973,12 +9973,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public boolean isUsedForMetaRegion() {
- return this.isUsedForMetaRegion;
+ return isUsedForMetaRegion;
}
@Override
public boolean isMetaRegionWithTransactions() {
- return this.isMetaRegionWithTransactions;
+ return isMetaRegionWithTransactions;
}
/**
@@ -9991,14 +9991,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
Map<String, CacheServiceProfile> getCacheServiceProfiles() {
- return this.cacheServiceProfiles.getSnapshot();
+ return cacheServiceProfiles.getSnapshot();
}
@Override
public void addCacheServiceProfile(CacheServiceProfile profile) {
cacheServiceProfileUpdateLock.lock();
try {
- this.cacheServiceProfiles.put(profile.getId(), profile);
+ cacheServiceProfiles.put(profile.getId(), profile);
} finally {
cacheServiceProfileUpdateLock.unlock();
}
@@ -10072,7 +10072,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
protected boolean supportsConcurrencyChecks() {
- return !isSecret() || this.getDataPolicy().withPersistence();
+ return !isSecret() || getDataPolicy().withPersistence();
}
/**
@@ -10083,8 +10083,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public boolean shouldNotifyBridgeClients() {
- return !this.cache.getCacheServers().isEmpty() && !this.isUsedForPartitionedRegionAdmin
- && !this.isUsedForPartitionedRegionBucket && !this.isUsedForMetaRegion;
+ return !cache.getCacheServers().isEmpty() && !isUsedForPartitionedRegionAdmin
+ && !isUsedForPartitionedRegionBucket && !isUsedForMetaRegion;
}
/**
@@ -10104,11 +10104,11 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public void cleanupForClient(CacheClientNotifier clientNotifier, ClientProxyMembershipID client) {
- if (this.cache.isClosed() || this.isDestroyed) {
+ if (cache.isClosed() || isDestroyed) {
return;
}
- this.filterProfile.cleanupForClient(clientNotifier, client);
+ filterProfile.cleanupForClient(clientNotifier, client);
for (Object regionObject : new SubregionsSet(false)) {
LocalRegion region = (LocalRegion) regionObject;
@@ -10121,7 +10121,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public FilterProfile getFilterProfile() {
- return this.filterProfile;
+ return filterProfile;
}
/**
@@ -10134,13 +10134,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @throws IllegalStateException if this region has not been destroyed
*/
HashMap getDestroyedSubregionSerialNumbers() {
- if (!this.isDestroyed) {
+ if (!isDestroyed) {
throw new IllegalStateException(
String.format(
"Region %s must be destroyed before calling getDestroyedSubregionSerialNumbers",
getFullPath()));
}
- return this.destroyedSubregionSerialNumbers;
+ return destroyedSubregionSerialNumbers;
}
/**
@@ -10162,7 +10162,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
private void addSubregionSerialNumbers(Map map) {
// iterate over all subregions to gather serialNumbers and recurse
- for (Object entryObject : this.subregions.entrySet()) {
+ for (Object entryObject : subregions.entrySet()) {
Map.Entry entry = (Map.Entry) entryObject;
LocalRegion subregion = (LocalRegion) entry.getValue();
map.put(subregion.getFullPath(), subregion.getSerialNumber());
@@ -10392,13 +10392,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public boolean lruLimitExceeded() {
- return this.entries.lruLimitExceeded(getDiskRegionView());
+ return entries.lruLimitExceeded(getDiskRegionView());
}
@Override
public DiskEntry getDiskEntry(Object key) {
// should return tombstone as an valid entry
- RegionEntry regionEntry = this.entries.getEntry(key);
+ RegionEntry regionEntry = entries.getEntry(key);
if (regionEntry != null && regionEntry.isRemoved() && !regionEntry.isTombstone()) {
regionEntry = null;
}
@@ -10438,7 +10438,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
public InternalDataView getSharedDataView() {
- return this.sharedDataView;
+ return sharedDataView;
}
/**
@@ -10488,23 +10488,23 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
/** test hook - dump the backing map for this region */
@VisibleForTesting
public void dumpBackingMap() {
- synchronized (this.entries) {
- if (this.entries instanceof AbstractRegionMap) {
- ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount);
+ synchronized (entries) {
+ if (entries instanceof AbstractRegionMap) {
+ ((AbstractRegionMap) entries).verifyTombstoneCount(tombstoneCount);
}
logger.debug("Dumping region of size {} tombstones: {}: {}", size(), getTombstoneCount(),
- this.toString());
- if (this.entries instanceof AbstractRegionMap) {
- ((AbstractRegionMap) this.entries).dumpMap();
+ toString());
+ if (entries instanceof AbstractRegionMap) {
+ ((AbstractRegionMap) entries).dumpMap();
}
}
}
private void checkIfConcurrentMapOpsAllowed() {
// This check allows NORMAL with local scope to fix bug 44856
- if (this.serverRegionProxy == null
- && (this.getDataPolicy() == DataPolicy.NORMAL && this.scope.isDistributed()
- || this.getDataPolicy() == DataPolicy.EMPTY)) {
+ if (serverRegionProxy == null
+ && (getDataPolicy() == DataPolicy.NORMAL && scope.isDistributed()
+ || getDataPolicy() == DataPolicy.EMPTY)) {
// the functional spec says these data policies do not support concurrent map
// operations
throw new UnsupportedOperationException();
@@ -10512,7 +10512,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
boolean canStoreDataLocally() {
- return this.getDataPolicy().withStorage();
+ return getDataPolicy().withStorage();
}
/**
@@ -10575,7 +10575,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
try {
if (generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
final Object oldValue = null;
final boolean ifNew = true;
@@ -10635,7 +10635,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
try {
if (generateEventID() && event.getEventId() == null) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
discoverJTA();
getDataView().destroyExistingEntry(event, true, value);
@@ -10682,7 +10682,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
try {
if (generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
discoverJTA();
@@ -10744,7 +10744,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
try {
if (generateEventID()) {
- event.setNewEventId(this.cache.getDistributedSystem());
+ event.setNewEventId(cache.getDistributedSystem());
}
discoverJTA();
@@ -10817,7 +10817,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean basicPut = basicPut(event, ifNew, ifOld, null, requireOldValue);
getCachePerfStats().endPut(startPut, false);
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
// to fix bug 42968 call getRawOldValue instead of getOldValue
Object oldValue = event.getRawOldValueAsHeapObject();
@@ -10913,7 +10913,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
getCachePerfStats().endPut(startPut, false);
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
return success;
} finally {
@@ -10968,7 +10968,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
boolean succeeded = basicPut(event, ifNew, ifOld, null, requireOldValue);
getCachePerfStats().endPut(startPut, false);
- this.stopper.checkCancelInProgress(null);
+ stopper.checkCancelInProgress(null);
clientEvent.isConcurrencyConflict(event.isConcurrencyConflict());
if (succeeded) {
@@ -11057,18 +11057,18 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void setInUseByTransaction(boolean value) {
- synchronized (this.regionExpiryLock) {
+ synchronized (regionExpiryLock) {
if (value) {
- this.txRefCount++;
+ txRefCount++;
} else {
- this.txRefCount--;
- assert this.txRefCount >= 0;
- if (this.txRefCount == 0) {
- if (this.regionTTLExpiryTask == null && this.regionTimeToLive > 0) {
- this.addTTLExpiryTask();
+ txRefCount--;
+ assert txRefCount >= 0;
+ if (txRefCount == 0) {
+ if (regionTTLExpiryTask == null && regionTimeToLive > 0) {
+ addTTLExpiryTask();
}
- if (this.regionIdleExpiryTask == null && this.regionIdleTimeout > 0) {
- this.addIdleExpiryTask();
+ if (regionIdleExpiryTask == null && regionIdleTimeout > 0) {
+ addIdleExpiryTask();
}
}
}
@@ -11079,23 +11079,23 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* Return true if the region expiry task should be rescheduled
*/
boolean expireRegion(RegionExpiryTask regionExpiryTask, boolean distributed, boolean destroy) {
- synchronized (this.regionExpiryLock) {
+ synchronized (regionExpiryLock) {
if (regionExpiryTask instanceof RegionTTLExpiryTask) {
- if (regionExpiryTask != this.regionTTLExpiryTask) {
+ if (regionExpiryTask != regionTTLExpiryTask) {
// We must be an old task so defer to the currently scheduled one
return false;
} else {
- this.regionTTLExpiryTask = null;
+ regionTTLExpiryTask = null;
}
} else {
- if (regionExpiryTask != this.regionIdleExpiryTask) {
+ if (regionExpiryTask != regionIdleExpiryTask) {
// We must be an old task so defer to the currently scheduled one
return false;
} else {
- this.regionIdleExpiryTask = null;
+ regionIdleExpiryTask = null;
}
}
- if (this.txRefCount > 0) {
+ if (txRefCount > 0) {
return false;
}
}
@@ -11150,7 +11150,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
*/
@Override
public long getTotalEvictions() {
- return this.entries.getEvictions();
+ return entries.getEvictions();
}
void incBucketEvictions() {
@@ -11244,7 +11244,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
void setMemoryThresholdReached(boolean reached) {
- this.memoryThresholdReached.set(reached);
+ memoryThresholdReached.set(reached);
}
boolean isStatisticsEnabled() {
@@ -11308,7 +11308,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
public Iterator iterator() {
// iterates breadth-first (if recursive)
return new Iterator() {
- private Iterator currentIterator = LocalRegion.this.subregions.values().iterator();
+ private Iterator currentIterator = subregions.values().iterator();
/** FIFO queue of iterators */
private List queue;
@@ -11323,12 +11323,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public boolean hasNext() {
- if (this.nextElement != null) {
+ if (nextElement != null) {
return true;
} else {
Object element = next(true);
if (element != null) {
- this.nextElement = element;
+ nextElement = element;
return true;
} else {
return false;
@@ -11337,7 +11337,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
}
private boolean doHasNext() {
- return this.currentIterator != null && this.currentIterator.hasNext();
+ return currentIterator != null && currentIterator.hasNext();
}
@Override
@@ -11350,9 +11350,9 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
* @return the next element
*/
private Object next(boolean nullOK) {
- if (this.nextElement != null) {
- Object next = this.nextElement;
- this.nextElement = null;
+ if (nextElement != null) {
+ Object next = nextElement;
+ nextElement = null;
return next;
}
@@ -11360,14 +11360,14 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
do {
region = null;
if (!doHasNext()) {
- if (this.queue == null || this.queue.isEmpty()) {
+ if (queue == null || queue.isEmpty()) {
if (nullOK) {
return null;
} else {
throw new NoSuchElementException();
}
} else {
- this.currentIterator = (Iterator) queue.remove(0);
+ currentIterator = (Iterator) queue.remove(0);
continue;
}
}
@@ -11377,17 +11377,17 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
if (recursive) {
Iterator nextIterator = region.subregions.values().iterator();
if (nextIterator.hasNext()) {
- if (this.queue == null) {
- this.queue = new ArrayList();
+ if (queue == null) {
+ queue = new ArrayList();
}
- this.queue.add(nextIterator);
+ queue.add(nextIterator);
}
}
if (!doHasNext()) {
- if (this.queue == null || this.queue.isEmpty()) {
- this.currentIterator = null;
+ if (queue == null || queue.isEmpty()) {
+ currentIterator = null;
} else {
- this.currentIterator = (Iterator) this.queue.remove(0);
+ currentIterator = (Iterator) queue.remove(0);
}
}
return region;
@@ -11397,16 +11397,16 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public int size() {
- if (this.recursive) {
+ if (recursive) {
return allSubregionsSize() - 1 /* don't count this region */;
} else {
- return LocalRegion.this.subregions.size();
+ return subregions.size();
}
}
@Override
public Object[] toArray() {
- List temp = new ArrayList(this.size());
+ List temp = new ArrayList(size());
// do NOT use addAll or this results in stack overflow - must use iterator()
for (Iterator iter = iterator(); iter.hasNext();) {
temp.add(iter.next());
@@ -11416,7 +11416,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public Object[] toArray(Object[] array) {
- List temp = new ArrayList(this.size());
+ List temp = new ArrayList(size());
// do NOT use addAll or this results in stack overflow - must use iterator()
for (Iterator iter = iterator(); iter.hasNext();) {
temp.add(iter.next());
@@ -11436,7 +11436,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// This grossness is necessary because there are instances where the
// region can exist without having a cache (XML creation)
checkFailure();
- Cache cache = LocalRegion.this.getCache();
+ Cache cache = getCache();
if (cache == null) {
return "The cache is not available";
}
@@ -11448,7 +11448,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
// This grossness is necessary because there are instances where the
// region can exist without having a cache (XML creation)
checkFailure();
- Cache cache = LocalRegion.this.getCache();
+ Cache cache = getCache();
if (cache == null) {
return new CacheClosedException("No cache", e);
}
@@ -11466,7 +11466,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
private final EnumListenerEvent op;
EventDispatcher(InternalCacheEvent event, EnumListenerEvent op) {
- if (LocalRegion.this.offHeap && event instanceof EntryEventImpl) {
+ if (offHeap && event instanceof EntryEventImpl) {
// Make a copy that has its own off-heap refcount so fix bug 48837
event = new EntryEventImpl((EntryEventImpl) event);
}
@@ -11477,15 +11477,15 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
@Override
public void run() {
try {
- dispatchEvent(LocalRegion.this, this.event, this.op);
+ dispatchEvent(LocalRegion.this, event, op);
} finally {
- this.release();
+ release();
}
}
public void release() {
- if (LocalRegion.this.offHeap && this.event instanceof EntryEventImpl) {
- ((Releasable) this.event).release();
+ if (offHeap && event instanceof EntryEventImpl) {
+ ((Releasable) event).release();
}
}
}