Class RouterAsyncRpcFairnessPolicyController
java.lang.Object
org.apache.hadoop.hdfs.server.federation.fairness.AbstractRouterRpcFairnessPolicyController
org.apache.hadoop.hdfs.server.federation.fairness.RouterAsyncRpcFairnessPolicyController
- All Implemented Interfaces:
RouterRpcFairnessPolicyController
public class RouterAsyncRpcFairnessPolicyController
extends AbstractRouterRpcFairnessPolicyController
When router async rpc enabled, it is recommended to use this fairness controller.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRouterAsyncRpcFairnessPolicyController(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.voidinit(org.apache.hadoop.conf.Configuration conf) 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.Methods inherited from class org.apache.hadoop.hdfs.server.federation.fairness.AbstractRouterRpcFairnessPolicyController
contains, getAvailableHandlerOnPerNs, getAvailablePermits, insertNameServiceWithPermits, shutdown
-
Field Details
-
INIT_MSG
- See Also:
-
-
Constructor Details
-
RouterAsyncRpcFairnessPolicyController
public RouterAsyncRpcFairnessPolicyController(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
init
- Overrides:
initin classAbstractRouterRpcFairnessPolicyController- Throws:
IllegalArgumentException
-
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- Overrides:
acquirePermitin classAbstractRouterRpcFairnessPolicyController- 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- Overrides:
releasePermitin classAbstractRouterRpcFairnessPolicyController- Parameters:
nsId- Name service id for which permission release request is made.
-