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

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

# Class LeaderFollowerResolver

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

All Implemented Interfaces:
  `OrderedResolver`

public class LeaderFollowerResolver extends Object implements OrderedResolver
LEADER_FOLLOWER can be used in cross-cluster disaster tolerance, and the order of namespaces is always "leader,follower,follower...". Write data in leader sub-cluster as many as possible. If leader sub-cluster failed, try followers then, the same goes for reading data.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final org.slf4j.Logger`
  `LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LeaderFollowerResolver()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getFirstNamespace(String path, PathLocation loc)`
  Get the first namespace based on this resolver approach.

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

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

- ## Field Details

  - ### LOG

    protected static final org.slf4j.Logger LOG

- ## Constructor Details

  - ### LeaderFollowerResolver

    public LeaderFollowerResolver()

- ## Method Details

  - ### getFirstNamespace

    public String getFirstNamespace(String path, PathLocation loc)
    Description copied from interface: `OrderedResolver`
    Get the first namespace based on this resolver approach.
    Specified by:
      `getFirstNamespace` in interface `OrderedResolver`
    Parameters:
      `path` - Path to check.
      `loc` - Federated location with multiple destinations.
    Returns:
      First namespace out of the locations.