code: public static boolean isCompatibleClientDatanodeProtocol(
        long clientVersion, long serverVersion) {
      return clientVersion == serverVersion ||
             (
              ( clientVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION-1 ||
                clientVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION ||
                clientVersion == ClientDatanodeProtocol.COPY_BLOCK_VERSION
              ) &&
              ( serverVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION-1 ||
                serverVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION ||
                serverVersion == ClientDatanodeProtocol.COPY_BLOCK_VERSION
             ));
    }
docs: Check if the client and DataNode have compatible ClientDataNodeProtocol versions
  
  @param clientVersion the version of ClientDatanodeProtocol that client has
  @param serverVersion the version of ClientDatanodeProtocol that DataNode has
  @return true if two versions are compatible