ChinmaySKulkarni commented on a change in pull request #676: PHOENIX-5636:
Improve the error message when client connects to server with higher major
version
URL: https://github.com/apache/phoenix/pull/676#discussion_r377861760
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1487,20 +1487,17 @@ private static boolean hasIndexWALCodec(Long
serverVersion) {
return MetaDataUtil.decodeHasIndexWALCodec(serverVersion);
}
- private static boolean isCompatible(Long serverVersion) {
+ private static boolean isCompatible(Long serverVersion, StringBuilder buf)
{
if (serverVersion == null) {
return false;
}
- return MetaDataUtil.areClientAndServerCompatible(serverVersion);
+ return MetaDataUtil.areClientAndServerCompatible(serverVersion, buf);
Review comment:
I'm also not a big fan of passing the StringBuilder param everywhere. It
might be just cleaner to have a small inner class to represent
clientServerCompatibility and which contains perhaps the following:
- client version
- server version
- an is compatible check based on the above 2 values
- error message and/or code if there is an incompatibility
- getters/setters of error message/code and versions
That also makes it obvious what the class does and what the buffer contains.
It shouldn't be too much work to add this small inner class. At least, we
should rename "buf" to "errorString" or something.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services