Class MonitoredRPCHandlerImpl
java.lang.Object
org.apache.hadoop.hbase.monitoring.MonitoredTaskImpl
org.apache.hadoop.hbase.monitoring.MonitoredRPCHandlerImpl
- All Implemented Interfaces:
Cloneable,MonitoredRPCHandler,MonitoredTask
@Private
public class MonitoredRPCHandlerImpl
extends MonitoredTaskImpl
implements MonitoredRPCHandler
A MonitoredTask implementation designed for use with RPC Handlers handling frequent, short
duration tasks. String concatenations and object allocations are avoided in methods that will be
hit by every RPC call.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.monitoring.MonitoredTask
MonitoredTask.State, MonitoredTask.StatusJournalEntry -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate org.apache.hbase.thirdparty.com.google.protobuf.Messageprivate Object[]private intprivate longprivate longprivate booleanFields inherited from class org.apache.hadoop.hbase.monitoring.MonitoredTaskImpl
state -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Public exposure of Object.clone() in order to allow clients to easily capture current state.If an RPC call is currently running, produces a String representation of the connection from which it was received.getRPC()Produces a string representation of the method currently being serviced by this Handler.getRPC(boolean withParams) Produces a string representation of the method currently being serviced by this Handler.longProduces a string representation of the method currently being serviced by this Handler.longAccesses the queue time for the currently running RPC on the monitored Handler.longAccesses the start time for the currently running RPC on the monitored Handler.Gets the status of this handler; if it is currently servicing an RPC, this status will include the RPC information.booleanIndicates to the client whether this task is monitoring a currently active RPC call to a database command.booleanIndicates to the client whether this task is monitoring a currently active RPC call.voidmarkComplete(String status) voidsetConnection(String clientAddress, int remotePort) Registers current handler client details.voidTells this instance that it is monitoring a new RPC call.voidsetRPCPacket(org.apache.hbase.thirdparty.com.google.protobuf.Message param) Gives this instance a reference to the protobuf received by the RPC, so that it can later compute its size if asked for it.toMap()Creates a string map of internal details for extensible exposure of monitored tasks.toString()Methods inherited from class org.apache.hadoop.hbase.monitoring.MonitoredTaskImpl
abort, cleanup, expireNow, getCompletionTimestamp, getDescription, getStartTime, getState, getStateTime, getStatusJournal, getStatusTime, getWarnTime, pause, prettyPrintJournal, resume, setDescription, setState, setStatus, setWarnTime, toJSONMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.monitoring.MonitoredTask
abort, cleanup, expireNow, getCompletionTimestamp, getDescription, getStartTime, getState, getStateTime, getStatusJournal, getStatusTime, getWarnTime, pause, prettyPrintJournal, resume, setDescription, setStatus, setWarnTime, toJSON
-
Field Details
-
clientAddress
-
remotePort
-
rpcQueueTime
-
rpcStartTime
-
methodName
-
params
-
packet
-
snapshot
-
callInfoMap
-
-
Constructor Details
-
MonitoredRPCHandlerImpl
-
-
Method Details
-
clone
Description copied from interface:MonitoredTaskPublic exposure of Object.clone() in order to allow clients to easily capture current state.- Specified by:
clonein interfaceMonitoredTask- Overrides:
clonein classMonitoredTaskImpl- Returns:
- a copy of the object whose references will not change
-
getStatus
Gets the status of this handler; if it is currently servicing an RPC, this status will include the RPC information.- Specified by:
getStatusin interfaceMonitoredTask- Overrides:
getStatusin classMonitoredTaskImpl- Returns:
- a String describing the current status.
-
getRPCQueueTime
Accesses the queue time for the currently running RPC on the monitored Handler.- Specified by:
getRPCQueueTimein interfaceMonitoredRPCHandler- Returns:
- the queue timestamp or -1 if there is no RPC currently running.
-
getRPCStartTime
Accesses the start time for the currently running RPC on the monitored Handler.- Specified by:
getRPCStartTimein interfaceMonitoredRPCHandler- Returns:
- the start timestamp or -1 if there is no RPC currently running.
-
getRPC
Produces a string representation of the method currently being serviced by this Handler.- Specified by:
getRPCin interfaceMonitoredRPCHandler- Returns:
- a string representing the method call without parameters
-
getRPC
Produces a string representation of the method currently being serviced by this Handler.- Specified by:
getRPCin interfaceMonitoredRPCHandler- Parameters:
withParams- toggle inclusion of parameters in the RPC String- Returns:
- A human-readable string representation of the method call.
-
getRPCPacketLength
Produces a string representation of the method currently being serviced by this Handler.- Specified by:
getRPCPacketLengthin interfaceMonitoredRPCHandler- Returns:
- A human-readable string representation of the method call.
-
getClient
If an RPC call is currently running, produces a String representation of the connection from which it was received.- Specified by:
getClientin interfaceMonitoredRPCHandler- Returns:
- A human-readable string representation of the address and port of the client.
-
isRPCRunning
Indicates to the client whether this task is monitoring a currently active RPC call.- Specified by:
isRPCRunningin interfaceMonitoredRPCHandler- Returns:
- true if the monitored handler is currently servicing an RPC call.
-
isOperationRunning
Indicates to the client whether this task is monitoring a currently active RPC call to a database command. (as defined by o.a.h.h.client.Operation)- Specified by:
isOperationRunningin interfaceMonitoredRPCHandler- Returns:
- true if the monitored handler is currently servicing an RPC call to a database command.
-
setRPC
Tells this instance that it is monitoring a new RPC call.- Specified by:
setRPCin interfaceMonitoredRPCHandler- Parameters:
methodName- The name of the method that will be called by the RPC.params- The parameters that will be passed to the indicated method.
-
setRPCPacket
Gives this instance a reference to the protobuf received by the RPC, so that it can later compute its size if asked for it.- Specified by:
setRPCPacketin interfaceMonitoredRPCHandler- Parameters:
param- The protobuf received by the RPC for this call
-
setConnection
Registers current handler client details.- Specified by:
setConnectionin interfaceMonitoredRPCHandler- Parameters:
clientAddress- the address of the current clientremotePort- the port from which the client connected
-
markComplete
- Specified by:
markCompletein interfaceMonitoredTask- Overrides:
markCompletein classMonitoredTaskImpl
-
toMap
Description copied from interface:MonitoredTaskCreates a string map of internal details for extensible exposure of monitored tasks.- Specified by:
toMapin interfaceMonitoredTask- Overrides:
toMapin classMonitoredTaskImpl- Returns:
- A Map containing information for this task.
-
generateCallInfoMap
-
toString
- Overrides:
toStringin classMonitoredTaskImpl
-