static class TopologyAwareEnsemblePlacementPolicy.DefaultResolver
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 |
| Constructor and Description |
|---|
DefaultResolver(java.util.function.Supplier<java.lang.String> defaultRackSupplier) |
| 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).
|
final java.util.function.Supplier<java.lang.String> defaultRackSupplier
public DefaultResolver(java.util.function.Supplier<java.lang.String> defaultRackSupplier)
public 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 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.