static class TopologyAwareEnsemblePlacementPolicy.DNSResolverDecorator
extends java.lang.Object
implements org.apache.bookkeeper.net.DNSToSwitchMapping
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.function.Supplier<java.lang.String> |
defaultRackSupplier |
(package private) org.apache.bookkeeper.stats.Counter |
failedToResolveNetworkLocationCounter |
(package private) org.apache.bookkeeper.net.DNSToSwitchMapping |
resolver |
| Constructor and Description |
|---|
DNSResolverDecorator(org.apache.bookkeeper.net.DNSToSwitchMapping resolver,
java.util.function.Supplier<java.lang.String> defaultRackSupplier,
org.apache.bookkeeper.stats.Counter failedToResolveNetworkLocationCounter) |
| Modifier and Type | Method and Description |
|---|---|
void |
reloadCachedMappings()
Reload all of the cached mappings.
|
java.util.List<java.lang.String> |
resolve(java.util.List<java.lang.String> names)
Resolves a list of DNS-names/IP-addresses and returns back a list of
switch information (network paths).
|
void |
setBookieAddressResolver(org.apache.bookkeeper.proto.BookieAddressResolver bookieAddressResolver)
Receives the current BookieAddressResolver.
|
boolean |
useHostName()
Hints what to use with implementation when InetSocketAddress is converted
to String:
hostname (addr.getHostName(), default)
or IP address (addr.getAddress().getHostAddress()).
|
final java.util.function.Supplier<java.lang.String> defaultRackSupplier
final org.apache.bookkeeper.net.DNSToSwitchMapping resolver
@StatsDoc(name="FAILED_TO_RESOLVE_NETWORK_LOCATION_TOTAL",
help="total number of times Resolver failed to resolve rack information of a node")
final org.apache.bookkeeper.stats.Counter failedToResolveNetworkLocationCounter
DNSResolverDecorator(org.apache.bookkeeper.net.DNSToSwitchMapping resolver,
java.util.function.Supplier<java.lang.String> defaultRackSupplier,
org.apache.bookkeeper.stats.Counter failedToResolveNetworkLocationCounter)
public void setBookieAddressResolver(org.apache.bookkeeper.proto.BookieAddressResolver bookieAddressResolver)
org.apache.bookkeeper.net.DNSToSwitchMappingsetBookieAddressResolver in interface org.apache.bookkeeper.net.DNSToSwitchMappingpublic java.util.List<java.lang.String> resolve(java.util.List<java.lang.String> names)
org.apache.bookkeeper.net.DNSToSwitchMappingIf a name cannot be resolved to a rack, the implementation
should return NetworkTopology.DEFAULT_REGION_AND_RACK. This
is what the bundled implementations do, though it is not a formal requirement
resolve in interface org.apache.bookkeeper.net.DNSToSwitchMappingnames - the list of hosts to resolve (can be empty)public boolean useHostName()
org.apache.bookkeeper.net.DNSToSwitchMappinguseHostName in interface org.apache.bookkeeper.net.DNSToSwitchMappingpublic void reloadCachedMappings()
org.apache.bookkeeper.net.DNSToSwitchMappingIf there is a cache, this method will clear it, so that future accesses will get a chance to see the new data.
reloadCachedMappings in interface org.apache.bookkeeper.net.DNSToSwitchMappingCopyright © 2011–2024 The Apache Software Foundation. All rights reserved.