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


Java ClientProtos.Result方法代码示例

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


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

示例1: toResult

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Convert a client Result to a protocol buffer Result
 *
 * @param result the client Result to convert
 * @return the converted protocol buffer Result
 */
public static ClientProtos.Result toResult(final Result result) {
  if (result.getExists() != null) {
    return toResult(result.getExists(), result.isStale());
  }

  Cell[] cells = result.rawCells();
  if (cells == null || cells.length == 0) {
    return result.isStale() ? EMPTY_RESULT_PB_STALE : EMPTY_RESULT_PB;
  }

  ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder();
  for (Cell c : cells) {
    builder.addCell(toCell(c));
  }

  builder.setStale(result.isStale());
  builder.setPartial(result.isPartial());

  return builder.build();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:ProtobufUtil.java

示例2: toResult

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Convert a client Result to a protocol buffer Result
 *
 * @param result the client Result to convert
 * @return the converted protocol buffer Result
 */
public static ClientProtos.Result toResult(final Result result) {
  if (result.getExists() != null) {
    return toResult(result.getExists(), result.isStale());
  }

  Cell[] cells = result.rawCells();
  if (cells == null || cells.length == 0) {
    return result.isStale() ? EMPTY_RESULT_PB_STALE : EMPTY_RESULT_PB;
  }

  ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder();
  for (Cell c : cells) {
    builder.addCell(toCell(c));
  }

  builder.setStale(result.isStale());

  return builder.build();
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:26,代码来源:ProtobufUtil.java

示例3: toResult

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Convert a client Result to a protocol buffer Result
 *
 * @param result the client Result to convert
 * @return the converted protocol buffer Result
 */
public static ClientProtos.Result toResult(final Result result) {
  if (result.getExists() != null) {
    return toResult(result.getExists());
  }

  Cell[] cells = result.rawCells();
  if (cells == null || cells.length == 0) {
    return EMPTY_RESULT_PB;
  }

  ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder();
  for (Cell c : cells) {
    builder.addCell(toCell(c));
  }

  return builder.build();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:24,代码来源:ProtobufUtil.java

示例4: deserialize

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
@Override
public Result deserialize(Result mutation) throws IOException {
  ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder();
  ProtobufUtil.mergeDelimitedFrom(builder, in);
  ClientProtos.Result proto = builder.build();
  return ProtobufUtil.toResult(proto);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:ResultSerialization.java

示例5: addResult

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
private void addResult(final MutateResponse.Builder builder,
    final Result result, final PayloadCarryingRpcController rpcc) {
  if (result == null) return;
  if (isClientCellBlockSupport()) {
    builder.setResult(ProtobufUtil.toResultNoData(result));
    rpcc.setCellScanner(result.cellScanner());
  } else {
    ClientProtos.Result pbr = ProtobufUtil.toResult(result);
    builder.setResult(pbr);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:RSRpcServices.java

示例6: buildActionResult

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Wrap a throwable to an action result.
 *
 * @param r
 * @return an action result builder
 */
public static ResultOrException.Builder buildActionResult(final ClientProtos.Result r,
    ClientProtos.RegionLoadStats stats) {
  ResultOrException.Builder builder = ResultOrException.newBuilder();
  if (r != null) builder.setResult(r);
  if(stats != null) builder.setLoadStats(stats);
  return builder;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:ResponseConverter.java

示例7: toResultNoData

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Convert a client Result to a protocol buffer Result.
 * The pb Result does not include the Cell data.  That is for transport otherwise.
 *
 * @param result the client Result to convert
 * @return the converted protocol buffer Result
 */
public static ClientProtos.Result toResultNoData(final Result result) {
  if (result.getExists() != null) return toResult(result.getExists(), result.isStale());
  int size = result.size();
  if (size == 0) return result.isStale() ? EMPTY_RESULT_PB_STALE : EMPTY_RESULT_PB;
  ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder();
  builder.setAssociatedCellCount(size);
  builder.setStale(result.isStale());
  return builder.build();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:ProtobufUtil.java

示例8: addResult

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
private void addResult(final MutateResponse.Builder builder,
                       final Result result, final PayloadCarryingRpcController rpcc) {
    if (result == null) return;
    if (isClientCellBlockSupport()) {
        builder.setResult(ProtobufUtil.toResultNoData(result));
        rpcc.setCellScanner(result.cellScanner());
    } else {
        ClientProtos.Result pbr = ProtobufUtil.toResult(result);
        builder.setResult(pbr);
    }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:12,代码来源:RSRpcServices.java

示例9: toResultNoData

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Convert a client Result to a protocol buffer Result.
 * The pb Result does not include the Cell data.  That is for transport otherwise.
 *
 * @param result the client Result to convert
 * @return the converted protocol buffer Result
 */
public static ClientProtos.Result toResultNoData(final Result result) {
  if (result.getExists() != null) return toResult(result.getExists());
  int size = result.size();
  if (size == 0) return EMPTY_RESULT_PB;
  ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder();
  builder.setAssociatedCellCount(size);
  return builder.build();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:16,代码来源:ProtobufUtil.java

示例10: getResultOrException

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
private static ResultOrException getResultOrException(
    final ClientProtos.Result r, final int index, final ClientProtos.RegionLoadStats stats) {
  return getResultOrException(ResponseConverter.buildActionResult(r, stats), index);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:RSRpcServices.java

示例11: deserialize

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
@Override
public Result deserialize(Result mutation) throws IOException {
  ClientProtos.Result proto = ClientProtos.Result.parseDelimitedFrom(in);
  return ProtobufUtil.toResult(proto);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:6,代码来源:ResultSerialization.java

示例12: getResultOrException

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
private static ResultOrException getResultOrException(
        final ClientProtos.Result r, final int index, final ClientProtos.RegionLoadStats stats) {
    return getResultOrException(ResponseConverter.buildActionResult(r, stats), index);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:5,代码来源:RSRpcServices.java

示例13: getResultOrException

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
private static ResultOrException getResultOrException(final ClientProtos.Result r,
    final int index) {
  return getResultOrException(ResponseConverter.buildActionResult(r), index);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:5,代码来源:HRegionServer.java

示例14: buildActionResult

import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; //导入方法依赖的package包/类
/**
 * Wrap a throwable to an action result.
 *
 * @param r
 * @return an action result builder
 */
public static ResultOrException.Builder buildActionResult(final ClientProtos.Result r) {
  ResultOrException.Builder builder = ResultOrException.newBuilder();
  if (r != null) builder.setResult(r);
  return builder;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:12,代码来源:ResponseConverter.java


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