This file contains 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
;; hadoop -jar compass.jar -step count-users | |
;; hadoop -jar compass.jar -flow count-user-flow | |
(defn map-count-users [k fmap] | |
(ctx/increment-counter "Compass" "rows") | |
(ctx/increment-counter "Compass" (format "src=%s" (:src (:userinfo fmap)))) | |
[]) | |
(defn count-users-total [job] | |
(job-counter-value job "Compass" "rows")) |
This file contains 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
;; Pseudocode example for guards in flows | |
(def *guard-time* [:days 7]) | |
(defmacro with-resource-time-guard | |
[[name timespec inhibit?] &body ] | |
`(let [resource# (get-resource name)] | |
(cond (and ~inhibit? (resource-value resource#)) | |
(resource-value resource#) | |
(or (resource-expired? resource# ~timespec) |
This file contains 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
(define-sink :null [] | |
:reduce-writer wrap/clojure-writer | |
:output-format NullOutputFormat | |
:output-key Text | |
:output-value Text) | |
This file contains 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
(define-shuffle :clojure [] | |
:map-writer wrap/clojure-writer | |
:reduce-reader wrap/clojure-reduce-reader) | |
This file contains 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
(define-source :hbase [table constraints] | |
:input-format TableInputFormat | |
:map-reader hbase-table-reader-latest | |
:configure (fn [job] | |
(configure-hbase job table constraints))) |
NewerOlder