Class AnnotationReadingPriorityFunction
java.lang.Object
org.apache.hadoop.hbase.regionserver.AnnotationReadingPriorityFunction
- All Implemented Interfaces:
PriorityFunction
- Direct Known Subclasses:
MasterAnnotationReadingPriorityFunction
Reads special method annotations and table names to figure a priority for use by QoS facility in
ipc; e.g: rpcs to hbase:meta get priority.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>[]
private static final org.slf4j.Logger
private final Map<String,
Map<Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>, Method>> private RSRpcServices
static final String
Used to control the scan delay, currently sqrt(numNextCall * weight)private final float
-
Constructor Summary
ConstructorDescriptionAnnotationReadingPriorityFunction
(RSRpcServices rpcServices) CallsAnnotationReadingPriorityFunction(RSRpcServices, Class)
using the result ofrpcServices#getClass()
The RPC server implementationAnnotationReadingPriorityFunction
(RSRpcServices rpcServices, Class<? extends RSRpcServices> clz) Constructs the priority function given the RPC server implementation and the annotations on the methods in the providedclz
. -
Method Summary
Modifier and TypeMethodDescriptionprivate String
capitalize
(String s) protected int
getAnnotatedPriority
(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header) See if the method has an annotation.protected 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 This doesn't consider which user is sending the request at all.long
getDeadline
(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param) Based on the request content, returns the deadline of the request.int
getPriority
(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param, User user) Returns a 'priority' based on the request type.(package private) void
-
Field Details
-
LOG
-
SCAN_VTIME_WEIGHT_CONF_KEY
Used to control the scan delay, currently sqrt(numNextCall * weight)- See Also:
-
annotatedQos
-
rpcServices
-
knownArgumentClasses
private final Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>[] knownArgumentClasses -
argumentToClassMap
private final Map<String,Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>> argumentToClassMap -
methodMap
-
scanVirtualTimeWeight
-
-
Constructor Details
-
AnnotationReadingPriorityFunction
CallsAnnotationReadingPriorityFunction(RSRpcServices, Class)
using the result ofrpcServices#getClass()
The RPC server implementation -
AnnotationReadingPriorityFunction
public AnnotationReadingPriorityFunction(RSRpcServices rpcServices, Class<? extends RSRpcServices> clz) Constructs the priority function given the RPC server implementation and the annotations on the methods in the providedclz
. The RPC server implementation The concrete RPC server implementation's class
-
-
Method Details
-
capitalize
-
getPriority
public int getPriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param, User user) Returns a 'priority' based on the request type. Currently the returned priority is used for queue selection. See the SimpleRpcScheduler as example. It maintains a queue per 'priory type' HIGH_QOS (meta requests), REPLICATION_QOS (replication requests), NORMAL_QOS (user requests).- Specified by:
getPriority
in interfacePriorityFunction
- Returns:
- Priority of this request.
-
getAnnotatedPriority
protected int getAnnotatedPriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header) See if the method has an annotation.- Returns:
- Return the priority from the annotation. If there isn't an annotation, this returns something below zero.
-
getBasePriority
protected 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 This doesn't consider which user is sending the request at all. This doesn't consider annotations -
getDeadline
public long getDeadline(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param) Based on the request content, returns the deadline of the request.- Specified by:
getDeadline
in interfacePriorityFunction
- Returns:
- Deadline of this request. 0 now, otherwise msec of 'delay'
-
setRegionServer
-