public class NIOServerCnxn extends ServerCnxn
ServerCnxn.CloseRequestException, ServerCnxn.EndOfStreamException
Watcher.Event
Modifier and Type | Field and Description |
---|---|
protected java.nio.channels.SelectionKey |
sk |
protected ZooKeeperServer |
zkServer |
authInfo, 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
Constructor and Description |
---|
NIOServerCnxn(ZooKeeperServer zk,
java.nio.channels.SocketChannel sock,
java.nio.channels.SelectionKey sk,
NIOServerCnxnFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
disableRecv() |
void |
enableRecv() |
int |
getInterestOps() |
long |
getOutstandingRequests()
The number of requests that have been submitted but not yet
responded to.
|
java.net.InetSocketAddress |
getRemoteSocketAddress() |
long |
getSessionId() |
int |
getSessionTimeout() |
java.net.InetAddress |
getSocketAddress()
Wrapper method to return the socket address
|
protected void |
incrOutstandingRequests(RequestHeader h) |
protected void |
internalSendBuffer(java.nio.ByteBuffer bb)
This method implements the internals of sendBuffer.
|
protected boolean |
isSocketOpen()
Only used in order to allow testing
|
void |
process(WatchedEvent event) |
void |
sendBuffer(java.nio.ByteBuffer bb) |
void |
sendCloseSession() |
void |
sendResponse(ReplyHeader h,
org.apache.jute.Record r,
java.lang.String tag) |
protected ServerStats |
serverStats() |
void |
setSessionId(long sessionId) |
void |
setSessionTimeout(int sessionTimeout) |
java.lang.String |
toString()
Prints detailed stats information for the connection.
|
addAuthInfo, dumpConnectionInfo, getAuthInfo, getAvgLatency, getCommandString, getEstablished, getLastCxid, getLastLatency, getLastOperation, getLastResponseTime, getLastZxid, getMaxLatency, getMinLatency, getPacketsReceived, getPacketsSent, incrPacketsReceived, incrPacketsSent, isEnabled, isKnown, packetReceived, packetSent, removeAuthInfo, resetStats, resetWhiteList, updateStatsForResponse
protected final java.nio.channels.SelectionKey sk
protected final ZooKeeperServer zkServer
public NIOServerCnxn(ZooKeeperServer zk, java.nio.channels.SocketChannel sock, java.nio.channels.SelectionKey sk, NIOServerCnxnFactory factory) throws java.io.IOException
java.io.IOException
public void sendCloseSession()
public void sendBuffer(java.nio.ByteBuffer bb)
protected void internalSendBuffer(java.nio.ByteBuffer bb)
bb
- Buffer to send.protected boolean isSocketOpen()
public java.net.InetAddress getSocketAddress()
ServerCnxn
getSocketAddress
in class ServerCnxn
protected void incrOutstandingRequests(RequestHeader h)
incrOutstandingRequests
in class ServerCnxn
public void disableRecv()
public void enableRecv()
public long getOutstandingRequests()
getOutstandingRequests
in class ServerCnxn
public int getSessionTimeout()
public java.lang.String toString()
ServerCnxn
toString
in class ServerCnxn
for brief stats
public void close()
public void sendResponse(ReplyHeader h, org.apache.jute.Record r, java.lang.String tag)
sendResponse
in class ServerCnxn
public void process(WatchedEvent event)
process
in interface Watcher
process
in class ServerCnxn
public long getSessionId()
public void setSessionId(long sessionId)
public void setSessionTimeout(int sessionTimeout)
public int getInterestOps()
getInterestOps
in class ServerCnxn
public java.net.InetSocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in class ServerCnxn
protected ServerStats serverStats()
serverStats
in class ServerCnxn
Copyright © 2019 The Apache Software Foundation