code: @Override
    public void truncate(Zxid zxid) throws IOException {
      int lastKeepIdx = getFileIdx(zxid);
      for (int i = lastKeepIdx + 1; i < logFiles.size(); ++i) {
        // Deletes all the log files after the file which contains the
        // transaction with zxid.
        File file = logFiles.get(i);
        boolean result = file.delete();
        if (!result) {
          LOG.warn("The file {} might not be deleted successfully.",
                    file.getName());
        }
      }
      if (lastKeepIdx != -1) {
        File file = this.logFiles.get(lastKeepIdx);
        try (SimpleLog log = new SimpleLog(file)) {
          log.truncate(zxid);
        }
      }
      logFiles.subList(lastKeepIdx+ 1, logFiles.size()).clear();
      this.currentLog = getLastLog();
      this.lastSeenZxid = getLatestZxid();
    }
docs: Truncates this transaction log at the given zxid.
  This method deletes all the transactions with zxids
  higher than the given zxid.
  
  @param zxid the transaction id.
  @throws IOException in case of IO failure