Package org.apache.hadoop.hbase.master
Class MasterAnnotationReadingPriorityFunction
java.lang.Object
org.apache.hadoop.hbase.ipc.AnnotationReadingPriorityFunction<MasterRpcServices>
org.apache.hadoop.hbase.master.MasterAnnotationReadingPriorityFunction
- All Implemented Interfaces:
PriorityFunction
@Private
public class MasterAnnotationReadingPriorityFunction
extends AnnotationReadingPriorityFunction<MasterRpcServices>
Priority function specifically for the master.
This doesn't make the super users always priority since that would make everything to the master
into high priority.
Specifically when reporting that a region is in transition master will try and edit the meta
table. That edit will block the thread until successful. However if at the same time meta is also
moving then we need to ensure that the regular region that's moving isn't blocking processing of
the request to online meta. To accomplish this this priority function makes sure that all
requests to transition meta are handled in different threads from other report region in
transition calls.
After HBASE-21754, ReportRegionStateTransitionRequest for meta region will be assigned a META_QOS
, a separate executor called metaTransitionExecutor will execute it. Other transition request
will be executed in priorityExecutor to prevent being mixed with normal requests
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
We reference this value in SimpleRpcScheduler so this class have to be public instead of package privateFields inherited from class org.apache.hadoop.hbase.ipc.AnnotationReadingPriorityFunction
annotatedQos, rpcServices
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
getBasePriority
(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param) Get the priority for a given request from the header and the param.long
getDeadline
(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param) Returns the deadline of the specified request.protected int
normalizePriority
(int priority) Methods inherited from class org.apache.hadoop.hbase.ipc.AnnotationReadingPriorityFunction
getAnnotatedPriority, getPriority
-
Field Details
-
META_TRANSITION_QOS
We reference this value in SimpleRpcScheduler so this class have to be public instead of package private- See Also:
-
-
Constructor Details
-
MasterAnnotationReadingPriorityFunction
MasterAnnotationReadingPriorityFunction(MasterRpcServices rpcServices)
-
-
Method Details
-
normalizePriority
- Specified by:
normalizePriority
in classAnnotationReadingPriorityFunction<MasterRpcServices>
-
getBasePriority
protected int getBasePriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param) Description copied from class:AnnotationReadingPriorityFunction
Get the priority for a given request from the header and the param. This doesn't consider which user is sending the request at all. This doesn't consider annotations- Specified by:
getBasePriority
in classAnnotationReadingPriorityFunction<MasterRpcServices>
-
getDeadline
public long getDeadline(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param) Description copied from interface:PriorityFunction
Returns the deadline of the specified request. The returned value is used to sort the dispatch queue.- Returns:
- Deadline of this request. 0 now, otherwise msec of 'delay'
-