public class AnnotationReadingPriorityFunction extends java.lang.Object implements PriorityFunction
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Integer> |
annotatedQos |
static java.lang.String |
SCAN_VTIME_WEIGHT_CONF_KEY
Used to control the scan delay, currently sqrt(numNextCall * weight)
|
| Constructor and Description |
|---|
AnnotationReadingPriorityFunction(RSRpcServices rpcServices)
Calls
AnnotationReadingPriorityFunction(RSRpcServices, Class) using the result of
rpcServices#getClass() |
AnnotationReadingPriorityFunction(RSRpcServices rpcServices,
java.lang.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 |
|---|---|
protected int |
getAnnotatedPriority(RequestHeader header)
See if the method has an annotation.
|
protected int |
getBasePriority(RequestHeader header,
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(RequestHeader header,
Message param)
Based on the request content, returns the deadline of the request.
|
int |
getPriority(RequestHeader header,
Message param,
User user)
Returns a 'priority' based on the request type.
|
public static final java.lang.String SCAN_VTIME_WEIGHT_CONF_KEY
protected final java.util.Map<java.lang.String,java.lang.Integer> annotatedQos
public AnnotationReadingPriorityFunction(RSRpcServices rpcServices)
AnnotationReadingPriorityFunction(RSRpcServices, Class) using the result of
rpcServices#getClass()rpcServices - The RPC server implementationpublic AnnotationReadingPriorityFunction(RSRpcServices rpcServices, java.lang.Class<? extends RSRpcServices> clz)
clz.rpcServices - The RPC server implementationclz - The concrete RPC server implementation's classpublic int getPriority(RequestHeader header,
Message param,
User user)
getPriority in interface PriorityFunctionprotected int getAnnotatedPriority(RequestHeader header)
header - protected int getBasePriority(RequestHeader header,
Message param)
public long getDeadline(RequestHeader header,
Message param)
getDeadline in interface PriorityFunctionheader - param -