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

Package org.apache.hadoop.hdfs.server.federation.fairness

# Class NoRouterRpcFairnessPolicyController

java.lang.Object
org.apache.hadoop.hdfs.server.federation.fairness.NoRouterRpcFairnessPolicyController

All Implemented Interfaces:
  `RouterRpcFairnessPolicyController`

public class NoRouterRpcFairnessPolicyController extends Object implements RouterRpcFairnessPolicyController
A pass through fairness policy that implements `RouterRpcFairnessPolicyController` and allows any number of handlers to connect to any specific downstream name service.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NoRouterRpcFairnessPolicyController(org.apache.hadoop.conf.Configuration conf)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `acquirePermit(String nsId)`
  Request permission for a specific name service to continue the call and connect to downstream name node.
  `boolean`
  `contains(String nsId)`
  Determine whether ns has registered handlers.
  `String`
  `getAvailableHandlerOnPerNs()`
  Returns the JSON string of the available handler for each name service.
  `int`
  `getAvailablePermits(String nsId)`
  Returns the available handler for each name service.
  `void`
  `releasePermit(String nsId)`
  Handler threads are expected to invoke this method that signals controller to release the resources allocated to the thread for the particular name service.
  `void`
  `shutdown()`
  Shutdown steps to stop accepting new permission requests and clean-up.

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

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

- ## Constructor Details

  - ### NoRouterRpcFairnessPolicyController

    public NoRouterRpcFairnessPolicyController(org.apache.hadoop.conf.Configuration conf)

- ## Method Details

  - ### acquirePermit

    public boolean acquirePermit(String nsId)
    Description copied from interface: `RouterRpcFairnessPolicyController`
    Request permission for a specific name service to continue the call and connect to downstream name node. Controllers based on policies defined and allocations done at start-up through assignHandlersToNameservices, may provide a permission or reject the request by throwing exception.
    Specified by:
      `acquirePermit` in interface `RouterRpcFairnessPolicyController`
    Parameters:
      `nsId` - NS id for which a permission to continue is requested.
    Returns:
      true or false based on whether permit is given.

  - ### releasePermit

    public void releasePermit(String nsId)
    Description copied from interface: `RouterRpcFairnessPolicyController`
    Handler threads are expected to invoke this method that signals controller to release the resources allocated to the thread for the particular name service. This would mean permissions getting available for other handlers to request for this specific name service.
    Specified by:
      `releasePermit` in interface `RouterRpcFairnessPolicyController`
    Parameters:
      `nsId` - Name service id for which permission release request is made.

  - ### shutdown

    public void shutdown()
    Description copied from interface: `RouterRpcFairnessPolicyController`
    Shutdown steps to stop accepting new permission requests and clean-up.
    Specified by:
      `shutdown` in interface `RouterRpcFairnessPolicyController`

  - ### getAvailableHandlerOnPerNs

    public String getAvailableHandlerOnPerNs()
    Description copied from interface: `RouterRpcFairnessPolicyController`
    Returns the JSON string of the available handler for each name service.
    Specified by:
      `getAvailableHandlerOnPerNs` in interface `RouterRpcFairnessPolicyController`
    Returns:
      the JSON string of the available handler for each name service.

  - ### getAvailablePermits

    public int getAvailablePermits(String nsId)
    Description copied from interface: `RouterRpcFairnessPolicyController`
    Returns the available handler for each name service.
    Specified by:
      `getAvailablePermits` in interface `RouterRpcFairnessPolicyController`
    Parameters:
      `nsId` - name service id.
    Returns:
      the available handler for each name service.

  - ### contains

    public boolean contains(String nsId)
    Description copied from interface: `RouterRpcFairnessPolicyController`
    Determine whether ns has registered handlers.
    Specified by:
      `contains` in interface `RouterRpcFairnessPolicyController`
    Parameters:
      `nsId` - name service id.
    Returns:
      true if the ns has registered handlers, false in other cases.