Package org.apache.bookkeeper.client
Class TopologyAwareEnsemblePlacementPolicy.DefaultResolver
java.lang.Object
org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy.DefaultResolver
- All Implemented Interfaces:
DNSToSwitchMapping
- Enclosing class:
- TopologyAwareEnsemblePlacementPolicy
static class TopologyAwareEnsemblePlacementPolicy.DefaultResolver
extends Object
implements DNSToSwitchMapping
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.net.DNSToSwitchMapping
setBookieAddressResolver, useHostName
-
Field Details
-
defaultRackSupplier
-
-
Constructor Details
-
DefaultResolver
-
-
Method Details
-
resolve
Description copied from interface:DNSToSwitchMappingResolves a list of DNS-names/IP-addresses and returns back a list of switch information (network paths). One-to-one correspondence must be maintained between the elements in the lists. Consider an element in the argument list - x.y.com. The switch information that is returned must be a network path of the form /foo/rack, where / is the root, and 'foo' is the switch where 'rack' is connected. Note the hostname/ip-address is not part of the returned path. The network topology of the cluster would determine the number of components in the network path.If 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- Specified by:
resolvein interfaceDNSToSwitchMapping- Parameters:
names- the list of hosts to resolve (can be empty)- Returns:
- list of resolved network paths. If names is empty, the returned list is also empty
-
reloadCachedMappings
public void reloadCachedMappings()Description copied from interface:DNSToSwitchMappingReload all of the cached mappings.If there is a cache, this method will clear it, so that future accesses will get a chance to see the new data.
- Specified by:
reloadCachedMappingsin interfaceDNSToSwitchMapping
-