public interface LoadBalancingPolicy
| Modifier and Type | Method and Description |
|---|---|
default boolean |
isPerQuery()
Whether this policy rotates readers per read query (query-level load balancing).
|
@Nullable HostSpec |
pickReader(RwSplitContext ctx,
java.util.List<HostSpec> candidates)
Selects the reader target for this request, or
null when no eligible target is
available. |
@Nullable HostSpec pickReader(RwSplitContext ctx, java.util.List<HostSpec> candidates) throws java.sql.SQLException
null when no eligible target is
available.ctx - the read/write splitting contextcandidates - the eligible reader candidatesnull if none is availablejava.sql.SQLExceptiondefault boolean isPerQuery()
true, the plugin selects a fresh reader on each read-routing decision within an
established read-only phase instead of reusing a single sticky reader.true for per-query balancing; false (default) for a sticky reader