@InterfaceAudience.Private public abstract class ServerCall<T extends ServerRpcConnection> extends Object implements RpcCall, RpcResponse
| Modifier and Type | Field and Description |
|---|---|
protected ByteBuffAllocator |
bbAllocator |
protected CellBlockBuilder |
cellBlockBuilder |
protected ByteBufferListOutputStream |
cellBlockStream |
protected CellScanner |
cellScanner |
protected T |
connection |
protected long |
deadline |
private long |
exceptionSize |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader |
header |
protected int |
id |
protected boolean |
isError |
protected org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor |
md |
protected org.apache.hbase.thirdparty.com.google.protobuf.Message |
param |
protected long |
receiveTime |
private AtomicInteger |
reference |
protected InetAddress |
remoteAddress |
protected RpcServer.CallCleanup |
reqCleanup |
protected BufferChain |
response
Chain of buffers to send as response.
|
private long |
responseBlockSize |
private long |
responseCellSize |
private boolean |
retryImmediatelySupported |
protected RpcCallback |
rpcCallback |
protected org.apache.hbase.thirdparty.com.google.protobuf.BlockingService |
service |
protected long |
size |
private io.opentelemetry.api.trace.Span |
span |
protected long |
startTime |
protected int |
timeout |
protected User |
user |
| Constructor and Description |
|---|
ServerCall(int id,
org.apache.hbase.thirdparty.com.google.protobuf.BlockingService service,
org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor md,
org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header,
org.apache.hbase.thirdparty.com.google.protobuf.Message param,
CellScanner cellScanner,
T connection,
long size,
InetAddress remoteAddress,
long receiveTime,
int timeout,
ByteBuffAllocator byteBuffAllocator,
CellBlockBuilder cellBlockBuilder,
RpcServer.CallCleanup reqCleanup) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Do the necessary cleanup after the call if needed.
|
private static ByteBuffer |
createHeaderAndMessageBytes(org.apache.hbase.thirdparty.com.google.protobuf.Message result,
org.apache.hbase.thirdparty.com.google.protobuf.Message header,
int totalSize,
int totalPBSize) |
(package private) static ByteBuffer |
createHeaderAndMessageBytes(org.apache.hbase.thirdparty.com.google.protobuf.Message result,
org.apache.hbase.thirdparty.com.google.protobuf.Message header,
int cellBlockSize,
List<ByteBuffer> cellBlock) |
long |
disconnectSince()
Check if the caller who made this IPC call has disconnected.
|
void |
done()
Call is done.
|
RpcCallback |
getCallBack() |
CellScanner |
getCellScanner()
Returns The CellScanner that can carry input and result payload.
|
org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo |
getClientVersionInfo()
Returns the client version info, or null if the information is not present
|
long |
getDeadline()
Return the deadline of this call.
|
org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader |
getHeader()
Returns The request header of this call.
|
org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor |
getMethod()
Returns The service method.
|
org.apache.hbase.thirdparty.com.google.protobuf.Message |
getParam()
Returns The call parameter message.
|
int |
getPriority()
Returns The Priority of this call.
|
long |
getReceiveTime()
Returns The timestamp when the call is constructed.
|
InetAddress |
getRemoteAddress()
Returns Address of remote client in this call
|
int |
getRemotePort()
Returns Port of remote address in this call
|
Optional<User> |
getRequestUser()
Returns the user credentials associated with the current RPC request or not present if no
credentials were provided.
|
BufferChain |
getResponse() |
long |
getResponseBlockSize() |
long |
getResponseCellSize()
The size of response cells that have been accumulated so far.
|
long |
getResponseExceptionSize() |
org.apache.hbase.thirdparty.com.google.protobuf.BlockingService |
getService()
Returns The service of this call.
|
long |
getSize()
Used to calculate the request call queue size.
|
long |
getStartTime()
Returns The time when the call starts to be executed.
|
int |
getTimeout()
Returns The timeout of this call.
|
void |
incrementResponseBlockSize(long blockSize) |
void |
incrementResponseCellSize(long cellSize)
Add on the given amount to the retained cell size.
|
void |
incrementResponseExceptionSize(long exSize) |
boolean |
isClientCellBlockSupported()
If the client connected and specified a codec to use, then we will use this codec making
cellblocks to return.
|
boolean |
isRetryImmediatelySupported() |
void |
releaseByWAL() |
void |
retainByWAL() |
void |
setCallBack(RpcCallback callback)
Sets a callback which has to be executed at the end of this RPC call.
|
(package private) static void |
setExceptionResponse(Throwable t,
String errorMsg,
org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.ResponseHeader.Builder headerBuilder) |
void |
setResponse(org.apache.hbase.thirdparty.com.google.protobuf.Message m,
CellScanner cells,
Throwable t,
String errorMsg)
Set the response resulting from this RPC call.
|
void |
setStartTime(long t)
Set the time when the call starts to be executed.
|
String |
toShortString()
Returns A short string format of this call without possibly lengthy params
|
String |
toString() |
protected BufferChain |
wrapWithSasl(BufferChain bc) |
private static void |
writeToCOS(org.apache.hbase.thirdparty.com.google.protobuf.Message result,
org.apache.hbase.thirdparty.com.google.protobuf.Message header,
int totalSize,
ByteBuffer pbBuf) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsendResponseIfReadygetRequestUserNameprotected final int id
protected final org.apache.hbase.thirdparty.com.google.protobuf.BlockingService service
protected final org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor md
protected final org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header
protected org.apache.hbase.thirdparty.com.google.protobuf.Message param
protected final CellScanner cellScanner
protected final T extends ServerRpcConnection connection
protected final long receiveTime
protected final int timeout
protected long startTime
protected final long deadline
protected final ByteBuffAllocator bbAllocator
protected final CellBlockBuilder cellBlockBuilder
protected BufferChain response
protected final long size
protected boolean isError
protected ByteBufferListOutputStream cellBlockStream
protected RpcServer.CallCleanup reqCleanup
protected final InetAddress remoteAddress
protected RpcCallback rpcCallback
private long responseCellSize
private long responseBlockSize
private long exceptionSize
private final boolean retryImmediatelySupported
private final AtomicInteger reference
private final io.opentelemetry.api.trace.Span span
ServerCall(int id, org.apache.hbase.thirdparty.com.google.protobuf.BlockingService service, org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor md, org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader header, org.apache.hbase.thirdparty.com.google.protobuf.Message param, CellScanner cellScanner, T connection, long size, InetAddress remoteAddress, long receiveTime, int timeout, ByteBuffAllocator byteBuffAllocator, CellBlockBuilder cellBlockBuilder, RpcServer.CallCleanup reqCleanup)
public void done()
done in interface RpcResponsepublic void cleanup()
RpcCallpublic void retainByWAL()
public void releaseByWAL()
public org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader getHeader()
RpcCallpublic int getPriority()
RpcCallgetPriority in interface RpcCallpublic String toShortString()
RpcCalltoShortString in interface RpcCallpublic void setResponse(org.apache.hbase.thirdparty.com.google.protobuf.Message m, CellScanner cells, Throwable t, String errorMsg)
RpcCallsetResponse in interface RpcCallm - The result message as response.cells - The CellScanner that possibly carries the payload.t - The error Throwable resulting from the call.errorMsg - Extra error message.static void setExceptionResponse(Throwable t, String errorMsg, org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.ResponseHeader.Builder headerBuilder)
static ByteBuffer createHeaderAndMessageBytes(org.apache.hbase.thirdparty.com.google.protobuf.Message result, org.apache.hbase.thirdparty.com.google.protobuf.Message header, int cellBlockSize, List<ByteBuffer> cellBlock) throws IOException
IOExceptionprivate static void writeToCOS(org.apache.hbase.thirdparty.com.google.protobuf.Message result, org.apache.hbase.thirdparty.com.google.protobuf.Message header, int totalSize, ByteBuffer pbBuf) throws IOException
IOExceptionprivate static ByteBuffer createHeaderAndMessageBytes(org.apache.hbase.thirdparty.com.google.protobuf.Message result, org.apache.hbase.thirdparty.com.google.protobuf.Message header, int totalSize, int totalPBSize) throws IOException
IOExceptionprotected BufferChain wrapWithSasl(BufferChain bc) throws IOException
IOExceptionpublic long disconnectSince()
RpcCallContextdisconnectSince in interface RpcCallContextpublic boolean isClientCellBlockSupported()
RpcCallContextisClientCellBlockSupported in interface RpcCallContextpublic long getResponseCellSize()
RpcCallContextgetResponseCellSize in interface RpcCallContextpublic void incrementResponseCellSize(long cellSize)
RpcCallContextincrementResponseCellSize in interface RpcCallContextpublic long getResponseBlockSize()
getResponseBlockSize in interface RpcCallContextpublic void incrementResponseBlockSize(long blockSize)
incrementResponseBlockSize in interface RpcCallContextpublic long getResponseExceptionSize()
getResponseExceptionSize in interface RpcCallContextpublic void incrementResponseExceptionSize(long exSize)
incrementResponseExceptionSize in interface RpcCallContextpublic long getSize()
RpcCallpublic long getDeadline()
RpcCallgetDeadline in interface RpcCallpublic Optional<User> getRequestUser()
RpcCallContextgetRequestUser in interface RpcCallContextpublic InetAddress getRemoteAddress()
RpcCallContextgetRemoteAddress in interface RpcCallContextpublic org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo getClientVersionInfo()
RpcCallContextgetClientVersionInfo in interface RpcCallContextpublic void setCallBack(RpcCallback callback)
RpcCallContextsetCallBack in interface RpcCallContextpublic boolean isRetryImmediatelySupported()
isRetryImmediatelySupported in interface RpcCallContextpublic org.apache.hbase.thirdparty.com.google.protobuf.BlockingService getService()
RpcCallgetService in interface RpcCallpublic org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor getMethod()
RpcCallpublic org.apache.hbase.thirdparty.com.google.protobuf.Message getParam()
RpcCallpublic CellScanner getCellScanner()
RpcCallgetCellScanner in interface RpcCallpublic long getReceiveTime()
RpcCallgetReceiveTime in interface RpcCallpublic long getStartTime()
RpcCallgetStartTime in interface RpcCallpublic void setStartTime(long t)
RpcCallsetStartTime in interface RpcCallpublic int getTimeout()
RpcCallgetTimeout in interface RpcCallpublic int getRemotePort()
RpcCallgetRemotePort in interface RpcCallpublic BufferChain getResponse()
getResponse in interface RpcResponsepublic RpcCallback getCallBack()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.