zk 1.0.0.rc.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +50 -3
- data/RELEASES.markdown +2 -2
- data/Rakefile +1 -1
- data/lib/zk/version.rb +1 -1
- metadata +7 -11
data/README.markdown
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# ZK
|
2
2
|
|
3
|
-
ZK is a high-level interface to the Apache [ZooKeeper][] server. It is based on the [zookeeper gem][] which is a multi-Ruby low-level driver. Currently MRI 1.8.7, 1.9.2, 1.9.3, and JRuby are supported
|
3
|
+
ZK is a high-level interface to the Apache [ZooKeeper][] server. It is based on the [zookeeper gem][] which is a multi-Ruby low-level driver. Currently MRI 1.8.7, 1.9.2, 1.9.3, and JRuby are supported, rubinius 2.0.testing is supported-ish (it's expected to work, but upstream is unstable, so YMMV).
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
ZK is licensed under the [MIT][] license.
|
6
|
+
|
7
|
+
The key place to start in the documentation is with ZK::Client::Base ([rubydoc.info][ZK::Client::Base], [local](/docs/ZK/Client/Base)).
|
7
8
|
|
8
9
|
This library is heavily used in a production deployment and is actively developed and maintained.
|
9
10
|
|
@@ -15,6 +16,52 @@ Development is sponsored by [Snapfish][] and has been generously released to the
|
|
15
16
|
[MIT]: http://www.gnu.org/licenses/license-list.html#Expat "MIT (Expat) License"
|
16
17
|
[Snapfish]: http://www.snapfish.com/ "Snapfish"
|
17
18
|
|
19
|
+
## New in 1.0 !! ##
|
20
|
+
|
21
|
+
* Threaded client (the default one) will now automatically reconnect (i.e. `reopen()`) if a `SESSION_EXPIRED` or `AUTH_FAILED` event is received. Thanks to @eric for pointing out the _nose-on-your-face obviousness_ and importance of this. If users want to handle these events themselves, and not automatically reopen, you can pass `:reconnect => false` to the constructor.
|
22
|
+
|
23
|
+
* allow for both :sequence and :sequential arguments to create, because I always forget which one is the "right one"
|
24
|
+
|
25
|
+
* add zk.register(:all) to recevie node updates for all nodes (i.e. not filtered on path)
|
26
|
+
|
27
|
+
* add 'interest' feature to zk.register, now you can indicate what kind of events should be delivered to the given block (previously you had to do that filtering inside the block). The default behavior is still the same, if no 'interest' is given, then all event types for the given path will be delivered to that block.
|
28
|
+
|
29
|
+
zk.register('/path', :created) do |event|
|
30
|
+
# event.node_created? will always be true
|
31
|
+
end
|
32
|
+
|
33
|
+
# or multiple kinds of events
|
34
|
+
|
35
|
+
zk.register('/path', [:created, :changed]) do |event|
|
36
|
+
# (event.node_created? or event.node_changed?) will always be true
|
37
|
+
end
|
38
|
+
|
39
|
+
* create now allows you to pass a path and options, instead of requiring the blank string
|
40
|
+
|
41
|
+
zk.create('/path', '', :sequential => true)
|
42
|
+
|
43
|
+
# now also
|
44
|
+
|
45
|
+
zk.create('/path', :sequential => true)
|
46
|
+
|
47
|
+
* fix for shutdown: close! called from threadpool will do the right thing
|
48
|
+
|
49
|
+
* Chroot users rejoice! By default, ZK.new will create a chrooted path for you.
|
50
|
+
|
51
|
+
ZK.new('localhost:2181/path', :chroot => :create) # the default, create the path before returning connection
|
52
|
+
|
53
|
+
ZK.new('localhost:2181/path', :chroot => :check) # make sure the chroot exists, raise if not
|
54
|
+
|
55
|
+
ZK.new('localhost:2181/path', :chroot => :do_nothing) # old default behavior
|
56
|
+
|
57
|
+
# and, just for kicks
|
58
|
+
|
59
|
+
ZK.new('localhost:2181', :chroot => '/path') # equivalent to 'localhost:2181/path', :chroot => :create
|
60
|
+
|
61
|
+
* Most of the event functionality used is now in a ZK::Event module. This is still mixed into the underlying slyphon-zookeeper class, but now all of the important and relevant methods are documented, and Event appears as a first-class citizen.
|
62
|
+
|
63
|
+
* Support for 1.8.7 WILL BE *DROPPED* in v1.1. You've been warned.
|
64
|
+
|
18
65
|
## What is ZooKeeper good for?
|
19
66
|
|
20
67
|
ZooKeeper is a multi-purpose tool that is designed to allow you to write code that coordinates many nodes in a cluster. It can be used as a directory service, a configuration database, and can provide cross-cluster [locking][], [leader election][], and [group membership][] (to name a few). It presents to the user what looks like a distributed file system, with a few important differences: every node can have children _and_ data, and there is a 1MB limit on data size for any given node. ZooKeeper provides atomic semantics and a simple API for manipulating data in the heirarchy.
|
data/RELEASES.markdown
CHANGED
@@ -2,8 +2,6 @@ This file notes feature differences and bugfixes contained between releases.
|
|
2
2
|
|
3
3
|
### v1.0.0 ###
|
4
4
|
|
5
|
-
* Support for 1.8.7 WILL BE *DROPPED* in v1.1. You've been warned.
|
6
|
-
|
7
5
|
* Threaded client (the default one) will now automatically reconnect (i.e. `reopen()`) if a `SESSION_EXPIRED` or `AUTH_FAILED` event is received. Thanks to @eric for pointing out the _nose-on-your-face obviousness_ and importance of this. If users want to handle these events themselves, and not automatically reopen, you can pass `:reconnect => false` to the constructor.
|
8
6
|
|
9
7
|
* allow for both :sequence and :sequential arguments to create, because I always forget which one is the "right one"
|
@@ -46,6 +44,8 @@ This file notes feature differences and bugfixes contained between releases.
|
|
46
44
|
|
47
45
|
* Most of the event functionality used is now in a ZK::Event module. This is still mixed into the underlying slyphon-zookeeper class, but now all of the important and relevant methods are documented, and Event appears as a first-class citizen.
|
48
46
|
|
47
|
+
* Support for 1.8.7 WILL BE *DROPPED* in v1.1. You've been warned.
|
48
|
+
|
49
49
|
### v0.9.1 ###
|
50
50
|
|
51
51
|
The "Don't forget to update the RELEASES file before pushing a new release" release
|
data/Rakefile
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'benchmark'
|
2
1
|
gemset_name = 'zk'
|
3
2
|
|
4
3
|
# this nonsense with the Gemfile symlinks is a bundler optimization
|
@@ -43,6 +42,7 @@ GEMSPEC_NAME = 'zk.gemspec'
|
|
43
42
|
end
|
44
43
|
|
45
44
|
task 'mb:test_all' do
|
45
|
+
require 'benchmark'
|
46
46
|
tm = Benchmark.realtime do
|
47
47
|
Rake::Task['mb:test_all_rubies'].invoke
|
48
48
|
end
|
data/lib/zk/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
|
11
|
-
- 1
|
12
|
-
version: 1.0.0.rc.1
|
10
|
+
version: 1.0.0
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Jonathan D. Simms
|
@@ -134,14 +132,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
133
|
none: false
|
136
134
|
requirements:
|
137
|
-
- - "
|
135
|
+
- - ">="
|
138
136
|
- !ruby/object:Gem::Version
|
139
|
-
hash:
|
137
|
+
hash: 3
|
140
138
|
segments:
|
141
|
-
-
|
142
|
-
|
143
|
-
- 1
|
144
|
-
version: 1.3.1
|
139
|
+
- 0
|
140
|
+
version: "0"
|
145
141
|
requirements: []
|
146
142
|
|
147
143
|
rubyforge_project:
|