@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 com.google.protobuf.Message>> |
argumentToClassMap |
private Class<? extends com.google.protobuf.Message>[] |
knownArgumentClasses |
private static org.apache.commons.logging.Log |
LOG |
private Map<String,Map<Class<? extends 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() |
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.protobuf.generated.RPCProtos.RequestHeader header)
See if the method has an annotation.
|
protected int |
getBasePriority(org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader header,
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.protobuf.generated.RPCProtos.RequestHeader header,
com.google.protobuf.Message param)
Based on the request content, returns the deadline of the request.
|
int |
getPriority(org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader header,
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.apache.commons.logging.Log LOG
public static final String SCAN_VTIME_WEIGHT_CONF_KEY
private RSRpcServices rpcServices
private final Class<? extends com.google.protobuf.Message>[] knownArgumentClasses
private final Map<String,Class<? extends com.google.protobuf.Message>> argumentToClassMap
private final Map<String,Map<Class<? extends com.google.protobuf.Message>,Method>> methodMap
private final float scanVirtualTimeWeight
public AnnotationReadingPriorityFunction(RSRpcServices rpcServices)
AnnotationReadingPriorityFunction(RSRpcServices, Class)
using the result of
rpcServices#getClass()
rpcServices
- The RPC server implementationpublic AnnotationReadingPriorityFunction(RSRpcServices rpcServices, Class<? extends RSRpcServices> clz)
clz
.rpcServices
- The RPC server implementationclz
- The concrete RPC server implementation's classpublic int getPriority(org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader header, com.google.protobuf.Message param, User user)
getPriority
in interface PriorityFunction
protected int getAnnotatedPriority(org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader header)
header
- protected int getBasePriority(org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader header, com.google.protobuf.Message param)
public long getDeadline(org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader header, com.google.protobuf.Message param)
getDeadline
in interface PriorityFunction
header
- param
- void setRegionServer(HRegionServer hrs)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.