當前位置: 首頁>>代碼示例>>Java>>正文


Java HConstants.NORMAL_QOS屬性代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.HConstants.NORMAL_QOS屬性的典型用法代碼示例。如果您正苦於以下問題:Java HConstants.NORMAL_QOS屬性的具體用法?Java HConstants.NORMAL_QOS怎麽用?Java HConstants.NORMAL_QOS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.hadoop.hbase.HConstants的用法示例。


在下文中一共展示了HConstants.NORMAL_QOS屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPriority

/**
 * 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).
 */
@Override
public int getPriority(RequestHeader header, Message param, User user) {
  int priorityByAnnotation = getAnnotatedPriority(header);

  if (priorityByAnnotation >= 0) {
    return priorityByAnnotation;
  }

  // all requests executed by super users have high QoS
  try {
    if (Superusers.isSuperUser(user)) {
      return HConstants.ADMIN_QOS;
    }
  } catch (IllegalStateException ex) {
    // Not good throwing an exception out of here, a runtime anyways.  Let the query go into the
    // server and have it throw the exception if still an issue.  Just mark it normal priority.
    if (LOG.isTraceEnabled()) LOG.trace("Marking normal priority after getting exception=" + ex);
    return HConstants.NORMAL_QOS;
  }

  return getBasePriority(header, param);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:30,代碼來源:AnnotationReadingPriorityFunction.java

示例2: getPriority

public int getPriority(RPCProtos.RequestHeader header, Message param, User user) {
  // Yes this is copy pasted from the base class but it keeps from having to look in the
  // annotatedQos table twice something that could get costly since this is called for
  // every single RPC request.
  int priorityByAnnotation = getAnnotatedPriority(header);
  if (priorityByAnnotation >= 0) {
    return priorityByAnnotation;
  }

  // If meta is moving then all the other of reports of state transitions will be
  // un able to edit meta. Those blocked reports should not keep the report that opens meta from
  // running. Hence all reports of meta transitioning should always be in a different thread.
  // This keeps from deadlocking the cluster.
  if (param instanceof RegionServerStatusProtos.ReportRegionStateTransitionRequest) {
    // Regions are moving. Lets see which ones.
    RegionServerStatusProtos.ReportRegionStateTransitionRequest
        tRequest = (RegionServerStatusProtos.ReportRegionStateTransitionRequest) param;
    for (RegionServerStatusProtos.RegionStateTransition rst : tRequest.getTransitionList()) {
      if (rst.getRegionInfoList() != null) {
        for (HBaseProtos.RegionInfo info : rst.getRegionInfoList()) {
          TableName tn = ProtobufUtil.toTableName(info.getTableName());
          if (tn.isSystemTable()) {
            return HConstants.SYSTEMTABLE_QOS;
          }
        }
      }
    }
    return HConstants.NORMAL_QOS;
  }

  // Handle the rest of the different reasons to change priority.
  return getBasePriority(header, param);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:33,代碼來源:MasterAnnotationReadingPriorityFunction.java

示例3: setPriority

/**
 * @param tn Set priority based off the table we are going against.
 */
public void setPriority(final TableName tn) {
  this.priority =
      (tn != null && tn.isSystemTable())? HConstants.SYSTEMTABLE_QOS: HConstants.NORMAL_QOS;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:7,代碼來源:PayloadCarryingRpcController.java


注:本文中的org.apache.hadoop.hbase.HConstants.NORMAL_QOS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。