public class NIOServerCnxn extends ServerCnxn
ServerCnxn.CloseRequestException, ServerCnxn.EndOfStreamException
Watcher.Event, Watcher.WatcherType
authInfo, count, established, lastCxid, lastLatency, lastOp, lastResponseTime, lastZxid, maxLatency, me, minLatency, packetsReceived, packetsSent, totalLatency, zooKeeperSaslServer
Constructor and Description |
---|
NIOServerCnxn(ZooKeeperServer zk,
SocketChannel sock,
SelectionKey sk,
NIOServerCnxnFactory factory,
org.apache.zookeeper.server.NIOServerCnxnFactory.SelectorThread selectorThread) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the cnxn and remove it from the factory cnxns list.
|
static void |
closeSock(SocketChannel sock)
Close resources associated with a sock.
|
void |
disableRecv() |
void |
disableSelectable() |
void |
enableRecv() |
void |
enableSelectable() |
Certificate[] |
getClientCertificateChain() |
int |
getInterestOps() |
long |
getOutstandingRequests()
The number of requests that have been submitted but not yet
responded to.
|
InetSocketAddress |
getRemoteSocketAddress() |
long |
getSessionId() |
int |
getSessionTimeout() |
InetAddress |
getSocketAddress() |
protected void |
incrOutstandingRequests(RequestHeader h) |
boolean |
isSecure() |
boolean |
isSelectable() |
protected boolean |
isSocketOpen()
Only used in order to allow testing
|
void |
process(WatchedEvent event) |
void |
sendBuffer(ByteBuffer bb)
sendBuffer pushes a byte buffer onto the outgoing buffer queue for
asynchronous writes.
|
void |
sendCloseSession() |
void |
sendResponse(ReplyHeader h,
Record r,
String tag) |
protected ServerStats |
serverStats() |
void |
setClientCertificateChain(Certificate[] chain) |
void |
setSessionId(long sessionId) |
void |
setSessionTimeout(int sessionTimeout) |
String |
toString()
Used by "dump" 4-letter command to list all connection in
cnxnExpiryMap
|
addAuthInfo, cleanupWriterSocket, dumpConnectionInfo, getAuthInfo, getAvgLatency, getConnectionInfo, getEstablished, getLastCxid, getLastLatency, getLastOperation, getLastResponseTime, getLastZxid, getMaxLatency, getMinLatency, getPacketsReceived, getPacketsSent, incrPacketsReceived, incrPacketsSent, packetReceived, packetSent, removeAuthInfo, resetStats, updateStatsForResponse
public NIOServerCnxn(ZooKeeperServer zk, SocketChannel sock, SelectionKey sk, NIOServerCnxnFactory factory, org.apache.zookeeper.server.NIOServerCnxnFactory.SelectorThread selectorThread) throws IOException
IOException
public void sendCloseSession()
public void sendBuffer(ByteBuffer bb)
public boolean isSelectable()
public void disableSelectable()
public void enableSelectable()
protected boolean isSocketOpen()
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 String toString()
toString
in class ServerCnxn
for brief stats
public void close()
public static void closeSock(SocketChannel sock)
public void sendResponse(ReplyHeader h, Record r, String tag)
sendResponse
in class ServerCnxn
public void process(WatchedEvent event)
process
in interface Watcher
process
in class ServerCnxn
public long getSessionId()
getSessionId
in class ServerCnxn
public void setSessionId(long sessionId)
public void setSessionTimeout(int sessionTimeout)
public int getInterestOps()
getInterestOps
in class ServerCnxn
public InetSocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in class ServerCnxn
public InetAddress getSocketAddress()
protected ServerStats serverStats()
serverStats
in class ServerCnxn
public boolean isSecure()
isSecure
in class ServerCnxn
public Certificate[] getClientCertificateChain()
getClientCertificateChain
in class ServerCnxn
public void setClientCertificateChain(Certificate[] chain)
setClientCertificateChain
in class ServerCnxn
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.