Class HashResolver
java.lang.Object
org.apache.hadoop.hdfs.server.federation.resolver.order.HashResolver
- All Implemented Interfaces:
OrderedResolver
- Direct Known Subclasses:
HashFirstResolver
Order the destinations based on consistent hashing.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractTempFileName(String input) Some files use a temporary naming pattern.getFirstNamespace(String path, PathLocation loc) Use the result from consistent hashing locator to prioritize the locations for a path.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
HashResolver
public HashResolver()
-
-
Method Details
-
getFirstNamespace
Use the result from consistent hashing locator to prioritize the locations for a path.- Specified by:
getFirstNamespacein interfaceOrderedResolver- Parameters:
path- Path to check.loc- Federated location with multiple destinations.- Returns:
- First namespace based on hash.
-
extractTempFileName
Some files use a temporary naming pattern. Extract the final name from the temporary name. For example, files *._COPYING_ will be renamed, so we remove that chunk.- Parameters:
input- Input string.- Returns:
- Final file name.
-