本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
}
示例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;
}
示例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();
}
示例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);
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}