code: private void createRPCNamenodeIfCompatible(
        InetSocketAddress nameNodeAddr,
        Configuration conf,
        UserGroupInformation ugi) throws IOException {
      try {
        this.namenodeProtocolProxy = createRPCNamenode(nameNodeAddr, conf, ugi,
            namenodeRPCSocketTimeout);
        this.rpcNamenode = namenodeProtocolProxy.getProxy();
      } catch (RPC.VersionMismatch e) {
        long clientVersion = e.getClientVersion();
        namenodeVersion = e.getServerVersion();
        if (clientVersion > namenodeVersion &&
            !ProtocolCompatible.isCompatibleClientProtocol(
                clientVersion, namenodeVersion)) {
          throw new RPC.VersionIncompatible(
              ClientProtocol.class.getName(), clientVersion, namenodeVersion);
        }
        this.rpcNamenode = (ClientProtocol)e.getProxy();
      }
    }
docs: Create a NameNode proxy for the client if the client and NameNode
  are compatible
  
  @param nameNodeAddr NameNode address
  @param conf configuration
  @param ugi ticket
  @return a NameNode proxy that's compatible with the client