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
Modifier and TypeFieldDescriptionprivate String
private String
private org.apache.hbase.thirdparty.com.google.protobuf.Message
private Object[]
private int
private long
private long
private boolean
Fields inherited from class org.apache.hadoop.hbase.monitoring.MonitoredTaskImpl
state
-
Constructor Summary
-
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.long
Produces a string representation of the method currently being serviced by this Handler.long
Accesses the queue time for the currently running RPC on the monitored Handler.long
Accesses 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.boolean
Indicates to the client whether this task is monitoring a currently active RPC call to a database command.boolean
Indicates to the client whether this task is monitoring a currently active RPC call.void
markComplete
(String status) void
setConnection
(String clientAddress, int remotePort) Registers current handler client details.void
Tells this instance that it is monitoring a new RPC call.void
setRPCPacket
(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, toJSON
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:MonitoredTask
Public exposure of Object.clone() in order to allow clients to easily capture current state.- Specified by:
clone
in interfaceMonitoredTask
- Overrides:
clone
in 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:
getStatus
in interfaceMonitoredTask
- Overrides:
getStatus
in classMonitoredTaskImpl
- Returns:
- a String describing the current status.
-
getRPCQueueTime
Accesses the queue time for the currently running RPC on the monitored Handler.- Specified by:
getRPCQueueTime
in 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:
getRPCStartTime
in 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:
getRPC
in 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:
getRPC
in 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:
getRPCPacketLength
in 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:
getClient
in 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:
isRPCRunning
in 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:
isOperationRunning
in 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:
setRPC
in 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:
setRPCPacket
in interfaceMonitoredRPCHandler
- Parameters:
param
- The protobuf received by the RPC for this call
-
setConnection
Registers current handler client details.- Specified by:
setConnection
in interfaceMonitoredRPCHandler
- Parameters:
clientAddress
- the address of the current clientremotePort
- the port from which the client connected
-
markComplete
- Specified by:
markComplete
in interfaceMonitoredTask
- Overrides:
markComplete
in classMonitoredTaskImpl
-
toMap
Description copied from interface:MonitoredTask
Creates a string map of internal details for extensible exposure of monitored tasks.- Specified by:
toMap
in interfaceMonitoredTask
- Overrides:
toMap
in classMonitoredTaskImpl
- Returns:
- A Map containing information for this task.
-
generateCallInfoMap
-
toString
- Overrides:
toString
in classMonitoredTaskImpl
-