|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.monitoring.MonitoredRPCHandlerImpl
@InterfaceAudience.Private public class MonitoredRPCHandlerImpl
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 |
| Field Summary | |
|---|---|
protected MonitoredTask.State |
state
|
| Constructor Summary | |
|---|---|
MonitoredRPCHandlerImpl()
|
|
| Method Summary | |
|---|---|
void |
abort(String msg)
|
void |
cleanup()
Explicitly mark this status as able to be cleaned up, even though it might not be complete. |
MonitoredRPCHandlerImpl |
clone()
Public exposure of Object.clone() in order to allow clients to easily capture current state. |
void |
expireNow()
Force the completion timestamp backwards so that it expires now. |
String |
getClient()
If an RPC call is currently running, produces a String representation of the connection from which it was received. |
long |
getCompletionTimestamp()
|
String |
getDescription()
|
String |
getRPC()
Produces a string representation of the method currently being serviced by this Handler. |
String |
getRPC(boolean withParams)
Produces a string representation of the method currently being serviced by this Handler. |
long |
getRPCPacketLength()
Produces a string representation of the method currently being serviced by this Handler. |
long |
getRPCQueueTime()
Accesses the queue time for the currently running RPC on the monitored Handler. |
long |
getRPCStartTime()
Accesses the start time for the currently running RPC on the monitored Handler. |
long |
getStartTime()
|
MonitoredTask.State |
getState()
|
long |
getStateTime()
|
String |
getStatus()
Gets the status of this handler; if it is currently servicing an RPC, this status will include the RPC information. |
long |
getStatusTime()
|
boolean |
isOperationRunning()
Indicates to the client whether this task is monitoring a currently active RPC call to a database command. |
boolean |
isRPCRunning()
Indicates to the client whether this task is monitoring a currently active RPC call. |
void |
markComplete(String status)
|
void |
pause(String msg)
|
void |
resume(String msg)
|
void |
setConnection(String clientAddress,
int remotePort)
Registers current handler client details. |
void |
setDescription(String description)
|
void |
setRPC(String methodName,
Object[] params,
long queueTime)
Tells this instance that it is monitoring a new RPC call. |
void |
setRPCPacket(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. |
protected void |
setState(MonitoredTask.State state)
|
void |
setStatus(String status)
|
String |
toJSON()
Creates a JSON object for parseable exposure of monitored tasks. |
Map<String,Object> |
toMap()
Creates a string map of internal details for extensible exposure of monitored tasks. |
String |
toString()
|
| 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, getStatusTime, pause, resume, setDescription, setStatus, toJSON |
| Field Detail |
|---|
protected volatile MonitoredTask.State state
| Constructor Detail |
|---|
public MonitoredRPCHandlerImpl()
| Method Detail |
|---|
public MonitoredRPCHandlerImpl clone()
MonitoredTask
clone in interface MonitoredTaskpublic String getStatus()
getStatus in interface MonitoredTaskpublic long getRPCQueueTime()
getRPCQueueTime in interface MonitoredRPCHandlerpublic long getRPCStartTime()
getRPCStartTime in interface MonitoredRPCHandlerpublic String getRPC()
getRPC in interface MonitoredRPCHandlerpublic String getRPC(boolean withParams)
getRPC in interface MonitoredRPCHandlerwithParams - toggle inclusion of parameters in the RPC String
public long getRPCPacketLength()
getRPCPacketLength in interface MonitoredRPCHandlerpublic String getClient()
getClient in interface MonitoredRPCHandlerpublic boolean isRPCRunning()
isRPCRunning in interface MonitoredRPCHandlerpublic boolean isOperationRunning()
isOperationRunning in interface MonitoredRPCHandler
public void setRPC(String methodName,
Object[] params,
long queueTime)
setRPC in interface MonitoredRPCHandlermethodName - The name of the method that will be called by the RPC.params - The parameters that will be passed to the indicated method.public void setRPCPacket(com.google.protobuf.Message param)
setRPCPacket in interface MonitoredRPCHandlerparam - The protobuf received by the RPC for this call
public void setConnection(String clientAddress,
int remotePort)
setConnection in interface MonitoredRPCHandlerclientAddress - the address of the current clientremotePort - the port from which the client connectedpublic void markComplete(String status)
markComplete in interface MonitoredTaskpublic Map<String,Object> toMap()
MonitoredTask
toMap in interface MonitoredTaskpublic String toString()
public long getStartTime()
getStartTime in interface MonitoredTaskpublic String getDescription()
getDescription in interface MonitoredTaskpublic long getStatusTime()
getStatusTime in interface MonitoredTaskpublic MonitoredTask.State getState()
getState in interface MonitoredTaskpublic long getStateTime()
getStateTime in interface MonitoredTaskpublic long getCompletionTimestamp()
getCompletionTimestamp in interface MonitoredTaskpublic void pause(String msg)
pause in interface MonitoredTaskpublic void resume(String msg)
resume in interface MonitoredTaskpublic void abort(String msg)
abort in interface MonitoredTaskpublic void setStatus(String status)
setStatus in interface MonitoredTaskprotected void setState(MonitoredTask.State state)
public void setDescription(String description)
setDescription in interface MonitoredTaskpublic void cleanup()
MonitoredTask
cleanup in interface MonitoredTaskpublic void expireNow()
expireNow in interface MonitoredTask
public String toJSON()
throws IOException
MonitoredTask
toJSON in interface MonitoredTaskIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||