Record Class MigrationProgress
java.lang.Object
java.lang.Record
com.loomcache.server.sharding.MigrationProgress
- Record Components:
totalMoves- the total number of partition moves in the plancompletedMoves- the number of moves completed so farstatus- the current migration status
public record MigrationProgress(int totalMoves, int completedMoves, MigrationProgress.MigrationStatus status)
extends Record
Tracks the progress of an ongoing partition rebalance migration.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe lifecycle states of a partition migration. -
Constructor Summary
ConstructorsConstructorDescriptionMigrationProgress(int totalMoves, int completedMoves, MigrationProgress.MigrationStatus status) Compact constructor with validation. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecompletedMovesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static MigrationProgressidle()Returns an idle progress instance (no migration in progress).doubleReturns the percentage of migration completed.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalMovesrecord component.
-
Constructor Details
-
MigrationProgress
public MigrationProgress(int totalMoves, int completedMoves, MigrationProgress.MigrationStatus status) Compact constructor with validation.
-
-
Method Details
-
percentComplete
public double percentComplete()Returns the percentage of migration completed.- Returns:
- a value in [0.0, 100.0]
-
idle
Returns an idle progress instance (no migration in progress).- Returns:
- idle progress (never null)
-
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. -
totalMoves
public int totalMoves()Returns the value of thetotalMovesrecord component.- Returns:
- the value of the
totalMovesrecord component
-
completedMoves
public int completedMoves()Returns the value of thecompletedMovesrecord component.- Returns:
- the value of the
completedMovesrecord component
-
status
-