Created
February 20, 2012 02:10
-
-
Save llasram/1867247 to your computer and use it in GitHub Desktop.
Cascalog debugging helper
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
(defn compile-and-dot | |
"Debugging helper. Compile a flow, print the steps, and write out the DOT | |
files for the flow operations and MR job steps." | |
[& args] | |
(let [^Flow flow (apply c/compile-flow args), name (.getName flow), | |
flow-path (str name "-flow.dot"), steps-path (str name "-steps.dot")] | |
(returning nil | |
(doseq [step (.getSteps flow)] | |
(prn step)) | |
(doto flow | |
(.writeDOT flow-path) | |
(.writeStepsDOT steps-path))))) | |
(defmacro debug-flows | |
"Generate debugging information for flows run in the argument body." | |
[& body] | |
`(with-redefs [?- compile-and-dot] | |
~@body)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment