Record Class CacheWarmer.WarmingResult<K>
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.warming.CacheWarmer.WarmingResult<K>
- Type Parameters:
K- the key type | 键类型- Record Components:
totalKeys- the total number of keys | 总键数warmedCount- the number of successfully warmed keys | 成功预热的键数failedCount- the number of failed keys | 失败的键数skippedCount- the number of skipped keys | 跳过的键数failedKeys- the set of failed keys | 失败的键集合duration- the warming duration | 预热持续时间
- Enclosing class:
CacheWarmer<K,V>
public static record CacheWarmer.WarmingResult<K>(int totalKeys, int warmedCount, int failedCount, int skippedCount, Set<K> failedKeys, Duration duration)
extends Record
Warming result
预热结果
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionWarmingResult(int totalKeys, int warmedCount, int failedCount, int skippedCount, Set<K> failedKeys, Duration duration) Creates an instance of aWarmingResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefailedCountrecord component.Returns the value of thefailedKeysrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns whether warming is complete | 返回预热是否完成doubleReturns the completion percentage | 返回完成百分比intReturns the value of theskippedCountrecord component.doubleReturns the success rate | 返回成功率final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalKeysrecord component.intReturns the value of thewarmedCountrecord component.
-
Constructor Details
-
WarmingResult
public WarmingResult(int totalKeys, int warmedCount, int failedCount, int skippedCount, Set<K> failedKeys, Duration duration) Creates an instance of aWarmingResultrecord class.- Parameters:
totalKeys- the value for thetotalKeysrecord componentwarmedCount- the value for thewarmedCountrecord componentfailedCount- the value for thefailedCountrecord componentskippedCount- the value for theskippedCountrecord componentfailedKeys- the value for thefailedKeysrecord componentduration- the value for thedurationrecord component
-
-
Method Details
-
successRate
public double successRate()Returns the success rate | 返回成功率- Returns:
- success rate (0.0 to 1.0) | 成功率
-
isComplete
public boolean isComplete()Returns whether warming is complete | 返回预热是否完成- Returns:
- true if complete | 完成返回 true
-
percentComplete
public double percentComplete()Returns the completion percentage | 返回完成百分比- Returns:
- percent complete | 完成百分比
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
totalKeys
-
warmedCount
public int warmedCount()Returns the value of thewarmedCountrecord component.- Returns:
- the value of the
warmedCountrecord component
-
failedCount
public int failedCount()Returns the value of thefailedCountrecord component.- Returns:
- the value of the
failedCountrecord component
-
skippedCount
public int skippedCount()Returns the value of theskippedCountrecord component.- Returns:
- the value of the
skippedCountrecord component
-
failedKeys
Returns the value of thefailedKeysrecord component.- Returns:
- the value of the
failedKeysrecord component
-
duration
-