 (defmulti checkpoint (fn [context arg] (class arg)))
 (defmethod checkpoint java.lang.String [streaming-context path] (.checkpoint streaming-context path))
 (defmethod checkpoint java.lang.Long [dstream interval] (.checkpoint dstream (duration interval)))
+
+(defn text-file-stream [context file-path]
+  (.textFileStream context file-path))
 
 (defn socket-text-stream [context ip port]
   (.socketTextStream context ip port))

      (.groupByKeyAndWindow (duration window-length) (duration slide-interval))
      (.map (function f/untuple))))

(defn reduce-by-window [dstream f window-length slide-interval]
  (.reduceByWindow dstream (function2 f) (duration window-length) (duration slide-interval)))

(defn reduce-by-key-and-window [dstream f window-length slide-interval]
  (-> dstream


(defn foreach-rdd [dstream f]
  (.foreachRDD dstream (function2 f)))


;; ## Output
;;
(defn save-as-text-files
  ;;TODO: check whether first param is of type
  ;;DStream or just let an exception be thrown?
  ([dstream prefix suffix]
    (.saveAsTextFiles dstream prefix suffix))
  ([dstream prefix]
   (.saveAsTextFiles dstream prefix)))
