refactors branching in make-filter for the new Clojure filters

This commit is contained in:
Ben Mabey 2010-11-03 11:20:06 -06:00
parent 249424ad81
commit c2f44f44e0

View file

@ -320,14 +320,13 @@
- :invert
Invert the selection of columns. Sample value: true"
[kind options]
(if (#{:clj-streamable :clj-batch} kind) ; TODO: Refactor
(doto (if (= :clj-streamable kind)
(ClojureStreamFilter. (:process options) (:determine-dataset-format options))
(ClojureBatchFilter. (:process options) (:determine-dataset-format options)))
(.setInputFormat (:dataset-format options)))
(doto (.newInstance (kind filter-aliases))
(.setOptions (into-array String (make-filter-options kind options)))
(.setInputFormat (:dataset-format options)))))
(let [filter (if (kind filter-aliases)
(doto (.newInstance (kind filter-aliases))
(.setOptions (into-array String (make-filter-options kind options))))
(case kind
:clj-streamable (ClojureStreamFilter. (:process options) (:determine-dataset-format options))
:clj-batch (ClojureBatchFilter. (:process options) (:determine-dataset-format options))))]
(doto filter (.setInputFormat (:dataset-format options)))))
;; Processing the filtering of data