@InterfaceAudience.Private public final class ResponseConverter extends Object
| Modifier and Type | Field and Description | 
|---|---|
static Log | 
LOG  | 
| Modifier and Type | Method and Description | 
|---|---|
static ClientProtos.ResultOrException.Builder | 
buildActionResult(ClientProtos.Result r,
                 ClientProtos.RegionLoadStats stats)
Wrap a throwable to an action result. 
 | 
static ClientProtos.ResultOrException.Builder | 
buildActionResult(Throwable t)
Wrap a throwable to an action result. 
 | 
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<HRegionInfo> regions)
A utility to build a GetOnlineRegionResponse. 
 | 
static AdminProtos.GetServerInfoResponse | 
buildGetServerInfoResponse(ServerName serverName,
                          int webuiPort)
A utility to build a GetServerInfoResponse. 
 | 
static AccessControlProtos.GetUserPermissionsResponse | 
buildGetUserPermissionsResponse(List<UserPermission> permissions)
Converts the permissions list into a protocol buffer GetUserPermissionsResponse 
 | 
static MasterProtos.RunCatalogScanResponse | 
buildRunCatalogScanResponse(int numCleaned)
Creates a response for the catalog scan request 
 | 
static List<HRegionInfo> | 
getRegionInfos(AdminProtos.GetOnlineRegionResponse proto)
Get the list of region info from a GetOnlineRegionResponse 
 | 
static RegionOpeningState | 
getRegionOpeningState(AdminProtos.OpenRegionResponse proto)
Get the region opening state from a OpenRegionResponse 
 | 
static List<RegionOpeningState> | 
getRegionOpeningStateList(AdminProtos.OpenRegionResponse proto)
Get a list of region opening state from a OpenRegionResponse 
 | 
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 boolean | 
isClosed(AdminProtos.CloseRegionResponse proto)
Check if the region is closed from a CloseRegionResponse 
 | 
static void | 
setControllerException(RpcController controller,
                      IOException ioe)
Stores an exception encountered during RPC invocation so it can be passed back
 through to the client. 
 | 
public static MultiResponse getResults(ClientProtos.MultiRequest request, ClientProtos.MultiResponse response, CellScanner cells) throws IOException
request - the protocol buffer MultiResponse to convertcells - Cells to go with the passed in proto.  Can be null.IOExceptionpublic static ClientProtos.ResultOrException.Builder buildActionResult(Throwable t)
t - public static ClientProtos.ResultOrException.Builder buildActionResult(ClientProtos.Result r, ClientProtos.RegionLoadStats stats)
r - public static HBaseProtos.NameBytesPair buildException(Throwable t)
t - public static AccessControlProtos.GetUserPermissionsResponse buildGetUserPermissionsResponse(List<UserPermission> permissions)
public static List<HRegionInfo> getRegionInfos(AdminProtos.GetOnlineRegionResponse proto)
proto - the GetOnlineRegionResponsepublic static RegionOpeningState getRegionOpeningState(AdminProtos.OpenRegionResponse proto)
proto - the OpenRegionResponsepublic static List<RegionOpeningState> getRegionOpeningStateList(AdminProtos.OpenRegionResponse proto)
proto - the OpenRegionResponsepublic 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<HRegionInfo> regions)
regions - public static MasterProtos.RunCatalogScanResponse buildRunCatalogScanResponse(int numCleaned)
public static MasterProtos.EnableCatalogJanitorResponse buildEnableCatalogJanitorResponse(boolean prevValue)
public static RegionServerStatusProtos.GetLastFlushedSequenceIdResponse buildGetLastFlushedSequenceIdResponse(ClusterStatusProtos.RegionStoreSequenceIds ids)
public static void setControllerException(RpcController controller,
                                          IOException ioe)
controller - the controller instance provided by the client when calling the serviceioe - the exception encounteredpublic static Result[] getResults(CellScanner cellScanner, ClientProtos.ScanResponse response) throws IOException
cellScanner - response - IOException