code: public void shutdown() throws IOException {
      // Clean up RPC connections.
      Iterator <ClientDatanodeProtocol> connections =
        datanodeMap.values().iterator();
      while(connections.hasNext()) {
        ClientDatanodeProtocol cnxn = connections.next();
        RPC.stopProxy(cnxn);
      }
      datanodeMap.clear();
      executor.shutdownNow();
      synchronized (leaseCheckers) {
        for (LeaseChecker checker : leaseCheckers.values()) {
          checker.closeRenewal();
        }
      }
    }
docs: Tears down all RPC connections, you MUST call this once you are done.
  @throws IOException