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


Java HConstants.REPLICATION_QOS屬性代碼示例

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


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

示例1: replicateWALEntry

/**
 * Replicate WAL entries on the region server.
 *
 * @param controller the RPC controller
 * @param request the request
 * @throws ServiceException
 */
@Override
@QosPriority(priority=HConstants.REPLICATION_QOS)
public ReplicateWALEntryResponse replicateWALEntry(final RpcController controller,
    final ReplicateWALEntryRequest request) throws ServiceException {
  try {
    checkOpen();
    if (regionServer.replicationSinkHandler != null) {
      requestCount.increment();
      List<WALEntry> entries = request.getEntryList();
      CellScanner cellScanner = ((PayloadCarryingRpcController)controller).cellScanner();
      regionServer.getRegionServerCoprocessorHost().preReplicateLogEntries(entries, cellScanner);
      regionServer.replicationSinkHandler.replicateLogEntries(entries, cellScanner);
      regionServer.getRegionServerCoprocessorHost().postReplicateLogEntries(entries, cellScanner);
      return ReplicateWALEntryResponse.newBuilder().build();
    } else {
      throw new ServiceException("Replication services are not initialized yet");
    }
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:28,代碼來源:RSRpcServices.java

示例2: dispatch

@Override
public boolean dispatch(CallRunner callTask) throws InterruptedException {
  RpcServer.Call call = callTask.getCall();
  int level = priority.getPriority(call.getHeader(), call.param, call.getRequestUser());
  if (priorityExecutor != null && level > highPriorityLevel) {
    return priorityExecutor.dispatch(callTask);
  } else if (replicationExecutor != null && level == HConstants.REPLICATION_QOS) {
    return replicationExecutor.dispatch(callTask);
  } else {
    return callExecutor.dispatch(callTask);
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:12,代碼來源:SimpleRpcScheduler.java


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