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 ( ) ; } }
Create a NameNode proxy for the client if the client and NameNode are compatible