ruby-druid 0.1.7 → 0.1.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 +6 -14
- data/README.md +10 -0
- data/lib/druid/client.rb +4 -3
- data/ruby-druid.gemspec +1 -1
- metadata +22 -22
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MDExNjUyM2QwZTFkOWU0NDhmYWIwNWRmMTc0MDQ4OGYzYzg0NmM1NTgzNDc5
|
10
|
-
ZjQ5MmRiYjU2ZGUwYzA2OGMzYmU3OTMzMWE1YTIwMjJhM2EwNTYzMWFiYTA0
|
11
|
-
YTAwMGU1N2JmZjdlYmRlYjllMjE0NjkzOWRjZTkyYzAyMjlhYWQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MWQ3NjdjZDYzMzM2MzdjYWU0OTc0NGFhYTRiMjNhMDcxMTY4ZmEyZmFlNjg2
|
14
|
-
MWViZjgyMGY0OWVjYzNmOTVkMjMwZTg3MTY0ODc3MmIyNTIyMDEzYTA0ZDRk
|
15
|
-
MDliMGUzYWI3MWQ0MjQ2ZjU5ZWVkZDM1ZWRmYWY0YjU2YmY2MGM=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: adfe39dfd535cfb911d89bece7d3921b8e63c162
|
4
|
+
data.tar.gz: 74fcfe3637e3131dfb9e057c3ee1c33ff62840bf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d06463d4a10c5d142f09b71acb3785bf8906cf5cf1719995b60006499754d609fce7ba1ed9b23ea338dd1587bb6b6bc967509c696ba2c09fc80e1a67367b529f
|
7
|
+
data.tar.gz: a6726f41601627488627aeeedc55163b2e65602d3845dacf0a1bcb66ec412d7dca8333cdeb440a860046ac75a93447132cd0ed5d250d5094532ae50743cda7d9
|
data/README.md
CHANGED
@@ -48,6 +48,16 @@ each row. The timestamp by can be received by a method with the same name
|
|
48
48
|
(i.e. `row.timestamp`), all row values by hashlike syntax (i.e.
|
49
49
|
`row['dimension'])
|
50
50
|
|
51
|
+
An options hash can be passed when creating `Druid::Client` instance:
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
client = Druid::Client.new('zk1:2181,zk2:2181/druid', http_timeout: 20)
|
55
|
+
```
|
56
|
+
|
57
|
+
Supported options are:
|
58
|
+
* `static_setup` to explicitly specify a broker url, e.g. `static_setup: { 'my/source_name' => 'http://1.2.3.4:8080/druid/v2/' }`
|
59
|
+
* `http_timeout` to define a timeout for sending http queries to a broker (in minutes, default value is 2)
|
60
|
+
|
51
61
|
### GroupBy
|
52
62
|
|
53
63
|
A [GroupByQuery](https://github.com/metamx/druid/wiki/GroupByQuery) sets the
|
data/lib/druid/client.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module Druid
|
2
2
|
class Client
|
3
|
-
TIMEOUT = 2 * 60 * 1000
|
4
3
|
|
5
4
|
def initialize(zookeeper_uri, opts = nil)
|
6
5
|
opts ||= {}
|
@@ -11,6 +10,8 @@ module Druid
|
|
11
10
|
@backup = opts[:static_setup] if opts[:fallback]
|
12
11
|
zookeeper_caching_management!(zookeeper_uri, opts)
|
13
12
|
end
|
13
|
+
|
14
|
+
@http_timeout = opts[:http_timeout] || 2 * 60
|
14
15
|
end
|
15
16
|
|
16
17
|
def send(query)
|
@@ -21,7 +22,7 @@ module Druid
|
|
21
22
|
req.body = query.to_json
|
22
23
|
|
23
24
|
response = Net::HTTP.new(uri.host, uri.port).start do |http|
|
24
|
-
http.read_timeout =
|
25
|
+
http.read_timeout = @http_timeout
|
25
26
|
http.request(req)
|
26
27
|
end
|
27
28
|
|
@@ -77,7 +78,7 @@ module Druid
|
|
77
78
|
req = Net::HTTP::Get.new(meta_path)
|
78
79
|
|
79
80
|
response = Net::HTTP.new(uri.host, uri.port).start do |http|
|
80
|
-
http.read_timeout =
|
81
|
+
http.read_timeout = @http_timeout
|
81
82
|
http.request(req)
|
82
83
|
end
|
83
84
|
|
data/ruby-druid.gemspec
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-druid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LiquidM, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zk
|
15
|
-
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
23
21
|
requirements:
|
24
|
-
- -
|
22
|
+
- - '>='
|
25
23
|
- !ruby/object:Gem::Version
|
26
24
|
version: '0'
|
25
|
+
prerelease: false
|
26
|
+
type: :runtime
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rest-client
|
29
|
-
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
|
-
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
37
35
|
requirements:
|
38
|
-
- -
|
36
|
+
- - '>='
|
39
37
|
- !ruby/object:Gem::Version
|
40
38
|
version: '0'
|
39
|
+
prerelease: false
|
40
|
+
type: :runtime
|
41
41
|
description: Ruby client for metamx druid
|
42
42
|
email:
|
43
43
|
- opensource@liquidm.com
|
@@ -72,24 +72,24 @@ homepage: https://github.com/liquidm/ruby-druid
|
|
72
72
|
licenses:
|
73
73
|
- MIT
|
74
74
|
metadata: {}
|
75
|
-
post_install_message:
|
75
|
+
post_install_message:
|
76
76
|
rdoc_options: []
|
77
77
|
require_paths:
|
78
78
|
- lib
|
79
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - '>='
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
92
|
-
signing_key:
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.2.2
|
92
|
+
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Ruby client for metamx druid
|
95
95
|
test_files:
|
@@ -97,4 +97,4 @@ test_files:
|
|
97
97
|
- spec/lib/query_spec.rb
|
98
98
|
- spec/lib/zoo_handler_spec.rb
|
99
99
|
- spec/spec_helper.rb
|
100
|
-
has_rdoc:
|
100
|
+
has_rdoc:
|