本文整理匯總了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);
}
示例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);
}
示例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;
}