Class LastStatisticsHolder<S>
java.lang.Object
org.openspaces.admin.internal.statistics.LastStatisticsHolder<S>
Holds last statistics and encapsulates lock mechanism
Created by moran on 12/9/17.
- Since:
- 12.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidReleases the acquired lock and notifies any waiting partiesvoidupdateLastStatistics(S lastStatistics) Updates with the last attempt for getting statistics.booleanvalidCache(long statisticsInterval) voidWaits until lock has been released
-
Constructor Details
-
LastStatisticsHolder
public LastStatisticsHolder() -
LastStatisticsHolder
-
-
Method Details
-
validCache
public boolean validCache(long statisticsInterval) - Returns:
- true if time has *not* elapsed from last statistics cached sample (i.e. cache is valid).
-
acquireLastStatisticsLock
public boolean acquireLastStatisticsLock()- Returns:
- true if acquired the lock; false if lock has already been acquired.
-
releaseLastStatisticsLock
public void releaseLastStatisticsLock()Releases the acquired lock and notifies any waiting parties- See Also:
-
waitForLastStatistics
public void waitForLastStatistics()Waits until lock has been released -
updateLastStatistics
Updates with the last attempt for getting statistics. Timestamp should be updated, statistics only if not null.- Parameters:
lastStatistics- can be null.
-
getLastStatistics
-