Package com.yahoo.config.provision.zone
Record Class NodeSlice
java.lang.Object
java.lang.Record
com.yahoo.config.provision.zone.NodeSlice
A slice of nodes, satisfied by either a minimum count or a fraction.
- Author:
- mpolden
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNodeSlice
(OptionalDouble fraction, OptionalLong minCount) Creates an instance of aNodeSlice
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.fraction()
Returns the value of thefraction
record component.static NodeSlice
fraction
(double fraction) Returns a slice matching the given fraction of nodesfinal int
hashCode()
Returns a hash code value for this object.minCount()
Returns the value of theminCount
record component.static NodeSlice
minCount
(long count) Returns a slice matching the given minimum number of nodesboolean
satisfiedBy
(long count, long totalCount) Returns whether this slice is satisfied by given node count, out of totalCountfinal String
toString()
Returns a string representation of this record class.
-
Field Details
-
ALL
-
-
Constructor Details
-
NodeSlice
Creates an instance of aNodeSlice
record class.- Parameters:
fraction
- the value for thefraction
record componentminCount
- the value for theminCount
record component
-
-
Method Details
-
satisfiedBy
public boolean satisfiedBy(long count, long totalCount) Returns whether this slice is satisfied by given node count, out of totalCount -
fraction
Returns a slice matching the given fraction of nodes -
minCount
Returns a slice matching the given minimum number of nodes -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 withObjects::equals(Object,Object)
. -
fraction
Returns the value of thefraction
record component.- Returns:
- the value of the
fraction
record component
-
minCount
Returns the value of theminCount
record component.- Returns:
- the value of the
minCount
record component
-