public class NettyServerCnxn extends ServerCnxn
Modifier and Type | Class and Description |
---|---|
static class |
NettyServerCnxn.HandshakeState |
ServerCnxn.CloseRequestException, ServerCnxn.DisconnectReason, ServerCnxn.EndOfStreamException
Watcher.Event, Watcher.WatcherType
Modifier and Type | Field and Description |
---|---|
int |
readIssuedAfterReadComplete |
count, disconnectReason, established, lastCxid, lastLatency, lastOp, lastResponseTime, lastZxid, maxLatency, me, minLatency, packetsReceived, packetsSent, requestsProcessedCount, totalLatency, zooKeeperSaslServer
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
close(ServerCnxn.DisconnectReason reason)
Close the cnxn and remove it from the factory cnxns list.
|
void |
disableRecv(boolean waitDisableRecv)
Note that the netty implementation ignores the
waitDisableRecv
parameter and is always asynchronous. |
void |
enableRecv() |
Certificate[] |
getClientCertificateChain() |
NettyServerCnxn.HandshakeState |
getHandshakeState() |
int |
getInterestOps() |
int |
getQueuedReadableBytes() |
InetSocketAddress |
getRemoteSocketAddress() |
long |
getSessionId() |
int |
getSessionTimeout() |
boolean |
isSecure() |
void |
process(WatchedEvent event) |
void |
sendBuffer(ByteBuffer... buffers) |
void |
sendCloseSession()
Send close connection packet to the client.
|
int |
sendResponse(ReplyHeader h,
Record r,
String tag,
String cacheKey,
Stat stat,
int opCode)
Serializes a ZooKeeper response and enqueues it for sending.
|
protected ServerStats |
serverStats() |
void |
setClientCertificateChain(Certificate[] chain) |
void |
setHandshakeState(NettyServerCnxn.HandshakeState state) |
void |
setSessionId(long sessionId) |
void |
setSessionTimeout(int sessionTimeout) |
addAuthInfo, cleanupWriterSocket, decrOutstandingAndCheckThrottle, dumpConnectionInfo, getAuthInfo, getAvgLatency, getConnectionInfo, getEstablished, getHostAddress, getLastCxid, getLastLatency, getLastOperation, getLastResponseTime, getLastZxid, getMaxLatency, getMinLatency, getOutstandingRequests, getPacketsReceived, getPacketsSent, getSessionIdHex, incrOutstandingAndCheckThrottle, incrPacketsReceived, incrPacketsSent, isInvalid, isStale, isZKServerRunning, packetReceived, packetSent, removeAuthInfo, resetStats, sendResponse, serialize, serializeRecord, setInvalid, setStale, toString, updateStatsForResponse
public void close(ServerCnxn.DisconnectReason reason)
close
in class ServerCnxn
public void close()
public long getSessionId()
getSessionId
in class ServerCnxn
public int getSessionTimeout()
public void process(WatchedEvent event)
process
in interface Watcher
process
in class ServerCnxn
public int sendResponse(ReplyHeader h, Record r, String tag, String cacheKey, Stat stat, int opCode) throws IOException
ServerCnxn
sendResponse
in class ServerCnxn
h
- reply headerr
- reply payload, can be nulltag
- Jute serialization tag, can be nullcacheKey
- Key for caching the serialized payload. A null value prevents caching.stat
- Stat information for the the reply payload, used for cache invalidation.
A value of 0 prevents caching.opCode
- The op code appertains to the corresponding request of the response,
used to decide which cache (e.g. read response cache,
list of children response cache, ...) object to look up to when applicable.IOException
public void setSessionId(long sessionId)
public void sendBuffer(ByteBuffer... buffers)
public void disableRecv(boolean waitDisableRecv)
waitDisableRecv
parameter and is always asynchronous.waitDisableRecv
- ignored by this implementation.public void enableRecv()
public void setSessionTimeout(int sessionTimeout)
public int getInterestOps()
getInterestOps
in class ServerCnxn
public InetSocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in class ServerCnxn
public void sendCloseSession()
sendCloseSession
in class ServerCnxn
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
public int getQueuedReadableBytes()
public void setHandshakeState(NettyServerCnxn.HandshakeState state)
public NettyServerCnxn.HandshakeState getHandshakeState()
Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.