Class ProportionRouterRpcFairnessPolicyController
java.lang.Object
org.apache.hadoop.hdfs.server.federation.fairness.AbstractRouterRpcFairnessPolicyController
org.apache.hadoop.hdfs.server.federation.fairness.ProportionRouterRpcFairnessPolicyController
- All Implemented Interfaces:
RouterRpcFairnessPolicyController
public class ProportionRouterRpcFairnessPolicyController
extends AbstractRouterRpcFairnessPolicyController
Proportion fairness policy extending
AbstractRouterRpcFairnessPolicyController
and fetching proportion of handlers from configuration for all available name services,
based on the proportion and the total number of handlers, calculate the handlers of all ns.
The handlers count will not change for this controller.-
Constructor Summary
ConstructorsConstructorDescriptionProportionRouterRpcFairnessPolicyController(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
-
Constructor Details
-
ProportionRouterRpcFairnessPolicyController
public ProportionRouterRpcFairnessPolicyController(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
init
public void init(org.apache.hadoop.conf.Configuration conf) - Overrides:
initin classAbstractRouterRpcFairnessPolicyController
-
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.
-