code: public synchronized void shutdown(boolean synchronous) throws IOException {
      LOG.info("Failover: Asynchronous shutdown for: " + currentAvatar);
      
      // check permissions before any other actions
      super.namesystem.checkSuperuserPrivilege();
      
      if (runInfo.shutdown) {
        LOG.info("Failover: Node already shut down");
        return;
      }
      
      // check edit streams
      // if this fails, we still have a chance to fix it
      // and shutdown again
      verifyEditStreams();
      
      runInfo.shutdown = true;
      Thread shutdownThread = new ShutdownAvatarThread(this);
      shutdownThread.setName("ShutDown thread for : " + serverAddress);
      shutdownThread.setDaemon(false);
      shutdownThread.start();
      
      if (synchronous) {
        LOG.info("Failover: Waiting for shutdown to complete");
        try {
          shutdownThread.join();
        } catch (InterruptedException ie) {
          throw new IOException(ie);
        }
      }
    }
docs: Shuts down the avatar node
  @param synchronous - should the function wait for the shutdown to complete
  @throws IOException