HashFirstResolver (Apache Hadoop HDFS-RBF 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.federation.resolver.order, class: HashFirstResolver

Package org.apache.hadoop.hdfs.server.federation.resolver.order

# Class HashFirstResolver

java.lang.Object
org.apache.hadoop.hdfs.server.federation.resolver.order.HashResolver
org.apache.hadoop.hdfs.server.federation.resolver.order.HashFirstResolver

All Implemented Interfaces:
  `OrderedResolver`

public class HashFirstResolver extends HashResolver
Variation of HashResolver that only uses the first level of the path.

- ## Field Summary

  ### Fields inherited from class org.apache.hadoop.hdfs.server.federation.resolver.order.HashResolver

  `LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HashFirstResolver()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getFirstNamespace(String path, PathLocation loc)`
  Use the result from consistent hashing locator to prioritize the locations for a path.

  ### Methods inherited from class org.apache.hadoop.hdfs.server.federation.resolver.order.HashResolver

  `extractTempFileName`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### HashFirstResolver

    public HashFirstResolver()

- ## Method Details

  - ### getFirstNamespace

    public String getFirstNamespace(String path, PathLocation loc)
    Description copied from class: `HashResolver`
    Use the result from consistent hashing locator to prioritize the locations for a path.
    Specified by:
      `getFirstNamespace` in interface `OrderedResolver`
    Overrides:
      `getFirstNamespace` in class `HashResolver`
    Parameters:
      `path` - Path to check.
      `loc` - Federated location with multiple destinations.
    Returns:
      First namespace based on hash.