Class MultipleDestinationMountTableResolver
java.lang.Object
org.apache.hadoop.hdfs.server.federation.resolver.MountTableResolver
org.apache.hadoop.hdfs.server.federation.resolver.MultipleDestinationMountTableResolver
- All Implemented Interfaces:
FileSubclusterResolver,StateStoreCache
Mount table resolver that supports multiple locations for each mount entry.
The returned location contains prioritized remote paths from highest priority
to the lowest priority. Multiple locations for a mount point are optional.
When multiple locations are specified, both will be checked for the presence
of a file and the nameservice for a new file/dir is chosen based on the
results of a consistent hashing algorithm.
Does the Mount table entry for this path have multiple destinations?
- No: Return the location
- Yes: Return all locations, prioritizing the best guess from the consistent hashing algorithm.
It has multiple options to order the locations: HASH (default), LOCAL, RANDOM, and HASH_ALL.
The consistent hashing result is dependent on the number and combination of nameservices that are registered for particular mount point. The order of nameservices/locations in the mount table is not prioritized. Each consistent hash calculation considers only the set of unique nameservices present for the mount table location.
-
Constructor Summary
ConstructorsConstructorDescriptionMultipleDestinationMountTableResolver(org.apache.hadoop.conf.Configuration conf, Router router) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResolver(DestinationOrder order, OrderedResolver resolver) getDestinationForPath(String path) Get the destinations for a global path.Methods inherited from class org.apache.hadoop.hdfs.server.federation.resolver.MountTableResolver
addEntry, clear, getCacheSize, getDefaultNameService, getDefaultNamespace, getLocCacheAccess, getLocCacheMiss, getMountPoint, getMountPoints, getMounts, getMountTableStore, getRouter, getTrashRoot, isDefaultNSEnable, isTrashPath, loadCache, lookupLocation, refreshEntries, removeEntry, setDefaultNameService, setDefaultNSEnable, setDisabled, subtractTrashCurrentPath, toString
-
Constructor Details
-
MultipleDestinationMountTableResolver
public MultipleDestinationMountTableResolver(org.apache.hadoop.conf.Configuration conf, Router router)
-
-
Method Details
-
getDestinationForPath
Description copied from interface:FileSubclusterResolverGet the destinations for a global path. Results are from the mount table cache. If multiple destinations are available, the first result is the highest priority destination.- Specified by:
getDestinationForPathin interfaceFileSubclusterResolver- Overrides:
getDestinationForPathin classMountTableResolver- Parameters:
path- Global path.- Returns:
- Location in a destination namespace or null if it does not exist.
- Throws:
IOException- Throws exception if the data is not available.
-
addResolver
-
getOrderedResolver
-