@InterfaceAudience.Private public final class ResponseConverter extends Object
Modifier and Type | Method and Description |
---|---|
static ClientProtos.ResultOrException.Builder |
buildActionResult(ClientProtos.Result r)
Wrap a throwable to an action result.
|
static ClientProtos.ResultOrException.Builder |
buildActionResult(Throwable t)
Wrap a throwable to an action result.
|
static AdminProtos.ClearRegionBlockCacheResponse |
buildClearRegionBlockCacheResponse(HBaseProtos.CacheEvictionStats cacheEvictionStats)
Creates a protocol buffer ClearRegionBlockCacheResponse
|
static MasterProtos.EnableCatalogJanitorResponse |
buildEnableCatalogJanitorResponse(boolean prevValue)
Creates a response for the catalog scan request
|
static HBaseProtos.NameBytesPair |
buildException(Throwable t) |
static RegionServerStatusProtos.GetLastFlushedSequenceIdResponse |
buildGetLastFlushedSequenceIdResponse(ClusterStatusProtos.RegionStoreSequenceIds ids)
Creates a response for the last flushed sequence Id request
|
static AdminProtos.GetOnlineRegionResponse |
buildGetOnlineRegionResponse(List<RegionInfo> regions)
A utility to build a GetOnlineRegionResponse.
|
static AdminProtos.GetServerInfoResponse |
buildGetServerInfoResponse(ServerName serverName,
int webuiPort)
A utility to build a GetServerInfoResponse.
|
static MasterProtos.RunCatalogScanResponse |
buildRunCatalogScanResponse(int numCleaned)
Creates a response for the catalog scan request
|
static MasterProtos.RunCleanerChoreResponse |
buildRunCleanerChoreResponse(boolean ran)
Creates a response for the cleaner chore request
|
static IOException |
getControllerException(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller)
Retreivies exception stored during RPC invocation.
|
static List<RegionInfo> |
getRegionInfos(AdminProtos.GetOnlineRegionResponse proto)
Get the list of region info from a GetOnlineRegionResponse
|
static SingleResponse |
getResult(ClientProtos.MutateRequest request,
ClientProtos.MutateResponse response,
CellScanner cells) |
static Result[] |
getResults(CellScanner cellScanner,
ClientProtos.ScanResponse response)
Create Results from the cells using the cells meta data.
|
static MultiResponse |
getResults(ClientProtos.MultiRequest request,
ClientProtos.MultiResponse response,
CellScanner cells)
Get the results from a protocol buffer MultiResponse
|
static MultiResponse |
getResults(ClientProtos.MultiRequest request,
Map<Integer,Integer> rowMutationsIndexMap,
ClientProtos.MultiResponse response,
CellScanner cells)
Get the results from a protocol buffer MultiResponse
|
static Map<String,Long> |
getScanMetrics(ClientProtos.ScanResponse response) |
static boolean |
isClosed(AdminProtos.CloseRegionResponse proto)
Check if the region is closed from a CloseRegionResponse
|
static void |
setControllerException(com.google.protobuf.RpcController controller,
IOException ioe)
Stores an exception encountered during RPC invocation so it can be passed back
through to the client.
|
public static SingleResponse getResult(ClientProtos.MutateRequest request, ClientProtos.MutateResponse response, CellScanner cells) throws IOException
IOException
public static MultiResponse getResults(ClientProtos.MultiRequest request, ClientProtos.MultiResponse response, CellScanner cells) throws IOException
request
- the original protocol buffer MultiRequestresponse
- the protocol buffer MultiResponse to convertcells
- Cells to go with the passed in proto
. Can be null.IOException
public static MultiResponse getResults(ClientProtos.MultiRequest request, Map<Integer,Integer> rowMutationsIndexMap, ClientProtos.MultiResponse response, CellScanner cells) throws IOException
request
- the original protocol buffer MultiRequestrowMutationsIndexMap
- Used to support RowMutations in batchresponse
- the protocol buffer MultiResponse to convertcells
- Cells to go with the passed in proto
. Can be null.IOException
public static ClientProtos.ResultOrException.Builder buildActionResult(Throwable t)
t
- public static ClientProtos.ResultOrException.Builder buildActionResult(ClientProtos.Result r)
r
- public static HBaseProtos.NameBytesPair buildException(Throwable t)
t
- public static List<RegionInfo> getRegionInfos(AdminProtos.GetOnlineRegionResponse proto)
proto
- the GetOnlineRegionResponsepublic static boolean isClosed(AdminProtos.CloseRegionResponse proto)
proto
- the CloseRegionResponsepublic static AdminProtos.GetServerInfoResponse buildGetServerInfoResponse(ServerName serverName, int webuiPort)
serverName
- webuiPort
- public static AdminProtos.GetOnlineRegionResponse buildGetOnlineRegionResponse(List<RegionInfo> regions)
regions
- public static MasterProtos.RunCatalogScanResponse buildRunCatalogScanResponse(int numCleaned)
public static MasterProtos.EnableCatalogJanitorResponse buildEnableCatalogJanitorResponse(boolean prevValue)
public static MasterProtos.RunCleanerChoreResponse buildRunCleanerChoreResponse(boolean ran)
public static RegionServerStatusProtos.GetLastFlushedSequenceIdResponse buildGetLastFlushedSequenceIdResponse(ClusterStatusProtos.RegionStoreSequenceIds ids)
public static void setControllerException(com.google.protobuf.RpcController controller, IOException ioe)
controller
- the controller instance provided by the client when calling the serviceioe
- the exception encountered@Nullable public static IOException getControllerException(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller) throws IOException
controller
- the controller instance provided by the client when calling the serviceIOException
public static Result[] getResults(CellScanner cellScanner, ClientProtos.ScanResponse response) throws IOException
cellScanner
- response
- IOException
public static Map<String,Long> getScanMetrics(ClientProtos.ScanResponse response)
public static AdminProtos.ClearRegionBlockCacheResponse buildClearRegionBlockCacheResponse(HBaseProtos.CacheEvictionStats cacheEvictionStats)
Copyright © 2007–2019 Cloudera. All rights reserved.