本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.ResponseConverter.getResults方法的典型用法代码示例。如果您正苦于以下问题:Java ResponseConverter.getResults方法的具体用法?Java ResponseConverter.getResults怎么用?Java ResponseConverter.getResults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.protobuf.ResponseConverter
的用法示例。
在下文中一共展示了ResponseConverter.getResults方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import org.apache.hadoop.hbase.protobuf.ResponseConverter; //导入方法依赖的package包/类
@Override
public Result[] call(int timeout) throws IOException {
if (this.closed) return null;
if (Thread.interrupted()) {
throw new InterruptedIOException();
}
ScanRequest request = RequestConverter.buildScanRequest(getLocation()
.getRegionInfo().getRegionName(), getScan(), getCaching(), true);
ScanResponse response = null;
PayloadCarryingRpcController controller = controllerFactory.newController();
try {
controller.setPriority(getTableName());
controller.setCallTimeout(timeout);
response = getStub().scan(controller, request);
return ResponseConverter.getResults(controller.cellScanner(),
response);
} catch (ServiceException se) {
throw ProtobufUtil.getRemoteException(se);
}
}
示例2: getSmallScanCallable
import org.apache.hadoop.hbase.protobuf.ResponseConverter; //导入方法依赖的package包/类
static RegionServerCallable<Result[]> getSmallScanCallable(
final Scan sc, HConnection connection, TableName table, byte[] localStartKey,
final int cacheNum, final RpcControllerFactory rpcControllerFactory) throws IOException {
sc.setStartRow(localStartKey);
RegionServerCallable<Result[]> callable = new RegionServerCallable<Result[]>(
connection, table, sc.getStartRow()) {
public Result[] call() throws IOException {
ScanRequest request = RequestConverter.buildScanRequest(getLocation()
.getRegionInfo().getRegionName(), sc, cacheNum, true);
ScanResponse response = null;
PayloadCarryingRpcController controller = rpcControllerFactory.newController();
try {
controller.setPriority(getTableName());
response = getStub().scan(controller, request);
return ResponseConverter.getResults(controller.cellScanner(),
response);
} catch (ServiceException se) {
throw ProtobufUtil.getRemoteException(se);
}
}
};
return callable;
}
示例3: getSmallScanCallable
import org.apache.hadoop.hbase.protobuf.ResponseConverter; //导入方法依赖的package包/类
static RegionServerCallable<Result[]> getSmallScanCallable(
final Scan sc, HConnection connection, TableName table,
byte[] localStartKey, final int cacheNum, final RpcControllerFactory rpcControllerFactory) {
sc.setStartRow(localStartKey);
RegionServerCallable<Result[]> callable = new RegionServerCallable<Result[]>(
connection, table, sc.getStartRow()) {
public Result[] call(int callTimeout) throws IOException {
ScanRequest request = RequestConverter.buildScanRequest(getLocation()
.getRegionInfo().getRegionName(), sc, cacheNum, true);
PayloadCarryingRpcController controller = rpcControllerFactory.newController();
controller.setPriority(getTableName());
controller.setCallTimeout(callTimeout);
try {
ScanResponse response = getStub().scan(controller, request);
return ResponseConverter.getResults(controller.cellScanner(), response);
} catch (ServiceException se) {
throw ProtobufUtil.getRemoteException(se);
}
}
};
return callable;
}
示例4: getSmallScanCallable
import org.apache.hadoop.hbase.protobuf.ResponseConverter; //导入方法依赖的package包/类
private RegionServerCallable<Result[]> getSmallScanCallable(
byte[] localStartKey, final int cacheNum) {
this.scan.setStartRow(localStartKey);
RegionServerCallable<Result[]> callable = new RegionServerCallable<Result[]>(
getConnection(), getTable(), scan.getStartRow()) {
public Result[] call() throws IOException {
ScanRequest request = RequestConverter.buildScanRequest(getLocation()
.getRegionInfo().getRegionName(), scan, cacheNum, true);
ScanResponse response = null;
PayloadCarryingRpcController controller = new PayloadCarryingRpcController();
try {
controller.setPriority(getTableName());
response = getStub().scan(controller, request);
return ResponseConverter.getResults(controller.cellScanner(),
response);
} catch (ServiceException se) {
throw ProtobufUtil.getRemoteException(se);
}
}
};
return callable;
}
示例5: call
import org.apache.hadoop.hbase.protobuf.ResponseConverter; //导入方法依赖的package包/类
@Override
public Result[] call(int timeout) throws IOException {
if (this.closed) return null;
if (Thread.interrupted()) {
throw new InterruptedIOException();
}
ScanRequest request = RequestConverter.buildScanRequest(getLocation()
.getRegionInfo().getRegionName(), getScan(), getCaching(), true);
ScanResponse response = null;
controller = controllerFactory.newController();
try {
controller.setPriority(getTableName());
controller.setCallTimeout(timeout);
response = getStub().scan(controller, request);
Result[] results = ResponseConverter.getResults(controller.cellScanner(),
response);
if (response.hasMoreResultsInRegion()) {
setHasMoreResultsContext(true);
setServerHasMoreResults(response.getMoreResultsInRegion());
} else {
setHasMoreResultsContext(false);
}
// We need to update result metrics since we are overriding call()
updateResultsMetrics(results);
return results;
} catch (ServiceException se) {
throw ProtobufUtil.getRemoteException(se);
}
}