code: private void init() throws IOException {
      ssDir = conf.get("fs.snapshot.dir", "/.SNAPSHOT");
      tempDir = conf.get("fs.snapshot.tempdir", "/tmp/snapshot");
  
      fileServer = getImageServer();
      dfs = FileSystem.get(conf);
  
      Path ssPath = new Path(ssDir);
      if (!dfs.exists(ssPath)) {
        dfs.mkdirs(ssPath);
      }
  
      maxLeaseUpdateThreads = conf.getInt("fs.snapshot.leaseupdatethreads", 100);
  
      // Waiting room purge thread
      purgeThread = new Daemon((new WaitingRoom(conf)).getPurger());
      purgeThread.start();
  
      // Get namenode rpc connection
      nameNodeAddr = NameNode.getAddress(conf);
      namenode = (NamenodeProtocol) RPC.waitForProxy(NamenodeProtocol.class,
                                 NamenodeProtocol.versionID, nameNodeAddr, conf);
  
      // Snapshot RPC Server
      InetSocketAddress socAddr = SnapshotNode.getAddress(conf);
      int handlerCount = conf.getInt("fs.snapshot.handler.count", 10);
      server = RPC.getServer(this, socAddr.getHostName(), socAddr.getPort(),
                             handlerCount, false, conf);
      // The rpc-server port can be ephemeral... ensure we have the correct info
      serverAddress = server.getListenerAddress();
      LOG.info("SnapshotNode up at: " + serverAddress);
  
      server.start(); // start rpc server
    }
docs: Initialize SnapshotNode
  @throws IOException