Package org.apache.hadoop.hbase.ipc
Interface RpcCallContext
- All Known Subinterfaces:
RpcCall
- All Known Implementing Classes:
NettyServerCall
,ServerCall
,SimpleServerCall
Interface of all necessary to carry out a RPC service invocation on the server. This interface
focus on the information needed or obtained during the actual execution of the service method.
-
Method Summary
Modifier and TypeMethodDescriptionlong
Check if the caller who made this IPC call has disconnected.long
Get the number of block bytes scanned by the current call.Returns the TLS certificate(s) that the client presented to this HBase server when making its connection.org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo
Returns the client version info, or null if the information is not presentReturns Address of remote client in this callReturns the user credentials associated with the current RPC request or not present if no credentials were provided.Returns Current request's user name or not present if none ongoing.long
The size of response cells that have been accumulated so far.long
void
incrementBlockBytesScanned
(long blockSize) Increment the number of block bytes scanned by the current call.void
incrementResponseCellSize
(long cellSize) Add on the given amount to the retained cell size.void
incrementResponseExceptionSize
(long exceptionSize) boolean
If the client connected and specified a codec to use, then we will use this codec making cellblocks to return.boolean
void
setCallBack
(RpcCallback callback) Sets a callback which has to be executed at the end of this RPC call.
-
Method Details
-
disconnectSince
long disconnectSince()Check if the caller who made this IPC call has disconnected. If called from outside the context of IPC, this does nothing.- Returns:
- < 0 if the caller is still connected. The time in ms since the disconnection otherwise
-
isClientCellBlockSupported
boolean isClientCellBlockSupported()If the client connected and specified a codec to use, then we will use this codec making cellblocks to return. If the client did not specify a codec, we assume it does not support cellblocks and will return all content protobuf'd (though it makes our serving slower). We need to ask this question per call because a server could be hosting both clients that support cellblocks while fielding requests from clients that do not.- Returns:
- True if the client supports cellblocks, else return all content in pb
-
getRequestUser
Returns the user credentials associated with the current RPC request or not present if no credentials were provided.- Returns:
- A User
-
getRequestUserName
Returns Current request's user name or not present if none ongoing. -
getClientCertificateChain
Returns the TLS certificate(s) that the client presented to this HBase server when making its connection. TLS is orthogonal to Kerberos, so this is unrelated togetRequestUser()
. Both, one, or neither may be present. -
getRemoteAddress
Returns Address of remote client in this call -
getClientVersionInfo
org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo getClientVersionInfo()Returns the client version info, or null if the information is not present -
setCallBack
Sets a callback which has to be executed at the end of this RPC call. Such a callback is an optional one for any Rpc call. -
isRetryImmediatelySupported
boolean isRetryImmediatelySupported() -
getResponseCellSize
long getResponseCellSize()The size of response cells that have been accumulated so far. This along with the corresponding increment call is used to ensure that multi's or scans dont get too excessively large -
incrementResponseCellSize
Add on the given amount to the retained cell size. This is not thread safe and not synchronized at all. If this is used by more than one thread then everything will break. Since this is called for every row synchronization would be too onerous. -
getBlockBytesScanned
long getBlockBytesScanned()Get the number of block bytes scanned by the current call. In order to serve a response, 1 or more lower level blocks must be loaded (from disk or cache) and scanned for the requested cells. This value includes the total block size for each block loaded for the request. -
incrementBlockBytesScanned
Increment the number of block bytes scanned by the current call. SeegetBlockBytesScanned()
for details. -
getResponseExceptionSize
long getResponseExceptionSize() -
incrementResponseExceptionSize
-