cellect-server 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cellect/server/adapters/postgres.rb +1 -1
- data/lib/cellect/version.rb +1 -1
- data/spec/server/api/add_seen_spec.rb +3 -3
- data/spec/server/api/add_spec.rb +5 -5
- data/spec/server/api/remove_spec.rb +3 -3
- data/spec/server/api/sample_spec.rb +6 -6
- data/spec/server/api/user_load_spec.rb +3 -3
- data/spec/server/grouped_workflow_spec.rb +10 -10
- data/spec/server/node_set_spec.rb +2 -2
- data/spec/server/server_spec.rb +6 -6
- data/spec/server/user_spec.rb +7 -7
- data/spec/server/workflow_spec.rb +10 -10
- data/spec/spec_helper.rb +2 -2
- data/spec/support/shared_examples_for_node_set.rb +6 -6
- data/spec/support/shared_examples_for_set.rb +4 -4
- data/spec/support/shared_examples_for_workflow.rb +8 -8
- data/spec/support/zk_setup.rb +27 -25
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e99eedbb031e30c30aa5a1115f3620f5e2e4cf3
|
4
|
+
data.tar.gz: 06dbf151721e9abdb0c3c518de248f8809e972a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4911bddd166a8258fa63fde6dd767159e848217c736d9c8390496150ba113cd9dbc35b092631a17d300b16670b73cd7e3a7e0bdfdb36052ff6c7c797d462816
|
7
|
+
data.tar.gz: 02043a81baca72f5d2a640a0d0d4909beae0751265e79bab6b4263ffd78661935b465ad16625c61ea6ad1bbadd051dff79c0ff7d0f20a5f7bfa5b54306999099
|
@@ -32,7 +32,7 @@ module Cellect
|
|
32
32
|
FROM workflows w
|
33
33
|
JOIN subject_sets_workflows ssw ON (ssw.workflow_id = w.id)
|
34
34
|
JOIN subject_sets ss ON (ss.id = ssw.subject_set_id)
|
35
|
-
JOIN set_member_subjects sms ON (
|
35
|
+
JOIN set_member_subjects sms ON (ss.id = sms.subject_set_id)
|
36
36
|
WHERE w.id = #{ workflow_name }
|
37
37
|
SQL
|
38
38
|
pg.exec(statement).collect do |row|
|
data/lib/cellect/version.rb
CHANGED
@@ -14,10 +14,10 @@ module Cellect::Server
|
|
14
14
|
|
15
15
|
it 'should add seen subjects' do
|
16
16
|
async_workflow = double
|
17
|
-
workflow.
|
18
|
-
async_workflow.
|
17
|
+
expect(workflow).to receive(:async).and_return async_workflow
|
18
|
+
expect(async_workflow).to receive(:add_seen_for).with 123, 123
|
19
19
|
put "/workflows/#{ workflow_type }/users/123/add_seen", subject_id: 123
|
20
|
-
last_response.status.
|
20
|
+
expect(last_response.status).to eq 200
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/spec/server/api/add_spec.rb
CHANGED
@@ -21,17 +21,17 @@ module Cellect::Server
|
|
21
21
|
|
22
22
|
it 'should add subjects' do
|
23
23
|
if workflow.grouped? && workflow.prioritized?
|
24
|
-
workflow.
|
24
|
+
expect(workflow).to receive(:add).with subject_id: 123, group_id: 1, priority: 456.0
|
25
25
|
elsif workflow.grouped?
|
26
|
-
workflow.
|
26
|
+
expect(workflow).to receive(:add).with subject_id: 123, group_id: 1, priority: nil
|
27
27
|
elsif workflow.prioritized?
|
28
|
-
workflow.
|
28
|
+
expect(workflow).to receive(:add).with subject_id: 123, group_id: nil, priority: 456.0
|
29
29
|
else
|
30
|
-
workflow.
|
30
|
+
expect(workflow).to receive(:add).with subject_id: 123, group_id: nil, priority: nil
|
31
31
|
end
|
32
32
|
|
33
33
|
put "/workflows/#{ workflow_type }/add", opts
|
34
|
-
last_response.status.
|
34
|
+
expect(last_response.status).to eq 200
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -20,13 +20,13 @@ module Cellect::Server
|
|
20
20
|
|
21
21
|
it 'should remove subjects' do
|
22
22
|
if workflow.grouped?
|
23
|
-
workflow.
|
23
|
+
expect(workflow).to receive(:remove).with subject_id: 123, group_id: 1, priority: nil
|
24
24
|
else
|
25
|
-
workflow.
|
25
|
+
expect(workflow).to receive(:remove).with subject_id: 123, group_id: nil, priority: nil
|
26
26
|
end
|
27
27
|
|
28
28
|
put "/workflows/#{ workflow_type }/remove", opts
|
29
|
-
last_response.status.
|
29
|
+
expect(last_response.status).to eq 200
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -13,19 +13,19 @@ module Cellect::Server
|
|
13
13
|
before(:each){ pass_until workflow, is: :ready }
|
14
14
|
|
15
15
|
it 'should sample without a user, limit, or group' do
|
16
|
-
workflow.
|
16
|
+
expect(workflow).to receive(:sample).with(limit: 5, user_id: nil, group_id: nil).and_call_original
|
17
17
|
get "/workflows/#{ workflow_type }"
|
18
|
-
last_response.status.
|
19
|
-
json.
|
18
|
+
expect(last_response.status).to eq 200
|
19
|
+
expect(json).to be_a Array
|
20
20
|
end
|
21
21
|
|
22
22
|
shoulda = grouping ? 'limit, group, and user' : 'limit and user'
|
23
23
|
it "should sample with a #{ shoulda }" do
|
24
24
|
group_id = grouping ? 1 : nil
|
25
|
-
workflow.
|
25
|
+
expect(workflow).to receive(:sample).with(limit: 3, user_id: 123, group_id: group_id).and_call_original
|
26
26
|
get "/workflows/#{ workflow_type }?limit=3&user_id=123#{ grouping ? '&group_id=1' : '' }"
|
27
|
-
last_response.status.
|
28
|
-
json.
|
27
|
+
expect(last_response.status).to eq 200
|
28
|
+
expect(json).to be_a Array
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -13,10 +13,10 @@ module Cellect::Server
|
|
13
13
|
|
14
14
|
it 'should load users' do
|
15
15
|
async_workflow = double
|
16
|
-
workflow.
|
17
|
-
async_workflow.
|
16
|
+
expect(workflow).to receive(:async).and_return async_workflow
|
17
|
+
expect(async_workflow).to receive(:user).with 123
|
18
18
|
post "/workflows/#{ workflow_type }/users/123/load"
|
19
|
-
last_response.status.
|
19
|
+
expect(last_response.status).to eq 201
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -13,39 +13,39 @@ module Cellect::Server
|
|
13
13
|
it 'should provide unseen from a random group for users' do
|
14
14
|
workflow.groups = { }
|
15
15
|
workflow.groups[1] = set_klass.new
|
16
|
-
workflow.groups[1].
|
16
|
+
expect(workflow.groups[1]).to receive(:subtract).with user.seen, 3
|
17
17
|
workflow.unseen_for 123, limit: 3
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'should provide unseen from a specific group for users' do
|
21
21
|
3.times{ |i| workflow.groups[i] = set_klass.new }
|
22
|
-
workflow.group(1).
|
22
|
+
expect(workflow.group(1)).to receive(:subtract).with user.seen, 3
|
23
23
|
workflow.unseen_for 123, group_id: 1, limit: 3
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should sample subjects from a random group without a user' do
|
27
27
|
workflow.groups = { }
|
28
28
|
workflow.groups[1] = set_klass.new
|
29
|
-
workflow.group(1).
|
29
|
+
expect(workflow.group(1)).to receive(:sample).with 3
|
30
30
|
workflow.sample limit: 3
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'should sample subjects from a specific group without a user' do
|
34
34
|
3.times{ |i| workflow.groups[i] = set_klass.new }
|
35
|
-
workflow.group(1).
|
35
|
+
expect(workflow.group(1)).to receive(:sample).with 3
|
36
36
|
workflow.sample group_id: 1, limit: 3
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'should sample subjects from a random group for a user' do
|
40
40
|
workflow.groups = { }
|
41
41
|
workflow.groups[1] = set_klass.new
|
42
|
-
workflow.groups[1].
|
42
|
+
expect(workflow.groups[1]).to receive(:subtract).with user.seen, 3
|
43
43
|
workflow.sample user_id: 123, limit: 3
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'should sample subjects from a specific group for a user' do
|
47
47
|
3.times{ |i| workflow.groups[i] = set_klass.new }
|
48
|
-
workflow.group(1).
|
48
|
+
expect(workflow.group(1)).to receive(:subtract).with user.seen, 3
|
49
49
|
workflow.sample user_id: 123, group_id: 1, limit: 3
|
50
50
|
end
|
51
51
|
|
@@ -53,22 +53,22 @@ module Cellect::Server
|
|
53
53
|
workflow.groups[1] = set_klass.new
|
54
54
|
|
55
55
|
if workflow.prioritized?
|
56
|
-
workflow.groups[1].
|
56
|
+
expect(workflow.groups[1]).to receive(:add).with 123, 456
|
57
57
|
workflow.add subject_id: 123, group_id: 1, priority: 456
|
58
58
|
else
|
59
|
-
workflow.groups[1].
|
59
|
+
expect(workflow.groups[1]).to receive(:add).with 123
|
60
60
|
workflow.add subject_id: 123, group_id: 1
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'should remove subjects' do
|
65
65
|
workflow.groups[1] = set_klass.new
|
66
|
-
workflow.groups[1].
|
66
|
+
expect(workflow.groups[1]).to receive(:remove).with 123
|
67
67
|
workflow.remove subject_id: 123, group_id: 1
|
68
68
|
end
|
69
69
|
|
70
70
|
it 'should be grouped' do
|
71
|
-
workflow.
|
71
|
+
expect(workflow).to be_grouped
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -6,8 +6,8 @@ module Cellect::Server
|
|
6
6
|
let(:node_set){ Cellect::Server.node_set.actors.first }
|
7
7
|
|
8
8
|
it 'should register this node' do
|
9
|
-
node_set.id.
|
10
|
-
node_set.zk.get('/nodes/node0000000000').first.
|
9
|
+
expect(node_set.id).to eq 'node0000000000'
|
10
|
+
expect(node_set.zk.get('/nodes/node0000000000').first).to match /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/spec/server/server_spec.rb
CHANGED
@@ -12,12 +12,12 @@ module Cellect::Server
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'should return a workflow given a set of options' do
|
15
|
-
default.workflow_for('name' => 'a').
|
16
|
-
default.workflow_for('name' => 'b', 'grouped' => true).
|
17
|
-
default.workflow_for('name' => 'c', 'pairwise' => true).
|
18
|
-
default.workflow_for('name' => 'd', 'prioritized' => true).
|
19
|
-
default.workflow_for('name' => 'e', 'pairwise' => true, 'prioritized' => true).
|
20
|
-
default.workflow_for('name' => 'e', 'pairwise' => true, 'prioritized' => true).
|
15
|
+
expect(default.workflow_for('name' => 'a')).to be_an_instance_of Workflow
|
16
|
+
expect(default.workflow_for('name' => 'b', 'grouped' => true)).to be_an_instance_of GroupedWorkflow
|
17
|
+
expect(default.workflow_for('name' => 'c', 'pairwise' => true)).to be_pairwise
|
18
|
+
expect(default.workflow_for('name' => 'd', 'prioritized' => true)).to be_prioritized
|
19
|
+
expect(default.workflow_for('name' => 'e', 'pairwise' => true, 'prioritized' => true)).to be_pairwise
|
20
|
+
expect(default.workflow_for('name' => 'e', 'pairwise' => true, 'prioritized' => true)).to be_prioritized
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/spec/server/user_spec.rb
CHANGED
@@ -5,28 +5,28 @@ module Cellect::Server
|
|
5
5
|
let(:user){ User.new 1, workflow_name: 'random' }
|
6
6
|
|
7
7
|
it 'should store seen ids' do
|
8
|
-
user.seen.
|
8
|
+
expect(user.seen).to be_a DiffSet::RandomSet
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'should have a default ttl of 15 minutes' do
|
12
|
-
user.ttl.
|
12
|
+
expect(user.ttl).to eq 900 # seconds
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'should allow custom ttl' do
|
16
|
-
User.new(2, workflow_name: 'random', ttl: 123).ttl.
|
16
|
+
expect(User.new(2, workflow_name: 'random', ttl: 123).ttl).to eq 123
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'should reset the ttl timer on activity' do
|
20
|
-
user.bare_object.
|
20
|
+
expect(user.bare_object).to receive(:restart_ttl_timer).at_least :once
|
21
21
|
user.seen
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'should terminate on ttl expiry' do
|
25
25
|
async_workflow = double
|
26
|
-
Workflow[user.workflow_name].
|
27
|
-
async_workflow.
|
26
|
+
expect(Workflow[user.workflow_name]).to receive(:async).and_return async_workflow
|
27
|
+
expect(async_workflow).to receive(:remove_user).with user.id
|
28
28
|
user.ttl_expired!
|
29
|
-
user.ttl_timer.
|
29
|
+
expect(user.ttl_timer).to be_nil
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -10,51 +10,51 @@ module Cellect::Server
|
|
10
10
|
before(:each){ pass_until workflow, is: :ready }
|
11
11
|
|
12
12
|
it 'should provide unseen for users' do
|
13
|
-
workflow.subjects.
|
13
|
+
expect(workflow.subjects).to receive(:subtract).with user.seen, 3
|
14
14
|
workflow.unseen_for 123, limit: 3
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'should sample subjects without a user' do
|
18
|
-
workflow.subjects.
|
18
|
+
expect(workflow.subjects).to receive(:sample).with 3
|
19
19
|
workflow.sample limit: 3
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'should sample subjects with a user' do
|
23
|
-
workflow.subjects.
|
23
|
+
expect(workflow.subjects).to receive(:subtract).with user.seen, 3
|
24
24
|
workflow.sample user_id: 123, limit: 3
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'should add subjects' do
|
28
28
|
if workflow.prioritized?
|
29
|
-
workflow.subjects.
|
29
|
+
expect(workflow.subjects).to receive(:add).with 123, 456
|
30
30
|
workflow.add subject_id: 123, priority: 456
|
31
31
|
else
|
32
|
-
workflow.subjects.
|
32
|
+
expect(workflow.subjects).to receive(:add).with 123
|
33
33
|
workflow.add subject_id: 123
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'should remove subjects' do
|
38
|
-
workflow.subjects.
|
38
|
+
expect(workflow.subjects).to receive(:add).with 123
|
39
39
|
workflow.add subject_id: 123
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'should be notified of a user ttl expiry' do
|
43
43
|
async_workflow = double
|
44
|
-
workflow.
|
45
|
-
async_workflow.
|
44
|
+
expect(workflow).to receive(:async).and_return async_workflow
|
45
|
+
expect(async_workflow).to receive(:remove_user).with user.id
|
46
46
|
user.ttl_expired!
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'should remove users when their ttl expires' do
|
50
50
|
id = user.id
|
51
51
|
workflow.remove_user id
|
52
|
-
workflow.users.
|
52
|
+
expect(workflow.users).to_not have_key id
|
53
53
|
expect{ user.id }.to raise_error
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'should not be grouped' do
|
57
|
-
workflow.
|
57
|
+
expect(workflow).to_not be_grouped
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -8,6 +8,7 @@ end
|
|
8
8
|
Bundler.require :test, :development
|
9
9
|
|
10
10
|
ENV['CELLECT_POOL_SIZE'] = '3'
|
11
|
+
SPAWN_ZK = !ENV['ZK_URL']
|
11
12
|
|
12
13
|
require 'pry'
|
13
14
|
require 'oj'
|
@@ -24,7 +25,6 @@ Cellect::Server.adapter = SpecAdapter.new
|
|
24
25
|
SET_TYPES = %w(random priority pairwise_random pairwise_priority)
|
25
26
|
|
26
27
|
RSpec.configure do |config|
|
27
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
28
28
|
config.run_all_when_everything_filtered = true
|
29
29
|
config.filter_run :focus
|
30
30
|
config.order = 'random'
|
@@ -37,6 +37,6 @@ RSpec.configure do |config|
|
|
37
37
|
end
|
38
38
|
|
39
39
|
config.after(:suite) do
|
40
|
-
`zkServer stop #{ CELLECT_ZK_CONFIG } > /dev/null 2>&1`
|
40
|
+
`zkServer stop #{ CELLECT_ZK_CONFIG } > /dev/null 2>&1` if SPAWN_ZK
|
41
41
|
end
|
42
42
|
end
|
@@ -2,24 +2,24 @@ shared_examples_for 'node set' do
|
|
2
2
|
let(:node_set){ Cellect::NodeSet.new }
|
3
3
|
|
4
4
|
it 'should connect to zoo keeper' do
|
5
|
-
node_set.zk.
|
5
|
+
expect(node_set.zk).to be_nil
|
6
6
|
pass_until node_set, is: :ready
|
7
|
-
node_set.zk.
|
7
|
+
expect(node_set.zk).to be_connected
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'should know the connection state' do
|
11
|
-
node_set.state.
|
11
|
+
expect(node_set.state).to be :initializing
|
12
12
|
pass_until node_set, is: :ready
|
13
|
-
node_set.
|
13
|
+
expect(node_set).to be_ready
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'should accept a connection string' do
|
17
17
|
begin
|
18
18
|
pass_until node_set, is: :ready
|
19
19
|
ENV['ZK_URL'] = 'foobar'
|
20
|
-
node_set.send(:zk_url).
|
20
|
+
expect(node_set.send(:zk_url)).to eq 'foobar'
|
21
21
|
ENV.delete 'ZK_URL'
|
22
|
-
node_set.send(:zk_url).
|
22
|
+
expect(node_set.send(:zk_url)).to eq 'localhost:2181'
|
23
23
|
ensure
|
24
24
|
ENV['ZK_URL'] = 'localhost:21811'
|
25
25
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
shared_examples_for 'a set' do
|
2
2
|
it 'should convert to an Array' do
|
3
|
-
set.to_a.
|
3
|
+
expect(set.to_a).to eq (1..5).to_a
|
4
4
|
end
|
5
5
|
|
6
6
|
it 'should add elements' do
|
7
7
|
set.add 100
|
8
|
-
set.to_a.
|
8
|
+
expect(set.to_a).to include 100
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'should remove elements' do
|
@@ -14,7 +14,7 @@ shared_examples_for 'a set' do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'should sample elements' do
|
17
|
-
set.sample(2).length.
|
17
|
+
expect(set.sample(2).length).to eq 2
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'should not include removed elements in samples' do
|
@@ -29,6 +29,6 @@ shared_examples_for 'a set' do
|
|
29
29
|
it 'should know if it contains an element' do
|
30
30
|
set.should_not include 100
|
31
31
|
set.add 100
|
32
|
-
set.
|
32
|
+
expect(set).to include 100
|
33
33
|
end
|
34
34
|
end
|
@@ -6,21 +6,21 @@ shared_examples_for 'workflow' do |name|
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'should add singleton instances to the registry' do
|
9
|
-
obj.class[:foo].
|
10
|
-
obj.class[:foo].object_id.
|
9
|
+
expect(obj.class[:foo]).to be_a_kind_of Cellect::Server::Workflow
|
10
|
+
expect(obj.class[:foo].object_id).to eq obj.class[:foo].object_id
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'should initialize empty' do
|
14
|
-
obj.name.
|
15
|
-
obj.users.
|
14
|
+
expect(obj.name).to be_a String
|
15
|
+
expect(obj.users).to be_a Hash
|
16
16
|
|
17
17
|
set_klass = obj.prioritized? ? DiffSet::PrioritySet : DiffSet::RandomSet
|
18
|
-
obj.subjects.
|
18
|
+
expect(obj.subjects).to be_a set_klass
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'should provide a user lookup' do
|
22
|
-
obj.user(1).
|
23
|
-
obj.user(1).object_id.
|
24
|
-
obj.users.keys.
|
22
|
+
expect(obj.user(1)).to be_a Cellect::Server::User
|
23
|
+
expect(obj.user(1).object_id).to eq obj.user(1).object_id
|
24
|
+
expect(obj.users.keys).to include 1
|
25
25
|
end
|
26
26
|
end
|
data/spec/support/zk_setup.rb
CHANGED
@@ -1,26 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
if SPAWN_ZK
|
2
|
+
zk_dir = File.join CELLECT_ROOT, 'tmp/zookeeper'
|
3
|
+
CELLECT_ZK_CONFIG = "#{ zk_dir }/zoo.cfg"
|
4
|
+
|
5
|
+
`rm -rf #{ zk_dir }; mkdir -p #{ zk_dir }`
|
6
|
+
|
7
|
+
File.open(CELLECT_ZK_CONFIG, 'w') do |out|
|
8
|
+
out.puts <<-TEXT
|
9
|
+
tickTime=2000
|
10
|
+
initLimit=10
|
11
|
+
syncLimit=5
|
12
|
+
dataDir=#{ zk_dir }
|
13
|
+
clientPort=21811
|
14
|
+
forceSync=no
|
15
|
+
snapCount=1000000
|
16
|
+
TEXT
|
17
|
+
end
|
18
|
+
|
19
|
+
if `echo ruok | nc 127.0.0.1 21811`.chomp == 'imok'
|
20
|
+
pid = `ps aux | grep -e 'Cellect[\/]tmp[\/]zookeeper'`.split[1]
|
21
|
+
puts "Killing rogue zookeeper process: #{ pid }..."
|
22
|
+
`kill -s TERM #{ pid }`
|
23
|
+
sleep 1
|
24
|
+
end
|
25
|
+
|
26
|
+
`zkServer start #{ CELLECT_ZK_CONFIG } > /dev/null 2>&1`
|
27
|
+
ENV['ZK_URL'] = 'localhost:21811'
|
16
28
|
end
|
17
|
-
|
18
|
-
if `echo ruok | nc 127.0.0.1 21811`.chomp == 'imok'
|
19
|
-
pid = `ps aux | grep -e 'Cellect[\/]tmp[\/]zookeeper'`.split[1]
|
20
|
-
puts "Killing rogue zookeeper process: #{ pid }..."
|
21
|
-
`kill -s TERM #{ pid }`
|
22
|
-
sleep 1
|
23
|
-
end
|
24
|
-
|
25
|
-
`zkServer start #{ CELLECT_ZK_CONFIG } > /dev/null 2>&1`
|
26
|
-
ENV['ZK_URL'] = 'localhost:21811'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cellect-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Parrish
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
304
|
rubyforge_project:
|
305
|
-
rubygems_version: 2.
|
305
|
+
rubygems_version: 2.4.2
|
306
306
|
signing_key:
|
307
307
|
specification_version: 4
|
308
308
|
summary: ''
|