DonalEvans commented on a change in pull request #6007:
URL: https://github.com/apache/geode/pull/6007#discussion_r572449347
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/control/InternalResourceManager.java
##########
@@ -125,99 +123,99 @@ public static InternalResourceManager
createResourceManager(final InternalCache
private InternalResourceManager(InternalCache cache) {
this.cache = cache;
- this.resourceAdvisor = (ResourceAdvisor) cache.getDistributionAdvisor();
- this.stats = new ResourceManagerStats(cache.getDistributedSystem());
+ resourceAdvisor = (ResourceAdvisor) cache.getDistributionAdvisor();
+ stats = new ResourceManagerStats(cache.getDistributedSystem());
// Create a new executor that other classes may use for handling resource
// related tasks
- this.scheduledExecutor = LoggingExecutors
+ scheduledExecutor = LoggingExecutors
.newScheduledThreadPool(MAX_RESOURCE_MANAGER_EXE_THREADS,
"ResourceManagerRecoveryThread ");
// Initialize the load probe
try {
- Class loadProbeClass =
ClassPathLoader.getLatest().forName(PR_LOAD_PROBE_CLASS);
- this.loadProbe = (LoadProbe) loadProbeClass.newInstance();
+ Class<?> loadProbeClass =
ClassPathLoader.getLatest().forName(PR_LOAD_PROBE_CLASS);
+ loadProbe = (LoadProbe) loadProbeClass.newInstance();
} catch (Exception e) {
throw new InternalGemFireError("Unable to instantiate " +
PR_LOAD_PROBE_CLASS, e);
}
// Create a new executor the resource manager and the monitors it creates
// can use to handle dispatching of notifications.
- this.notifyExecutor =
+ notifyExecutor =
CoreLoggingExecutors.newSerialThreadPoolWithFeedStatistics(0,
- this.stats.getResourceEventQueueStatHelper(), "Notification
Handler",
+ stats.getResourceEventQueueStatHelper(), "Notification Handler",
thread -> thread.setPriority(Thread.MAX_PRIORITY), null,
- this.stats.getResourceEventPoolStatHelper(),
getThreadMonitorObj());
+ stats.getResourceEventPoolStatHelper(), getThreadMonitorObj());
// Create the monitors
- Map<ResourceType, ResourceMonitor> tempMonitors = new
HashMap<ResourceType, ResourceMonitor>();
- tempMonitors.put(ResourceType.HEAP_MEMORY, new HeapMemoryMonitor(this,
cache, this.stats));
+ Map<ResourceType, ResourceMonitor> tempMonitors = new HashMap<>();
+ tempMonitors.put(ResourceType.HEAP_MEMORY, new HeapMemoryMonitor(this,
cache, stats));
tempMonitors.put(ResourceType.OFFHEAP_MEMORY,
- new OffHeapMemoryMonitor(this, cache, cache.getOffHeapStore(),
this.stats));
- this.resourceMonitors = Collections.unmodifiableMap(tempMonitors);
+ new OffHeapMemoryMonitor(this, cache, cache.getOffHeapStore(), stats));
+ resourceMonitors = Collections.unmodifiableMap(tempMonitors);
// Initialize the listener sets so that it only needs to be done once
for (ResourceType resourceType : new ResourceType[]
{ResourceType.HEAP_MEMORY,
ResourceType.OFFHEAP_MEMORY}) {
- Set<ResourceListener> emptySet = new
CopyOnWriteArraySet<ResourceListener>();
- this.listeners.put(resourceType, emptySet);
+ Set<ResourceListener<?>> emptySet = new CopyOnWriteArraySet<>();
+ listeners.put(resourceType, emptySet);
}
- this.closed = false;
+ closed = false;
Review comment:
Good catch, thanks. It seems that the only time we check the value of
`closed` is to determine whether or not to log a warning after catching an
exception in `runWithNotifyExecutor()`, so even in the event that the wrong
value was used, the impact would be negligible.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]