Record Class CacheWarmer.ProgressSnapshot<K>
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.warming.CacheWarmer.ProgressSnapshot<K>
- Type Parameters:
K- the key type | 键类型- Record Components:
totalKeys- the total number of keys | 总键数warmedCount- the number of warmed keys | 已预热的键数failedCount- the number of failed keys | 失败的键数skippedCount- the number of skipped keys | 跳过的键数elapsed- the elapsed time | 已用时间
- Enclosing class:
CacheWarmer<K,V>
public static record CacheWarmer.ProgressSnapshot<K>(int totalKeys, int warmedCount, int failedCount, int skippedCount, Duration elapsed)
extends Record
Progress snapshot for callbacks
用于回调的进度快照
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionProgressSnapshot(int totalKeys, int warmedCount, int failedCount, int skippedCount, Duration elapsed) Creates an instance of aProgressSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionelapsed()Returns the value of theelapsedrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefailedCountrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the completion percentage | 返回完成百分比intReturns the remaining count | 返回剩余数intReturns the value of theskippedCountrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalKeysrecord component.intReturns the value of thewarmedCountrecord component.
-
Constructor Details
-
ProgressSnapshot
public ProgressSnapshot(int totalKeys, int warmedCount, int failedCount, int skippedCount, Duration elapsed) Creates an instance of aProgressSnapshotrecord class.- Parameters:
totalKeys- the value for thetotalKeysrecord componentwarmedCount- the value for thewarmedCountrecord componentfailedCount- the value for thefailedCountrecord componentskippedCount- the value for theskippedCountrecord componentelapsed- the value for theelapsedrecord component
-
-
Method Details
-
percentComplete
public double percentComplete()Returns the completion percentage | 返回完成百分比- Returns:
- percent complete | 完成百分比
-
remaining
public int remaining()Returns the remaining count | 返回剩余数- Returns:
- remaining keys | 剩余键数
-
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
-
elapsed
-