当前位置: 首页>>代码示例>>Java>>正文


Java ClientProtos.Action方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Action方法的典型用法代码示例。如果您正苦于以下问题:Java ClientProtos.Action方法的具体用法?Java ClientProtos.Action怎么用?Java ClientProtos.Action使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.protobuf.generated.ClientProtos的用法示例。


在下文中一共展示了ClientProtos.Action方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildMultiResponse

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
private MultiResponse buildMultiResponse(MultiRequest req) {
  MultiResponse.Builder builder = MultiResponse.newBuilder();
  RegionActionResult.Builder regionActionResultBuilder =
      RegionActionResult.newBuilder();
  ResultOrException.Builder roeBuilder = ResultOrException.newBuilder();
  for (RegionAction regionAction: req.getRegionActionList()) {
    regionActionResultBuilder.clear();
    for (ClientProtos.Action action: regionAction.getActionList()) {
      roeBuilder.clear();
      roeBuilder.setResult(ClientProtos.Result.getDefaultInstance());
      roeBuilder.setIndex(action.getIndex());
      regionActionResultBuilder.addResultOrException(roeBuilder.build());
    }
    builder.addRegionActionResult(regionActionResultBuilder.build());
  }
  return builder.build();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:TestCatalogJanitor.java

示例2: doMultiResponse

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
static MultiResponse doMultiResponse(final SortedMap<byte [], Pair<HRegionInfo, ServerName>> meta,
    final AtomicLong sequenceids, final MultiRequest request) {
  // Make a response to match the request.  Act like there were no failures.
  ClientProtos.MultiResponse.Builder builder = ClientProtos.MultiResponse.newBuilder();
  // Per Region.
  RegionActionResult.Builder regionActionResultBuilder =
      RegionActionResult.newBuilder();
  ResultOrException.Builder roeBuilder = ResultOrException.newBuilder();
  for (RegionAction regionAction: request.getRegionActionList()) {
    regionActionResultBuilder.clear();
    // Per Action in a Region.
    for (ClientProtos.Action action: regionAction.getActionList()) {
      roeBuilder.clear();
      // Return empty Result and proper index as result.
      roeBuilder.setResult(ClientProtos.Result.getDefaultInstance());
      roeBuilder.setIndex(action.getIndex());
      regionActionResultBuilder.addResultOrException(roeBuilder.build());
    }
    builder.addRegionActionResult(regionActionResultBuilder.build());
  }
  return builder.build();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:TestClientNoCluster.java

示例3: checkQuota

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Check the quota for the current (rpc-context) user. Returns the OperationQuota used to get the
 * available quota and to report the data/usage of the operation.
 * @param region the region where the operation will be performed
 * @param actions the "multi" actions to perform
 * @return the OperationQuota
 * @throws ThrottlingException if the operation cannot be executed due to quota exceeded.
 */
public OperationQuota checkQuota(final Region region, final List<ClientProtos.Action> actions)
    throws IOException, ThrottlingException {
  int numWrites = 0;
  int numReads = 0;
  for (final ClientProtos.Action action : actions) {
    if (action.hasMutation()) {
      numWrites++;
    } else if (action.hasGet()) {
      numReads++;
    }
  }
  return checkQuota(region, numWrites, numReads, 0);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:22,代码来源:RegionServerQuotaManager.java


注:本文中的org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Action方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。