         (when-not @wlog/print-log?
           (println title)
           (prog/init files-count))
-        (dorun (cp/pmap pool process-fn files))
+        (dorun (cp/pmap pool process-file-fn files))
         (when-not @wlog/print-log?
           (prog/done))
         (catch Exception e


(defn- process
  "Process a Whisper database."
  [source tenant cass-host es-url options start-title title]
  (wlog/set-logging! options)
  (try
    (wlog/info start-title)


(def ^:const pbar-width 35)

(defn- calc-ttl
  "Calc TTL."
  [time retention]
  (- time (- (utils/now) retention)))

(defn- migrate-points
  "Migrate points."
  [mstore options tenant rollup period retention path series]
  (let [min-ttl (:min-ttl options default-min-ttl)
        run (:run options false)]
    (doseq [point series]
      (let [time (first point)
            value (last point)
            ttl (calc-ttl time retention)]
        (when (not= time 0)
          (when (> ttl min-ttl)
            (log/trace
             (format (str "Migrating point: rollup: %s, period: %s, "
                          "path: %s, time: %s, value: %s, ttl: %s")
                     rollup period path time value ttl))
            (when (and run mstore)
              (mstore/insert mstore tenant rollup period path time value
                             ttl))))))))

(defn- process-archive
  "Process an archive."
  [ra-file file archive mstore tenant path from to retention options points-fn]
  (let [rollup (:seconds-per-point archive)
        points (:points archive)
        period (if retention (/ retention rollup) points)
        retention (if retention retention (* rollup points))
        data (whisper/fetch-archive-seq-ra ra-file file archive from to)
        series (:series data)]
    (points-fn mstore options tenant rollup period retention path series)))

(defn- migrate-path
  "Migrate a path."
  [pstore tenant path]
  (when pstore
    (pstore/insert pstore tenant path)))

(defn- process-file
  "Process a file."
  [file dir mstore pstore tenant from to options path-fn points-fn]
  (let [path (whisper/file-to-name file dir)]
    (path-fn pstore tenant path)
    (let [ra-file (RandomAccessFile. file "r")
          rollups (:rollups options)]
      (try
        (let [info (whisper/read-info-ra ra-file file)
              archives (:archives info)]
          (doseq [archive archives]
            (let [seconds-per-point (:seconds-per-point archive)]
              (when (or (not (> (count rollups) 0))
                        (contains? rollups seconds-per-point))
                (let [retention (get rollups seconds-per-point
                                     (:retention archive))]
                  (process-archive ra-file file archive mstore tenant path
                                   from to retention options points-fn))))))
        (finally
          (.close ra-file))))))

(defn- get-paths
  "Get paths."
