Package org.apache.zookeeper.compat
Class ProtocolManager
java.lang.Object
org.apache.zookeeper.compat.ProtocolManager
A manager for switching behaviours between difference wire protocol.
Basically, wire protocol should be backward and forward compatible between minor versions. However, there are several cases that it's different due to Jute's limitations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserializeConnectRequest
(InputArchive inputArchive) DeserializingConnectRequest
should be specially handled for request from client version before and including ZooKeeper 3.3 which doesn't understand readOnly field.deserializeConnectResponse
(InputArchive inputArchive) DeserializingConnectResponse
should be specially handled for response from server version before and including ZooKeeper 3.3 which doesn't understand readOnly field.boolean
void
serializeConnectResponse
(ConnectResponse response, OutputArchive outputArchive) The serialization ofConnectResponse
has to be handled specially as clients earlier than 3.5 might not expect thereadOnly
flag.
-
Constructor Details
-
ProtocolManager
public ProtocolManager()
-
-
Method Details
-
isReadonlyAvailable
public boolean isReadonlyAvailable() -
deserializeConnectRequest
DeserializingConnectRequest
should be specially handled for request from client version before and including ZooKeeper 3.3 which doesn't understand readOnly field.- Throws:
IOException
-
deserializeConnectResponse
DeserializingConnectResponse
should be specially handled for response from server version before and including ZooKeeper 3.3 which doesn't understand readOnly field.- Throws:
IOException
-
serializeConnectResponse
public void serializeConnectResponse(ConnectResponse response, OutputArchive outputArchive) throws IOException The serialization ofConnectResponse
has to be handled specially as clients earlier than 3.5 might not expect thereadOnly
flag.- Parameters:
response
- the response to serializeoutputArchive
- the serialization destination- Throws:
IOException
- See Also:
-