Record Class HaPolicy
java.lang.Object
java.lang.Record
org.j7m.middleware.ha.HaPolicy
- Record Components:
preferLocal- whether local candidates should be preferredenableHpSelection- whether HP scoring should be usedbenchmarkTtlMillis- benchmark result cache TTL
public record HaPolicy(boolean preferLocal, boolean enableHpSelection, long benchmarkTtlMillis)
extends Record
High-availability and high-performance selection policy marker.
The core runtime implements basic HA proxy behavior directly above the registry and transport SPI. This record keeps the HA module explicit for later selector/statistics expansion.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thebenchmarkTtlMillisrecord component.static HaPolicydefaults()Returns the default policy.booleanReturns the value of theenableHpSelectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thepreferLocalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HaPolicy
public HaPolicy(boolean preferLocal) Creates a compatibility policy with local preference and HP enabled.- Parameters:
preferLocal- whether local candidates should be preferred
-
HaPolicy
public HaPolicy(boolean preferLocal, boolean enableHpSelection, long benchmarkTtlMillis) Creates an instance of aHaPolicyrecord class.- Parameters:
preferLocal- the value for thepreferLocalrecord componentenableHpSelection- the value for theenableHpSelectionrecord componentbenchmarkTtlMillis- the value for thebenchmarkTtlMillisrecord component
-
-
Method Details
-
defaults
-
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. -
preferLocal
public boolean preferLocal()Returns the value of thepreferLocalrecord component.- Returns:
- the value of the
preferLocalrecord component
-
enableHpSelection
public boolean enableHpSelection()Returns the value of theenableHpSelectionrecord component.- Returns:
- the value of the
enableHpSelectionrecord component
-
benchmarkTtlMillis
public long benchmarkTtlMillis()Returns the value of thebenchmarkTtlMillisrecord component.- Returns:
- the value of the
benchmarkTtlMillisrecord component
-