code: int getFileIdx(Zxid zxid) {
      if (logFiles.isEmpty() ||
          zxid.compareTo(getZxidFromFileName(logFiles.get(0))) < 0) {
        // If there's no log files or the zxid is smaller than the smallest zxid
        // of the rolling log, returns -1.
        return -1;
      }
      int idx = 0;
      while (idx < logFiles.size() - 1) {
        Zxid firstZxid = getZxidFromFileName(logFiles.get(idx));
        if (zxid.compareTo(firstZxid) == 0) {
          break;
        } else if (zxid.compareTo(firstZxid) > 0) {
          int nextIdx = idx + 1;
          if (nextIdx < logFiles.size()) {
            Zxid nextFirstZxid = getZxidFromFileName(logFiles.get(nextIdx));
            if (zxid.compareTo(nextFirstZxid) < 0) {
              // Means the zxid is larger than the smallest allowed zxid of log
              // file of index i but smaller than the smallest allowed zxid of
              // log file of index i + 1. So the transaction with zxid only
              // can be possibly in log file with idx i.
              break;
            }
          }
        }
        idx++;
      }
      return idx;
    }
docs: Given the zxid, find out the idx of the file in list which contains the
  transaction with this zxid if and only if the transaction with the zxid
  is in RollingLog. If the zxid is smaller than the smallest zxid in log,
  -1 will be returned.
  
  @param zxid the zxid of the transaction.
  @return the idx of file which possibly contains the transaction with
  given zxid.