Class SamplingAgeManager.TimeBasedAgeManager
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.actor.SamplingAgeManager
-
- com.inductiveautomation.gateway.tags.history.actor.SamplingAgeManager.TimeBasedAgeManager
-
- Enclosing class:
- SamplingAgeManager
public static class SamplingAgeManager.TimeBasedAgeManager extends SamplingAgeManager
This manages time based storage throttling. The trick to this class is that it's all based on the timestamps of the values that pass through, so that no matter how the data flows, we adhere to the expectation defined by the settings.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inductiveautomation.gateway.tags.history.actor.SamplingAgeManager
SamplingAgeManager.ExecCyclesMaxAge, SamplingAgeManager.TimeBasedAgeManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.Clock
clock
-
Fields inherited from class com.inductiveautomation.gateway.tags.history.actor.SamplingAgeManager
NO_MAX_AGE
-
-
Constructor Summary
Constructors Constructor Description TimeBasedAgeManager(long maxMS, long minMS)
TimeBasedAgeManager(java.time.Clock testClock, long maxMS, long minMS)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
checkMinAge(java.util.List<HistoricalTagValue> values)
Evaluates the min age setting, holding the values as pending and returning a long indicting the milliseconds until expiration, if applicable.boolean
equals(java.lang.Object obj)
java.util.List<HistoricalTagValue>
getAndClearPending()
boolean
markNoValuesAndCheckAge()
Returns whether values should be stored due to max age.void
markValuesStored(java.util.Date lastTS)
Should be called any time values are stored in order to reset any bookkeeping.java.lang.String
toString()
-
Methods inherited from class com.inductiveautomation.gateway.tags.history.actor.SamplingAgeManager
create
-
-
-
-
Method Detail
-
getAndClearPending
public java.util.List<HistoricalTagValue> getAndClearPending()
- Overrides:
getAndClearPending
in classSamplingAgeManager
-
markNoValuesAndCheckAge
public boolean markNoValuesAndCheckAge()
Description copied from class:SamplingAgeManager
Returns whether values should be stored due to max age. The caller should then call markValuesStored() after to let it know that values where stored.- Specified by:
markNoValuesAndCheckAge
in classSamplingAgeManager
-
checkMinAge
public long checkMinAge(java.util.List<HistoricalTagValue> values)
Description copied from class:SamplingAgeManager
Evaluates the min age setting, holding the values as pending and returning a long indicting the milliseconds until expiration, if applicable. If the return is <=0, the values can be stored.- Specified by:
checkMinAge
in classSamplingAgeManager
-
markValuesStored
public void markValuesStored(java.util.Date lastTS)
Description copied from class:SamplingAgeManager
Should be called any time values are stored in order to reset any bookkeeping. *- Specified by:
markValuesStored
in classSamplingAgeManager
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classSamplingAgeManager
-
-