org.apache.zookeeper.server
Class NIOServerCnxn
java.lang.Object
org.apache.zookeeper.server.ServerCnxn
org.apache.zookeeper.server.NIOServerCnxn
- All Implemented Interfaces:
- Watcher
public class NIOServerCnxn
- extends ServerCnxn
This class handles communication with clients using NIO. There is one per
client, but only one thread doing the communication.
| Fields inherited from class org.apache.zookeeper.server.ServerCnxn |
authInfo, cmd2String, confCmd, consCmd, count, crstCmd, dumpCmd, enviCmd, established, getTraceMaskCmd, isroCmd, lastCxid, lastLatency, lastOp, lastResponseTime, lastZxid, maxLatency, me, minLatency, mntrCmd, packetsReceived, packetsSent, ruokCmd, setTraceMaskCmd, srstCmd, srvrCmd, statCmd, totalLatency, wchcCmd, wchpCmd, wchsCmd, zooKeeperSaslServer |
| Methods inherited from class org.apache.zookeeper.server.ServerCnxn |
addAuthInfo, dumpConnectionInfo, getAuthInfo, getAvgLatency, getEstablished, getLastCxid, getLastLatency, getLastOperation, getLastResponseTime, getLastZxid, getMaxLatency, getMinLatency, getPacketsReceived, getPacketsSent, incrPacketsReceived, incrPacketsSent, packetReceived, packetSent, removeAuthInfo, resetStats, updateStatsForResponse |
NIOServerCnxn
public NIOServerCnxn(ZooKeeperServer zk,
SocketChannel sock,
SelectionKey sk,
NIOServerCnxnFactory factory)
throws IOException
- Throws:
IOException
sendCloseSession
public void sendCloseSession()
sendBuffer
public void sendBuffer(ByteBuffer bb)
incrOutstandingRequests
protected void incrOutstandingRequests(RequestHeader h)
- Overrides:
incrOutstandingRequests in class ServerCnxn
disableRecv
public void disableRecv()
enableRecv
public void enableRecv()
getOutstandingRequests
public long getOutstandingRequests()
- The number of requests that have been submitted but not yet
responded to.
- Specified by:
getOutstandingRequests in class ServerCnxn
getSessionTimeout
public int getSessionTimeout()
toString
public String toString()
- Description copied from class:
ServerCnxn
- Prints detailed stats information for the connection.
- Overrides:
toString in class ServerCnxn
- See Also:
for brief stats
close
public void close()
sendResponse
public void sendResponse(ReplyHeader h,
org.apache.jute.Record r,
String tag)
- Specified by:
sendResponse in class ServerCnxn
process
public void process(WatchedEvent event)
- Specified by:
process in interface Watcher- Specified by:
process in class ServerCnxn
getSessionId
public long getSessionId()
setSessionId
public void setSessionId(long sessionId)
setSessionTimeout
public void setSessionTimeout(int sessionTimeout)
getInterestOps
public int getInterestOps()
- Specified by:
getInterestOps in class ServerCnxn
getRemoteSocketAddress
public InetSocketAddress getRemoteSocketAddress()
- Specified by:
getRemoteSocketAddress in class ServerCnxn
serverStats
protected ServerStats serverStats()
- Specified by:
serverStats in class ServerCnxn
Copyright © 2013 The Apache Software Foundation