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
FieldsModifier and TypeFieldDescriptionprivate final Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>[]private static final org.slf4j.Loggerprivate final Map<String,Map<Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>, Method>> private RSRpcServicesstatic final StringUsed to control the scan delay, currently sqrt(numNextCall * weight)private final float -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationReadingPriorityFunction(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 Stringcapitalize(String s) protected intgetAnnotatedPriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header) See if the method has an annotation.protected intgetBasePriority(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.longgetDeadline(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.intgetPriority(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:
getPriorityin 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:
getDeadlinein interfacePriorityFunction- Returns:
- Deadline of this request. 0 now, otherwise msec of 'delay'
-
setRegionServer
-