This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; project.clj | |
;; [clj-time "0.6.0"] | |
;; [org.clojure/data.json "0.2.4"] | |
;; [clj-kafka "0.2.8-0.8.1.1"] | |
;; Utility to find offsets in a given Kafka topic for a given | |
;; cursor/point in time. The code assumes that each message has a | |
;; monotonically increasing number (ex. unix timestamp) associated with | |
;; it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns freq.core | |
(:import (java.io BufferedReader FileReader)) | |
(:require [clojure.string :as string])) | |
(defn read-file-lazy | |
"Opens a file and creates a lazy-sequence to read each line" | |
[file-name] | |
(with-open [reader (BufferedReader. (FileReader. file-name))] | |
(line-seq reader))) |