Package org.mariadb.r2dbc
Enum HaMode
- java.lang.Object
-
- java.lang.Enum<HaMode>
-
- org.mariadb.r2dbc.HaMode
-
- All Implemented Interfaces:
Serializable,Comparable<HaMode>
public enum HaMode extends Enum<HaMode>
Failover (High-availability) mode
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LOADBALANCEload-balance: driver will randomly connect to any host, permitting balancing connectionsNONEno ha-mode.SEQUENTIALsequential: driver will always connect according to connection string order
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract reactor.core.publisher.Mono<org.mariadb.r2dbc.client.Client>connectHost(MariadbConnectionConfiguration conf, ReentrantLock lock, boolean failFast)static reactor.core.publisher.Mono<org.mariadb.r2dbc.client.Client>connectHost(MariadbConnectionConfiguration conf, ReentrantLock lock, boolean failFast, BiFunction<List<HostAddress>,ConcurrentMap<HostAddress,Long>,List<HostAddress>> availHost, long endingNanoTime)static voidfailHost(HostAddress hostAddress)static HaModefrom(String value)Get HAMode from values or aliasesabstract List<HostAddress>getAvailableHost(List<HostAddress> hostAddresses, ConcurrentMap<HostAddress,Long> denyList)List of hosts without blacklist entries, ordered according to HA modestatic reactor.core.publisher.Mono<org.mariadb.r2dbc.client.Client>resumeConnect(Throwable t, MariadbConnectionConfiguration conf, ReentrantLock lock, boolean failFast, List<HostAddress> availableHosts, BiFunction<List<HostAddress>,ConcurrentMap<HostAddress,Long>,List<HostAddress>> availHost, Iterator<HostAddress> iterator, long endingNanoTime)static HaModevalueOf(String name)Returns the enum constant of this type with the specified name.static HaMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SEQUENTIAL
public static final HaMode SEQUENTIAL
sequential: driver will always connect according to connection string order
-
LOADBALANCE
public static final HaMode LOADBALANCE
load-balance: driver will randomly connect to any host, permitting balancing connections
-
NONE
public static final HaMode NONE
no ha-mode. Connect to first host only
-
-
Method Detail
-
values
public static HaMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HaMode c : HaMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HaMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
from
public static HaMode from(String value)
Get HAMode from values or aliases- Parameters:
value- value or alias- Returns:
- HaMode if corresponding mode is found
-
resumeConnect
public static reactor.core.publisher.Mono<org.mariadb.r2dbc.client.Client> resumeConnect(Throwable t, MariadbConnectionConfiguration conf, ReentrantLock lock, boolean failFast, List<HostAddress> availableHosts, BiFunction<List<HostAddress>,ConcurrentMap<HostAddress,Long>,List<HostAddress>> availHost, Iterator<HostAddress> iterator, long endingNanoTime)
-
connectHost
public static reactor.core.publisher.Mono<org.mariadb.r2dbc.client.Client> connectHost(MariadbConnectionConfiguration conf, ReentrantLock lock, boolean failFast, BiFunction<List<HostAddress>,ConcurrentMap<HostAddress,Long>,List<HostAddress>> availHost, long endingNanoTime)
-
getAvailableHost
public abstract List<HostAddress> getAvailableHost(List<HostAddress> hostAddresses, ConcurrentMap<HostAddress,Long> denyList)
List of hosts without blacklist entries, ordered according to HA mode- Parameters:
hostAddresses- hostsdenyList- hosts temporary denied- Returns:
- list without denied hosts
-
connectHost
public abstract reactor.core.publisher.Mono<org.mariadb.r2dbc.client.Client> connectHost(MariadbConnectionConfiguration conf, ReentrantLock lock, boolean failFast)
-
failHost
public static void failHost(HostAddress hostAddress)
-
-