-
-
Save KirinDave/05477f0c92eec4f9c4fb to your computer and use it in GitHub Desktop.
Ugh
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
(defmacro single-key-aggregate-writer [name update-builder table] | |
`(defbolt ~name [] [~'tuple ~'collector] | |
(let [~'count-maps (tfield "count-maps")] | |
(try | |
(doseq [[~'agg-id ~'count-map] ~'count-maps] | |
(let [~'update-map (~update-builder ~'count-map)] | |
(dynamodb/update-item base/aws-credential ~table ~'agg-id ~'update-map))) | |
(ack! ~'collector ~'tuple) | |
(catch Exception ~'e | |
(log/error (str "Exception commiting to " ~table) (seq (.getStackTrace ~'e))) | |
(log/error ~'e) | |
(fail! ~'collector ~'tuple)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment