Package org.apache.zookeeper.server
Class DumbWatcher
java.lang.Object
org.apache.zookeeper.server.ServerCnxn
org.apache.zookeeper.server.DumbWatcher
- All Implemented Interfaces:
ServerWatcher,Watcher
A empty watcher implementation used in bench and unit test.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.zookeeper.server.ServerCnxn
ServerCnxn.CloseRequestException, ServerCnxn.DisconnectReason, ServerCnxn.EndOfStreamExceptionNested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
Watcher.Event, Watcher.WatcherType -
Field Summary
Fields inherited from class org.apache.zookeeper.server.ServerCnxn
count, disconnectReason, established, lastCxid, lastLatency, lastOp, lastResponseTime, lastZxid, maxLatency, me, minLatency, packetsReceived, packetsSent, protocolManager, totalLatency, zooKeeperSaslServer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(ServerCnxn.DisconnectReason reason) intlonglonglongbooleanisSecure()voidprocess(WatchedEvent event, List<ACL> znodeAcl) voidintsendResponse(ReplyHeader h, Record r, String tag, String cacheKey, Stat stat, int opCode) Serializes a ZooKeeper response and enqueues it for sending.protected ServerStatsvoidsetClientCertificateChain(Certificate[] chain) Methods inherited from class org.apache.zookeeper.server.ServerCnxn
addAuthInfo, cleanupWriterSocket, decrOutstandingAndCheckThrottle, dumpConnectionInfo, getAuthInfo, getAvgLatency, getConnectionInfo, getEstablished, getHostAddress, getLastCxid, getLastLatency, getLastOperation, getLastResponseTime, getLastZxid, getMaxLatency, getMinLatency, getPacketsReceived, getPacketsSent, getSessionIdHex, incrOutstandingAndCheckThrottle, incrPacketsReceived, incrPacketsSent, isInvalid, isStale, isZKServerRunning, packetReceived, packetSent, process, removeAuthInfo, resetStats, sendResponse, serialize, serializeRecord, setInvalid, setStale, toString, updateStatsForResponse
-
Constructor Details
-
DumbWatcher
public DumbWatcher() -
DumbWatcher
public DumbWatcher(long sessionId)
-
-
Method Details
-
process
- Specified by:
processin interfaceServerWatcher- Specified by:
processin classServerCnxn
-
getMostRecentPath
-
getMostRecentEventType
-
getMostRecentZxid
public long getMostRecentZxid() -
close
- Specified by:
closein classServerCnxn
-
sendResponse
public int sendResponse(ReplyHeader h, Record r, String tag, String cacheKey, Stat stat, int opCode) throws IOException Description copied from class:ServerCnxnSerializes a ZooKeeper response and enqueues it for sending. Serializes client response parts and enqueues them into outgoing queue. If both cache key and last modified zxid are provided, the serialized response is caŃhed under the provided key, the last modified zxid is stored along with the value. A cache entry is invalidated if the provided last modified zxid is more recent than the stored one. Attention: this function is not thread safe, due to caching not being thread safe.- Specified by:
sendResponsein classServerCnxn- Parameters:
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.- Throws:
IOException
-
sendCloseSession
public void sendCloseSession()- Specified by:
sendCloseSessionin classServerCnxn
-
getSessionId
public long getSessionId()- Specified by:
getSessionIdin classServerCnxn
-
serverStats
- Specified by:
serverStatsin classServerCnxn
-
getOutstandingRequests
public long getOutstandingRequests()- Overrides:
getOutstandingRequestsin classServerCnxn
-
getRemoteSocketAddress
- Specified by:
getRemoteSocketAddressin classServerCnxn
-
getInterestOps
public int getInterestOps()- Specified by:
getInterestOpsin classServerCnxn
-
isSecure
public boolean isSecure()- Specified by:
isSecurein classServerCnxn
-
getClientCertificateChain
- Specified by:
getClientCertificateChainin classServerCnxn
-
setClientCertificateChain
- Specified by:
setClientCertificateChainin classServerCnxn
-