Class AnnotationReadingPriorityFunction<T extends HBaseRpcServicesBase<?>>

java.lang.Object
org.apache.hadoop.hbase.ipc.AnnotationReadingPriorityFunction<T>
All Implemented Interfaces:
PriorityFunction
Direct Known Subclasses:
MasterAnnotationReadingPriorityFunction, RSAnnotationReadingPriorityFunction

@Private public abstract class AnnotationReadingPriorityFunction<T extends HBaseRpcServicesBase<?>> extends Object implements PriorityFunction
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

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<String,Integer>
     
    protected final T
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs the priority function given the RPC server implementation and the annotations on the methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    getAnnotatedPriority(org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header)
    See if the method has an annotation.
    protected abstract 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.
    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.
    protected abstract int
    normalizePriority(int priority)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.hbase.ipc.PriorityFunction

    getDeadline
  • Field Details

  • Constructor Details

    • AnnotationReadingPriorityFunction

      public AnnotationReadingPriorityFunction(T rpcServices)
      Constructs the priority function given the RPC server implementation and the annotations on the methods.
      Parameters:
      rpcServices - The RPC server implementation
  • Method Details

    • 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 'priority type':

      • HIGH_QOS (meta requests)
      • REPLICATION_QOS (replication requests)
      • NORMAL_QOS (user requests).
      Specified by:
      getPriority in interface PriorityFunction
      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.
    • normalizePriority

      protected abstract int normalizePriority(int priority)
    • getBasePriority

      protected abstract 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