@InterfaceAudience.Private public class MonitoredRPCHandlerImpl extends Object implements MonitoredRPCHandler
MonitoredTask.State, MonitoredTask.StatusJournalEntry
Modifier and Type | Field and Description |
---|---|
protected MonitoredTask.State |
state |
Constructor and Description |
---|
MonitoredRPCHandlerImpl() |
Modifier and Type | Method and Description |
---|---|
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 |
disableStatusJournal() |
void |
enableStatusJournal(boolean includeCurrentStatus)
Enables journaling of this monitored task, the first invocation will lazily initialize the
journal.
|
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.
|
List<MonitoredTask.StatusJournalEntry> |
getStatusJournal()
Returns the status journal.
|
long |
getStatusTime() |
long |
getWarnTime() |
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) |
String |
prettyPrintJournal() |
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) |
void |
setWarnTime(long t) |
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() |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
abort, cleanup, disableStatusJournal, enableStatusJournal, expireNow, getCompletionTimestamp, getDescription, getStartTime, getState, getStateTime, getStatusJournal, getStatusTime, getWarnTime, pause, prettyPrintJournal, resume, setDescription, setStatus, setWarnTime, toJSON
protected volatile MonitoredTask.State state
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 Stringpublic 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(com.google.protobuf.Message param)
setRPCPacket
in interface MonitoredRPCHandler
param
- The protobuf 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 getWarnTime()
getWarnTime
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 setWarnTime(long t)
setWarnTime
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
public List<MonitoredTask.StatusJournalEntry> getStatusJournal()
getStatusJournal
in interface MonitoredTask
public void enableStatusJournal(boolean includeCurrentStatus)
enableStatusJournal
in interface MonitoredTask
includeCurrentStatus
- whether to include the current set status in the journalpublic void disableStatusJournal()
disableStatusJournal
in interface MonitoredTask
public String prettyPrintJournal()
prettyPrintJournal
in interface MonitoredTask
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.