Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved the branch functions into their own namespace

To facilitate reuse.
  • Loading branch information...
commit a662621669fd684ae43fc9a934472b6e2c19afb4 1 parent 0bc55c6
@lorcan lorcan authored
View
9 src/clj/backtype/storm/branch.clj
@@ -0,0 +1,9 @@
+(ns backtype.storm.branch)
+
+(defn parse-branch [branch]
+ (map #(Integer/parseInt %) (.split branch "\\.")))
+
+(defn branch> [branch1 branch2]
+ (->> (map - (parse-branch branch1) (parse-branch branch2))
+ (take-while #(>= % 0))
+ (some pos?)))
View
9 src/clj/backtype/storm/node.clj
@@ -23,19 +23,12 @@
[pallet.resource.exec-script :as exec-script])
(:use
[backtype.storm config]
+ [backtype.storm.branch :only [branch>]]
[pallet compute core resource phase]
[pallet [utils :only [make-user]]]
[org.jclouds.compute2 :only [nodes-in-group]]
[clojure.walk]))
-(defn parse-branch [branch]
- (map #(Integer/parseInt %) (.split branch "\\.")))
-
-(defn branch> [branch1 branch2]
- (->> (map - (parse-branch branch1) (parse-branch branch2))
- (take-while #(>= % 0))
- (some pos?)))
-
;; CONSTANTS
(def clusters-conf
Please sign in to comment.
Something went wrong with that request. Please try again.