code: public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) {
      // Unlike most entries, the delete file entry must be applied *before* making the in-memory
      // change. This is because delete file and create file are performed with only a read lock on
      // the parent directory. As soon as we do the in-memory-delete, another thread could re-create a
      // directory with the same name, and append a journal entry for the inode creation. This would
      // ruin journal replay because we would see two create file entries in a row for the same file
      // name. The opposite order is safe. We will never append the delete entry for a file before its
      // creation entry because delete requires a write lock on the deleted file, but the create
      // operation holds that lock until after it has appended to the journal.
      try {
        context.get().append(JournalEntry.newBuilder().setDeleteFile(entry).build());
        applyDelete(entry);
      } catch (Throwable t) {
        // Delete entries should always apply cleanly, but if it somehow fails, we are in a state
        // where we've journaled the delete, but failed to make the in-memory update. We don't yet
        // have a way to recover from this, so we give a fatal error.
        ProcessUtils.fatalError(LOG, t, "Failed to apply entry %s", entry);
      }
    }
docs: Deletes an inode (may be either a file or directory).
  
  @param context journal context supplier
  @param entry delete file entry