Skip to content

Instantly share code, notes, and snippets.

@spariev
Created March 19, 2010 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spariev/337484 to your computer and use it in GitHub Desktop.
Save spariev/337484 to your computer and use it in GitHub Desktop.
(defn index-file-with-writer [config-id index-writer fname]
(let [req-counter (ref 0)]
(do
(println (str "Parsing " fname))
(doall (map (partial process-request-log config-id index-writer)
(partition-by
#(if (. #^String % startsWith "Processing")
(dosync (alter req-counter inc))
(deref req-counter))
(line-seq (reader fname))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment