Clj-headlights is a toolset for Apache Beam to use Clojure code and construct pipelines.
It is not intended as a full replacement for the Beam Java SDK, nor a complete abstraction layer. As a clj-headlights user, you are expected to know the Beam programming model. Its intent is to make Clojure play nice enough with the official SDK and provide helpers for tedious operations.
Latest stable version
[logrhythm/clj-headlights "0.3.2"]
To get the latest build in from the master branch (may contain breaking changes)
[logrhythm/clj-headlights "master-SNAPSHOT"]
(defn split-words [line]
(str/split line #" "))
(defn word-starts-with? [word substr]
(str/starts-with? word substr))
(let [pipeline (hl/create (hl/options {:job-name "wordcount"}))]
(-> pipeline
(io/resource-string->pcollection "read-file" "file://file.txt")
(hl/df-mapcat "split-words" #'split-words)
(hl/df-filter "only-f-words" [#'word-starts-with? "f"])
(hl/df-map "count-chars" #'count)))
You can find example projects in the examples directory, and in the test/clj_headlights/examples directory.
See official documentation at https://logrhythm-oss.github.io/clj-headlights/
Semver is used as versioning scheme.
Copyright 2019 LogRhythm, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.