Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (def *factory* (voldemort/store-client-factory
- ["tcp://localhost:6666"]))
- (def *client-person* (.getStoreClient *factory* "person"))
- (def *client-zipcode* (.getStoreClient *factory* "zipcode"))
- (defn hello-voldemort []
- (.put *client-person* "alex.feinberg" { "first" "alex",
- "last" "feinberg",
- "zipcode" 94041 })
- (.put *client-zipcode* (get (.getValue (.get *client-person* "alex.feinberg"))
- "zipcode")
- ["alex.feinberg"])
- (.put *client-person* "bradford.cross" { "first" "bradford",
- "last" "cross",
- "zipcode" 94041 })
- (voldemort/apply-update
- *client-zipcode*
- (fn [client]
- (let [obj (.get client 94041)
- val (.getValue obj)]
- (.put client 94041
- (doto obj
- (.setObject (cons
- "bradford.cross"
- val)))))))
- (doseq [[_ person-versioned] (.getAll *client-person*
- (.getValue (.get *client-zipcode*
- 94041)))]
- (println (get (.getValue person-versioned)
- "first")
- "lives in 94041")))
Add Comment
Please, Sign In to add comment