public enum HostDistance extends Enum<HostDistance>
LoadBalancingPolicy
(through its distance
method).
The distance assigned to an host influences how many connections the driver
maintains towards this host. If for a given host the assigned HostDistance
is LOCAL
or REMOTE
, some connections will be maintained by
the driver to this host. More active connections will be kept to
LOCAL
host than to a REMOTE
one (and thus well behaving
LoadBalancingPolicy
should assign a REMOTE
distance only to
hosts that are the less often queried).
However, if a host is assigned the distance IGNORED
, no connection
to that host will maintained active. In other words, IGNORED
should
be assigned to hosts that should not be used by this driver (because they
are in a remote datacenter for instance).
Modifier and Type | Method and Description |
---|---|
static HostDistance |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HostDistance[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HostDistance LOCAL
public static final HostDistance REMOTE
public static final HostDistance IGNORED
public static HostDistance[] values()
for (HostDistance c : HostDistance.values()) System.out.println(c);
public static HostDistance 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 nullCopyright © 2014. All Rights Reserved.