Class AnnotationReadingPriorityFunction

java.lang.Object
org.apache.hadoop.hbase.regionserver.AnnotationReadingPriorityFunction
All Implemented Interfaces:
PriorityFunction
Direct Known Subclasses:
MasterAnnotationReadingPriorityFunction

@Private public class AnnotationReadingPriorityFunction 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 Details

  • Constructor Details

  • Method Details

    • capitalize

      private String capitalize(String s)
    • 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:
      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.
    • 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:
      getDeadline in interface PriorityFunction
      Returns:
      Deadline of this request. 0 now, otherwise msec of 'delay'
    • setRegionServer