forked from rapid7/cassandra-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
daemon.rb
41 lines (33 loc) · 929 Bytes
/
daemon.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'daemon_runner'
module Cassandra
module Utils
class Daemon < ::DaemonRunner::Client
def tasks
[
[seed_registry_task, 'run!'],
[auto_clean_task, 'run!'],
[health_stat, 'run!'],
[compaction_stat, 'run!'],
[cleanup_stat, 'run!']
]
end
private
def seed_registry_task
name = options[:seed_service_name]
@seed_registry_task ||= ::Cassandra::Tasks::SeedRegistry.new(name)
end
def auto_clean_task
@auto_clean_task ||= ::Cassandra::Tasks::Autoclean.new(options)
end
def health_stat
@health_stat ||= ::Cassandra::Utils::Stats::Health.new
end
def compaction_stat
@compaction_stat ||= ::Cassandra::Utils::Stats::Compaction.new
end
def cleanup_stat
@cleanup_stat ||= ::Cassandra::Utils::Stats::Cleanup.new
end
end
end
end