code: private void format(StorageDirectory nsSdir, NamespaceInfo nsInfo) throws IOException {
      LOG.info("Formatting namespace " + namespaceID + " directory "
          + nsSdir.getCurrentDir());
      nsSdir.clearDirectory(); // create directory
      File rbwDir = new File(nsSdir.getCurrentDir(), STORAGE_DIR_RBW);
      File finalizedDir = new File(nsSdir.getCurrentDir(), STORAGE_DIR_FINALIZED);
      LOG.info("Creating Directories : " + rbwDir + ", " + finalizedDir);
      if (!rbwDir.mkdirs() || !finalizedDir.mkdirs()) {
        throw new IOException("Cannot create directories : " + rbwDir + ", "
            + finalizedDir);
      }
      this.layoutVersion = FSConstants.LAYOUT_VERSION;
      this.cTime = nsInfo.getCTime();
      this.namespaceID = nsInfo.getNamespaceID();
      this.storageType = NodeType.DATA_NODE;
      nsSdir.write();
    }
docs: Format a namespace slice storage.
  @param sd the namespace storage
  @param nsInfo the name space info
  @throws IOException Signals that an I/O exception has occurred.