public enum HaMode extends Enum<HaMode>
| Enum Constant and Description |
|---|
LOADBALANCE |
NONE
no ha-mode.
|
REPLICATION
replication mode : first is primary, other are replica
|
SEQUENTIAL |
| Modifier and Type | Method and Description |
|---|---|
static HaMode |
from(String value)
Get HAMode from values or aliases
|
abstract Optional<HostAddress> |
getAvailableHost(List<HostAddress> hostAddresses,
ConcurrentMap<HostAddress,Long> denyList,
boolean primary)
List of hosts without blacklist entries, ordered according to HA mode
|
static Optional<HostAddress> |
getAvailableHostInOrder(List<HostAddress> hostAddresses,
ConcurrentMap<HostAddress,Long> denyList,
boolean primary)
return hosts of corresponding type (primary or not) without blacklisted hosts.
|
static Optional<HostAddress> |
getAvailableHostRandomOrder(List<HostAddress> hostAddresses,
ConcurrentMap<HostAddress,Long> denyList,
boolean primary)
return hosts of corresponding type (primary or not) without blacklisted hosts.
|
static HaMode |
valueOf(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.
|
public static final HaMode REPLICATION
public static final HaMode SEQUENTIAL
public static final HaMode LOADBALANCE
public static final HaMode NONE
public static HaMode[] values()
for (HaMode c : HaMode.values()) System.out.println(c);
public static HaMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static HaMode from(String value)
value - value or aliaspublic static Optional<HostAddress> getAvailableHostInOrder(List<HostAddress> hostAddresses, ConcurrentMap<HostAddress,Long> denyList, boolean primary)
hostAddresses - hostsdenyList - blacklistprimary - returns primary hosts or replicapublic static Optional<HostAddress> getAvailableHostRandomOrder(List<HostAddress> hostAddresses, ConcurrentMap<HostAddress,Long> denyList, boolean primary)
hostAddresses - hostsdenyList - blacklistprimary - returns primary hosts or replicapublic abstract Optional<HostAddress> getAvailableHost(List<HostAddress> hostAddresses, ConcurrentMap<HostAddress,Long> denyList, boolean primary)
hostAddresses - hostsdenyList - hosts temporary deniedprimary - typeCopyright © 2023 SingleStore. All rights reserved.