code: protected static NamenodeProtocol createNamenode(InetSocketAddress nameNodeAddr, Configuration conf)
      throws IOException {
      RetryPolicy timeoutPolicy = RetryPolicies.exponentialBackoffRetry(
          5, 200, TimeUnit.MILLISECONDS);
      Map<Class<? extends Exception>,RetryPolicy> exceptionToPolicyMap =
        new HashMap<Class<? extends Exception>, RetryPolicy>();
      RetryPolicy methodPolicy = RetryPolicies.retryByException(
          timeoutPolicy, exceptionToPolicyMap);
      Map<String,RetryPolicy> methodNameToPolicyMap =
          new HashMap<String, RetryPolicy>();
      methodNameToPolicyMap.put("getBlocks", methodPolicy);
  
      UserGroupInformation ugi;
      try {
        ugi = UnixUserGroupInformation.login(conf);
      } catch (javax.security.auth.login.LoginException e) {
        throw new IOException(StringUtils.stringifyException(e));
      }
  
      return (NamenodeProtocol) RetryProxy.create(
          NamenodeProtocol.class,
          RPC.getProxy(NamenodeProtocol.class,
              NamenodeProtocol.versionID,
              nameNodeAddr,
              ugi,
              conf,
              NetUtils.getDefaultSocketFactory(conf)),
          methodNameToPolicyMap);
    }
docs: /* Build a NamenodeProtocol connection to the namenode and
  set up the retry policy