lavin.1.3.3.source-code.zookeeper__init.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clavin Show documentation
Show all versions of clavin Show documentation
A command-line tool for loading service configurations into Zookeeper.
The newest version!
???? 1# zookeeper__init java/lang/Object load ()V const__0 Lclojure/lang/Var; clojure/lang/Var
getRawRoot ()Ljava/lang/Object;
clojure/lang/IFn const__1 Lclojure/lang/AFn; invoke &(Ljava/lang/Object;)Ljava/lang/Object; zookeeper$loading__4910__auto__
clojure/lang/Symbol " const__2 $ % equals (Ljava/lang/Object;)Z ' (
# ) zookeeper$fn__394 +
, java/util/concurrent/Callable . clojure/lang/LockingTransaction 0 runInTransaction 3(Ljava/util/concurrent/Callable;)Ljava/lang/Object; 2 3
1 4 const__3 6 7 const__12 9 : clojure/lang/IPersistentMap < setMeta (Lclojure/lang/IPersistentMap;)V > ?
@ zookeeper$connect B
C bindRoot (Ljava/lang/Object;)V E F
G const__13 I J const__16 L M zookeeper$close O
P const__17 R S const__20 U V zookeeper$register_watcher X
Y const__21 [ \ const__24 ^ _ zookeeper$state a
b const__25 d e const__28 g h zookeeper$exists j
k const__29 m n const__32 p q zookeeper$create s
t const__33 v w const__36 y z zookeeper$create_all |
} const__37 ? const__40 ? ? zookeeper$children ?
? const__41 ? ? const__44 ? ? $zookeeper$filter_children_by_pattern ?
? const__45 ? ? const__48 ? ? #zookeeper$filter_children_by_prefix ?
? const__49 ? ? const__52 ? ? #zookeeper$filter_children_by_suffix ?
? const__53 ? ? const__56 ? ? zookeeper$delete ?
? const__57 ? ? const__60 ? ? zookeeper$delete_all ?
? const__61 ? ? const__64 ? ? zookeeper$delete_children ?
? const__65 ? ? const__68 ? ? zookeeper$data ?
? const__69 ? ? const__72 ? ? zookeeper$set_data ?
? const__73 ? ? const__76 ? ? zookeeper$compare_and_set_data ?
? const__77 ? ? const__80 ? ? zookeeper$get_acl ?
? const__81 ? ? const__84 ? ? zookeeper$add_auth_info ?
? const__85 ? ? const__88 ? ? zookeeper$acl_id ?
? const__89 ? ? const__92 ? ?
zookeeper$acl ?
? const__93 ? ? const__95
const__100
const__101
const__104
zookeeper$world_acl
const__105
const__108 zookeeper$ip_acl
const__109
const__112 zookeeper$host_acl
const__113! "
const__116$ % zookeeper$auth_acl'
(
const__117* +
const__120- . zookeeper$digest_acl0
1 const__4 Lclojure/lang/Keyword; const__5 const__6 Ljava/lang/Object; const__7 const__8 const__9 const__10 const__11 const__14 const__15 const__18 const__19 const__22 const__23 const__26 const__27 const__30 const__31 const__34 const__35 const__38 const__39 const__42 const__43 const__46 const__47 const__50 const__51 const__54 const__55 const__58 const__59 const__62 const__63 const__66 const__67 const__70 const__71 const__74 const__75 const__78 const__79 const__82 const__83 const__86 const__87 const__90 const__91 const__94 const__96 const__97 const__98 const__99
const__102
const__103
const__106
const__107
const__110
const__111
const__114
const__115
const__118
const__119 __init0 clojure.coreu in-nsw clojure/lang/RTy var 8(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Var;{|
z} zookeeper intern ;(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Symbol;??
#? clojure/lang/IObj? doc? keyword <(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Keyword;??
z??
Zookeeper-clj is a Clojure DSL for Apache ZooKeeper, which "is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services."
Out of the box ZooKeeper provides name service, configuration, and group membership. From these core services, higher-level distributed concurrency abstractions can be built, including distributed locks, distributed queues, barriers, leader-election, and transaction services as described in ZooKeeper Recipes and Solutions and the paper "ZooKeeper: Wait-free coordination for Internet-scale systems".
See examples:
* http://developer.yahoo.com/blogs/hadoop/posts/2009/05/using_zookeeper_to_tame_system/
* http://archive.cloudera.com/cdh/3/zookeeper/zookeeperProgrammers.pdf
? map 2([Ljava/lang/Object;)Lclojure/lang/IPersistentMap;??
z? withMeta 2(Lclojure/lang/IPersistentMap;)Lclojure/lang/IObj;???? clojure/lang/AFn? connect? file? clojure/lang/Keyword?34 ? column?54 ? java/lang/Integer? valueOf (I)Ljava/lang/Integer;??
??67 ? line?84 ?97 ? arglists?:4 ? connection-string? &? keys? timeout-msec? watcher? vector 5([Ljava/lang/Object;)Lclojure/lang/IPersistentVector;??
z? or? ? java/lang/Long? (J)Ljava/lang/Long;??
?? java/util/Arrays? asList %([Ljava/lang/Object;)Ljava/util/List;??
?? clojure/lang/PersistentList? create 0(Ljava/util/List;)Lclojure/lang/IPersistentList;??
??;7 ?<4 ? Returns a ZooKeeper client.?
zookeeper.clj? close?=7 ? client? tag? ZooKeeper?>7 ? .Closes the connection to the ZooKeeper server.? register-watcher??7 ?@7 ? :Registers a default watcher function with this connection.? state?A7 ?B7 ? mReturns current state of client, including :CONNECTING,
:ASSOCIATING, :CONNECTED, :CLOSED, or :AUTH_FAILED? exists C7 path String watch? async?
callback context java/lang/Boolean FALSE Ljava/lang/Boolean; D7 Returns the status of the given node, and nil
if the node does not exist.
Examples:
(use 'zookeeper)
(def client (connect "127.0.0.1:2181"
:wacher #(println "event received: " %)))
(defn callback [result]
(println "got callback result: " result))
(exists client "/yadda" :watch? true)
(create client "/yadda")
(exists client "/yadda")
(def p0 (exists client "/yadda" :async? true))
@p0
(def p1 (exists client "/yadda" :callback callback))
@p1
?E7 data acl persistent?! sequential?# zi% acls' open-acl-unsafe)F7 +1 Creates a node, returning either the node's name, or a promise
with a result map if either the :async? option is true or if a
:callback function is provided. If the node already exists,
create will return false.
Options:
:persistent? indicates if the node should be persistent
:sequential? indicates if the node should be sequential
:data data to associate with the node
:acl access control, see the acls map
:async? indicates that the create should occur asynchronously,
a promise will be returned
:callback indicates that the create should occur asynchronously
and that this function should be called when it does,
a promise will also be returned
Example:
(use 'zookeeper)
(def client (connect "127.0.0.1:2181" :watcher #(println "event received: " %)))
(defn callback [result]
(println "got callback result: " result))
;; first delete the baz node if it exists
(delete-all client "/baz")
;; now create a persistent parent node, /baz, and two child nodes
(def p0 (create client "/baz" :callback callback :persistent? true))
@p0
(def p1 (create client "/baz/1" :callback callback))
@p1
(def p2 (create client "/baz/2-" :async? true :sequential? true))
@p2
(create client "/baz/3")
-
create-all/G7 1 options3H7 5iCreate a node and all of its parents. The last node will be ephemeral,
and its parents will be persistent. Option, like :persistent? :sequential?,
:acl, will only be applied to the last child node.
Examples:
(delete-all client "/foo")
(create-all client "/foo/bar/baz" :persistent? true)
(create-all client "/foo/bar/baz/n-" :sequential? true)
7 children9I7 ; sort?=J7 ?Returns a sequence of child node name for the given node, nil if it has no children and false if the node does not exist.
Examples:
(use 'zookeeper)
(def client (connect "127.0.0.1:2181" :watcher #(println "event received: " %)))
(defn callback [result]
(println "got callback result: " result))
(delete-all client "/foo")
(create client "/foo" :persistent? true)
(repeatedly 5 #(create client "/foo/child-" :sequential? true))
(children client "/foo")
(def p0 (children client "/foo" :async? true))
@p0
(def p1 (children client "/foo" :callback callback))
@p1
(def p2 (children client "/foo" :async? true :watch? true))
@p2
(def p3 (children client "/foo" :async? true :watcher #(println "watched event: " %)))
@p3
A filter-children-by-patternCK7 E dirG patternIL7 K KReturns a sequence of child node names filtered by the given regex pattern.M filter-children-by-prefixOM7 Q prefixSN7 U HReturns a sequence of child node names that start with the given prefix.W filter-children-by-suffixYO7 [ suffix]P7 _ FReturns a sequence of child node names that end with the given suffix.a deletecQ7 e versiong????????R7 k?Deletes the given node, if it exists
Examples:
(use 'zookeeper)
(def client (connect "127.0.0.1:2181" :watch #(println "event received: " %)))
(defn callback [result]
(println "got callback result: " result))
(create client "/foo" :persistent? true)
(create client "/bar" :persistent? true)
(delete client "/foo")
(def p0 (delete client "/bar" :callback callback))
@p0
m
delete-alloS7 qT7 s 'Deletes a node and all of its children.u delete-childrenwU7 yV7 { #Deletes all of the node's children.}W7 X7 ??Returns a map with two fields, :data and :stat. The :stat field is the same map returned by the exists function, the :data field is a byte array of data from the given node.
Examples:
(use 'zookeeper)
(def client (connect "127.0.0.1:2181" :watcher #(println "event received: " %)))
(defn callback [result]
(println "got callback result: " result))
(delete-all client "/foo")
(create client "/foo" :persistent? true :data (.getBytes "Hello World" "UTF-8"))
(def result (data client "/foo"))
(String. (:data result))
(:stat result)
(def p0 (data client "/foo" :async? true))
@p0
(String. (:data @p0))
(def p1 (data client "/foo" :watch? true :callback callback))
@p1
(String. (:data @p1))
(create client "/foobar" :persistent? true :data (.getBytes (pr-str {:a 1, :b 2, :c 3} "UTF-8")))
(read-string (String. (:data (data client "/foobar"))))
? set-data?Y7 ?Z7 ??Sets the value of the data field of the given node.
Examples:
(use 'zookeeper)
(def client (connect "127.0.0.1:2181" :watcher #(println "event received: " %)))
(defn callback [result]
(println "got callback result: " result))
(delete-all client "/foo")
(create client "/foo" :persistent? true)
(set-data client "/foo" (.getBytes "Hello World" "UTF-8") 0)
(String. (:data (data client "/foo")))
(def p0 (set-data client "/foo" (.getBytes "New Data" "UTF-8") 0 :async? true))
@p0
(String. (:data (data client "/foo")))
(def p1 (set-data client "/foo" (.getBytes "Even Newer Data" "UTF-8") 1 :callback callback))
@p1
(String. (:data (data client "/foo")))
? compare-and-set-data?[7 ? node? expected-value? new-value?\7 ? }Sets the data field of the given node, only if the current data
byte-array equals (Arrays/equal) the given expected-value.? get-acl?]7 ?^7 ?+Returns a sequence of ACLs associated with the given node.
Examples:
(use 'zookeeper)
(def client (connect "127.0.0.1:2181" :watcher #(println "event received: " %)))
(add-auth-info client "digest" "david:secret")
(defn callback [result]
(println "got callback result: " result))
(delete-all client "/foo")
(create client "/foo" :acl [(acl "auth" "" :read :write :create :delete)])
(get-acl client "/foo")
(def p0 (get-acl client "/foo" :async? true))
(def p1 (get-acl client "/foo" :callback callback))
?
add-auth-info?_7 ? scheme? auth?`7 ? Add auth info to connection.? acl-id?a7 ? id-value?b7 ?