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

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

# Class RandomResolver

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

All Implemented Interfaces:
  `OrderedResolver`

public class RandomResolver extends Object implements OrderedResolver
Order the destinations randomly.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RandomResolver()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getFirstNamespace(String path, PathLocation loc)`
  Get a random name space from the path.

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

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

- ## Constructor Details

  - ### RandomResolver

    public RandomResolver()

- ## Method Details

  - ### getFirstNamespace

    public String getFirstNamespace(String path, PathLocation loc)
    Get a random name space from the path.
    Specified by:
      `getFirstNamespace` in interface `OrderedResolver`
    Parameters:
      `path` - Path ignored by this policy.
      `loc` - Federated location with multiple destinations.
    Returns:
      Random name space.