Record Class RackAwarePlacement.PlacementConstraint
java.lang.Object
java.lang.Record
com.loomcache.server.cluster.RackAwarePlacement.PlacementConstraint
- Record Components:
minRacks- minimum number of distinct racks for replicas (default 2)maxReplicasPerRack- maximum replicas allowed in a single rack
- Enclosing class:
RackAwarePlacement
public static record RackAwarePlacement.PlacementConstraint(int minRacks, int maxReplicasPerRack)
extends Record
Constraints for rack-aware placement.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPlacementConstraint(int minRacks, int maxReplicasPerRack) Creates an instance of aPlacementConstraintrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxReplicasPerRackrecord component.intminRacks()Returns the value of theminRacksrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlacementConstraint
public PlacementConstraint(int minRacks, int maxReplicasPerRack) Creates an instance of aPlacementConstraintrecord class.- Parameters:
minRacks- the value for theminRacksrecord componentmaxReplicasPerRack- the value for themaxReplicasPerRackrecord component
-
-
Method Details
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
minRacks
-
maxReplicasPerRack
public int maxReplicasPerRack()Returns the value of themaxReplicasPerRackrecord component.- Returns:
- the value of the
maxReplicasPerRackrecord component
-