Skip to content

logrhythm-oss/clj-headlights

 
 

Repository files navigation

clj-headlights

Build Status Clojars Project

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.

Usage

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"]

Examples

(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.

Documentation

See official documentation at https://logrhythm-oss.github.io/clj-headlights/

Versioning

Semver is used as versioning scheme.

Copyright and license

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.

Packages

No packages published

Languages

  • Clojure 75.9%
  • Java 20.5%
  • Shell 3.6%