druid_config 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/druid_config/entities/data_source.rb +51 -0
- data/lib/druid_config/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afe7ee37715de2ecf08282e55c33fc67620b32c6
|
4
|
+
data.tar.gz: 167c6181c42cc87102c2fd5f8339e8cd461354c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 571ba6d0d2493d88bb3b67926b14bf864c9c6f3897505e68610a8ebf2ab0df733a48068c532a3286f8cdfd945210b91ad6bca635d1500e3f146a4c56e0a31c32
|
7
|
+
data.tar.gz: 0004ae8c20b1e9248a5ae6a11a42732b0c42fa3f19b5f7bcd577534a9acefeeb6da489039ac6c8e9dec162dbdccabe96252b0dfda5146faba015f52c64528d23
|
@@ -41,6 +41,44 @@ module DruidConfig
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
# Enable the current data source
|
45
|
+
#
|
46
|
+
def enable
|
47
|
+
secure_query do
|
48
|
+
self.class.post("/datasources/#{@name}")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Disable the current data source
|
53
|
+
#
|
54
|
+
def disable
|
55
|
+
secure_query do
|
56
|
+
self.class.delete("/datasources/#{@name}")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Destroy the current data source. Becareful, this action will remove the
|
61
|
+
# data associated to the data source
|
62
|
+
#
|
63
|
+
# @param interval [String] Optional parameter to define the interval to
|
64
|
+
# destroy the data associated to the data source. By default, it will
|
65
|
+
# destroy all data.
|
66
|
+
#
|
67
|
+
# @return [Hash, nil] Hash with error or nil
|
68
|
+
#
|
69
|
+
def destroy(interval = nil)
|
70
|
+
interval = all_interval unless interval
|
71
|
+
# Disable data source
|
72
|
+
disable
|
73
|
+
# Execute kill task
|
74
|
+
secure_query do
|
75
|
+
self.class.delete(
|
76
|
+
"/datasources/#{@name}?kill=true&interval=#{interval}")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Destroy current data source
|
81
|
+
|
44
82
|
# Intervals
|
45
83
|
# -----------------
|
46
84
|
def intervals(params = '')
|
@@ -126,6 +164,19 @@ module DruidConfig
|
|
126
164
|
|
127
165
|
private
|
128
166
|
|
167
|
+
# Return an ISO8601 interval from 0 to tomorrow. This is used to destroy
|
168
|
+
# all the data of a data source
|
169
|
+
#
|
170
|
+
# @return [String] ISO8601 interval
|
171
|
+
#
|
172
|
+
def all_interval
|
173
|
+
beginning = '1970-01-01T00:00:00Z'
|
174
|
+
# We use today + 1.day to ensure all data is deleted
|
175
|
+
last = (Time.now + 24*60*60).strftime('%Y-%m-%dT%H:%M:00Z')
|
176
|
+
# Return the interval
|
177
|
+
"#{beginning}/#{last}"
|
178
|
+
end
|
179
|
+
|
129
180
|
#
|
130
181
|
# Save rules of this data source
|
131
182
|
#
|
data/lib/druid_config/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: druid_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angel M Miguel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zk
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
202
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.2.2
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: Fetch Druid info and configure your cluster
|
@@ -210,4 +210,3 @@ test_files:
|
|
210
210
|
- spec/data_source_spec.rb
|
211
211
|
- spec/node_spec.rb
|
212
212
|
- spec/spec_helper.rb
|
213
|
-
has_rdoc:
|