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
ConstructorsConstructorDescriptionNoRouterRpcFairnessPolicyController(org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionbooleanacquirePermit(String nsId) Request permission for a specific name service to continue the call and connect to downstream name node.booleanDetermine whether ns has registered handlers.Returns the JSON string of the available handler for each name service.intgetAvailablePermits(String nsId) Returns the available handler for each name service.voidreleasePermit(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.voidshutdown()Shutdown steps to stop accepting new permission requests and clean-up.
-
Constructor Details
-
NoRouterRpcFairnessPolicyController
public NoRouterRpcFairnessPolicyController(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
acquirePermit
Description copied from interface:RouterRpcFairnessPolicyControllerRequest 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:
acquirePermitin interfaceRouterRpcFairnessPolicyController- Parameters:
nsId- NS id for which a permission to continue is requested.- Returns:
- true or false based on whether permit is given.
-
releasePermit
Description copied from interface:RouterRpcFairnessPolicyControllerHandler 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:
releasePermitin interfaceRouterRpcFairnessPolicyController- Parameters:
nsId- Name service id for which permission release request is made.
-
shutdown
public void shutdown()Description copied from interface:RouterRpcFairnessPolicyControllerShutdown steps to stop accepting new permission requests and clean-up.- Specified by:
shutdownin interfaceRouterRpcFairnessPolicyController
-
getAvailableHandlerOnPerNs
Description copied from interface:RouterRpcFairnessPolicyControllerReturns the JSON string of the available handler for each name service.- Specified by:
getAvailableHandlerOnPerNsin interfaceRouterRpcFairnessPolicyController- Returns:
- the JSON string of the available handler for each name service.
-
getAvailablePermits
Description copied from interface:RouterRpcFairnessPolicyControllerReturns the available handler for each name service.- Specified by:
getAvailablePermitsin interfaceRouterRpcFairnessPolicyController- Parameters:
nsId- name service id.- Returns:
- the available handler for each name service.
-
contains
Description copied from interface:RouterRpcFairnessPolicyControllerDetermine whether ns has registered handlers.- Specified by:
containsin interfaceRouterRpcFairnessPolicyController- Parameters:
nsId- name service id.- Returns:
- true if the ns has registered handlers, false in other cases.
-