Package org.apache.zookeeper.server
Class ConnectionBean
java.lang.Object
org.apache.zookeeper.server.ConnectionBean
- All Implemented Interfaces:
ZKMBeanInfo
,ConnectionMXBean
Implementation of connection MBean interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Average latency in msString[]
Last cxid of this connectionlong
Latency of last response to client on this connection in msLast operation performed by this connectionLast time server sent a response to client on this connectionLast zxid of this connectionlong
Max latency in mslong
Min latency in msgetName()
long
long
long
int
boolean
isHidden()
If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools.void
Reset countersvoid
Terminate thei client connection.void
Terminate this client session.toString()
-
Constructor Details
-
ConnectionBean
-
-
Method Details
-
getSessionId
- Specified by:
getSessionId
in interfaceConnectionMXBean
- Returns:
- client's session id
-
getSourceIP
- Specified by:
getSourceIP
in interfaceConnectionMXBean
- Returns:
- source (client) IP address
-
getName
- Specified by:
getName
in interfaceZKMBeanInfo
- Returns:
- a string identifying the MBean
-
isHidden
public boolean isHidden()Description copied from interface:ZKMBeanInfo
If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools. Used for grouping MBeans.- Specified by:
isHidden
in interfaceZKMBeanInfo
- Returns:
- true if the MBean is hidden.
-
getEphemeralNodes
- Specified by:
getEphemeralNodes
in interfaceConnectionMXBean
- Returns:
- number of ephemeral nodes owned by this connection
-
getStartedTime
- Specified by:
getStartedTime
in interfaceConnectionMXBean
- Returns:
- time the connection was started
-
terminateSession
public void terminateSession()Description copied from interface:ConnectionMXBean
Terminate this client session. The client will reconnect with a different session id.- Specified by:
terminateSession
in interfaceConnectionMXBean
-
terminateConnection
public void terminateConnection()Description copied from interface:ConnectionMXBean
Terminate thei client connection. The client will immediately attempt to reconnect with the same session id.- Specified by:
terminateConnection
in interfaceConnectionMXBean
-
resetCounters
public void resetCounters()Description copied from interface:ConnectionMXBean
Reset counters- Specified by:
resetCounters
in interfaceConnectionMXBean
-
toString
-
getOutstandingRequests
public long getOutstandingRequests()- Specified by:
getOutstandingRequests
in interfaceConnectionMXBean
- Returns:
- number of requets being processed
-
getPacketsReceived
public long getPacketsReceived()- Specified by:
getPacketsReceived
in interfaceConnectionMXBean
- Returns:
- packets received from this client
-
getPacketsSent
public long getPacketsSent()- Specified by:
getPacketsSent
in interfaceConnectionMXBean
- Returns:
- number of packets sent to this client
-
getSessionTimeout
public int getSessionTimeout()- Specified by:
getSessionTimeout
in interfaceConnectionMXBean
- Returns:
- session timeout in ms
-
getMinLatency
public long getMinLatency()Description copied from interface:ConnectionMXBean
Min latency in ms- Specified by:
getMinLatency
in interfaceConnectionMXBean
-
getAvgLatency
public long getAvgLatency()Description copied from interface:ConnectionMXBean
Average latency in ms- Specified by:
getAvgLatency
in interfaceConnectionMXBean
-
getMaxLatency
public long getMaxLatency()Description copied from interface:ConnectionMXBean
Max latency in ms- Specified by:
getMaxLatency
in interfaceConnectionMXBean
-
getLastOperation
Description copied from interface:ConnectionMXBean
Last operation performed by this connection- Specified by:
getLastOperation
in interfaceConnectionMXBean
-
getLastCxid
Description copied from interface:ConnectionMXBean
Last cxid of this connection- Specified by:
getLastCxid
in interfaceConnectionMXBean
-
getLastZxid
Description copied from interface:ConnectionMXBean
Last zxid of this connection- Specified by:
getLastZxid
in interfaceConnectionMXBean
-
getLastResponseTime
Description copied from interface:ConnectionMXBean
Last time server sent a response to client on this connection- Specified by:
getLastResponseTime
in interfaceConnectionMXBean
-
getLastLatency
public long getLastLatency()Description copied from interface:ConnectionMXBean
Latency of last response to client on this connection in ms- Specified by:
getLastLatency
in interfaceConnectionMXBean
-