rahulrane50 commented on code in PR #2344:
URL: https://github.com/apache/helix/pull/2344#discussion_r1084612730
##########
helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java:
##########
@@ -583,6 +643,33 @@ public void updateMissingTopStateDurationStats(String
resourceName, long totalDu
}
}
+ public void updateMissingTopStateDurationThreshold(long
missingTopStateDurationThreshold) {
+
_asyncMissingTopStateMonitor.setMissingTopStateDurationThreshold(missingTopStateDurationThreshold);
+ }
+
+ public void updateMissingTopStateResourceMap(String resourceName,String
partitionName, boolean isTopStateMissing, long startTime) {
+ // Top state started missing
+ if (isTopStateMissing) {
+ // Wake up asyncMissingTopStateMonitor thread on first resource being
added to map
+ if (_missingTopStateResourceMap.isEmpty()) {
+ synchronized (_asyncMissingTopStateMonitor) {
+ _asyncMissingTopStateMonitor.notify();
+ }
+ }
+ if (!_missingTopStateResourceMap.containsKey(resourceName)) {
+ _missingTopStateResourceMap.put(resourceName, new HashMap<String,
Long>());
+ }
+ _missingTopStateResourceMap.get(resourceName).put(partitionName,
startTime);
+ } else { // top state recovered
+ // remove partitions from resourceMap whose top state has been
recovered, this will put
+ // asyncMissingTopStateMonitor thread to sleep when no resources left to
monitor.
+ Map<String, Long> entry = _missingTopStateResourceMap.get(resourceName);
+ if (entry != null) {
+ entry.remove(partitionName);
+ }
Review Comment:
let me know if above comment makes sense
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]