@InterfaceAudience.Private public class AnnotationReadingPriorityFunction extends Object implements PriorityFunction
Modifier and Type | Field and Description |
---|---|
protected Map<String,Integer> |
annotatedQos |
private Map<String,Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>> |
argumentToClassMap |
private Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>[] |
knownArgumentClasses |
private static org.slf4j.Logger |
LOG |
private Map<String,Map<Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>,Method>> |
methodMap |
private RSRpcServices |
rpcServices |
static String |
SCAN_VTIME_WEIGHT_CONF_KEY
Used to control the scan delay, currently sqrt(numNextCall * weight)
|
private float |
scanVirtualTimeWeight |
Constructor and Description |
---|
AnnotationReadingPriorityFunction(RSRpcServices rpcServices)
Calls
AnnotationReadingPriorityFunction(RSRpcServices, Class) using the result of
rpcServices#getClass() n * The RPC server implementation |
AnnotationReadingPriorityFunction(RSRpcServices rpcServices,
Class<? extends RSRpcServices> clz)
Constructs the priority function given the RPC server implementation and the annotations on the
methods in the provided
clz . |
Modifier and Type | Method and Description |
---|---|
private 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 |
setRegionServer(HRegionServer hrs) |
private static final org.slf4j.Logger LOG
public static final String SCAN_VTIME_WEIGHT_CONF_KEY
protected final Map<String,Integer> annotatedQos
private RSRpcServices rpcServices
private final Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>[] knownArgumentClasses
private final Map<String,Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>> argumentToClassMap
private final Map<String,Map<Class<? extends org.apache.hbase.thirdparty.com.google.protobuf.Message>,Method>> methodMap
private final float scanVirtualTimeWeight
public AnnotationReadingPriorityFunction(RSRpcServices rpcServices)
AnnotationReadingPriorityFunction(RSRpcServices, Class)
using the result of
rpcServices#getClass()
n * The RPC server implementationpublic AnnotationReadingPriorityFunction(RSRpcServices rpcServices, Class<? extends RSRpcServices> clz)
clz
. n * The RPC server implementation n * The concrete RPC
server implementation's classprivate String capitalize(String s)
public int getPriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param, User user)
getPriority
in interface PriorityFunction
protected int getAnnotatedPriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header)
protected int getBasePriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param)
public long getDeadline(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param)
getDeadline
in interface PriorityFunction
void setRegionServer(HRegionServer hrs)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.