|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.monitoring.MonitoredRPCHandlerImpl
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(org.apache.hadoop.io.Writable param)
Gives this instance a reference to the Writable 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 MonitoredTask
public String getStatus()
getStatus
in interface MonitoredTask
public long getRPCQueueTime()
getRPCQueueTime
in interface MonitoredRPCHandler
public long getRPCStartTime()
getRPCStartTime
in interface MonitoredRPCHandler
public String getRPC()
getRPC
in interface MonitoredRPCHandler
public String getRPC(boolean withParams)
getRPC
in interface MonitoredRPCHandler
withParams
- toggle inclusion of parameters in the RPC String
public long getRPCPacketLength()
getRPCPacketLength
in interface MonitoredRPCHandler
public String getClient()
getClient
in interface MonitoredRPCHandler
public boolean isRPCRunning()
isRPCRunning
in interface MonitoredRPCHandler
public boolean isOperationRunning()
isOperationRunning
in interface MonitoredRPCHandler
public void setRPC(String methodName, Object[] params, long queueTime)
setRPC
in interface MonitoredRPCHandler
methodName
- 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(org.apache.hadoop.io.Writable param)
setRPCPacket
in interface MonitoredRPCHandler
param
- The Writable received by the RPC for this callpublic void setConnection(String clientAddress, int remotePort)
setConnection
in interface MonitoredRPCHandler
clientAddress
- the address of the current clientremotePort
- the port from which the client connectedpublic void markComplete(String status)
markComplete
in interface MonitoredTask
public Map<String,Object> toMap()
MonitoredTask
toMap
in interface MonitoredTask
public String toString()
public long getStartTime()
getStartTime
in interface MonitoredTask
public String getDescription()
getDescription
in interface MonitoredTask
public long getStatusTime()
getStatusTime
in interface MonitoredTask
public MonitoredTask.State getState()
getState
in interface MonitoredTask
public long getStateTime()
getStateTime
in interface MonitoredTask
public long getCompletionTimestamp()
getCompletionTimestamp
in interface MonitoredTask
public void pause(String msg)
pause
in interface MonitoredTask
public void resume(String msg)
resume
in interface MonitoredTask
public void abort(String msg)
abort
in interface MonitoredTask
public void setStatus(String status)
setStatus
in interface MonitoredTask
protected void setState(MonitoredTask.State state)
public void setDescription(String description)
setDescription
in interface MonitoredTask
public void cleanup()
MonitoredTask
cleanup
in interface MonitoredTask
public void expireNow()
expireNow
in interface MonitoredTask
public String toJSON() throws IOException
MonitoredTask
toJSON
in interface MonitoredTask
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |