fluent-plugin-groonga 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +8 -0
- data/fluent-plugin-groonga.gemspec +1 -1
- data/lib/fluent/plugin/in_groonga.rb +29 -6
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bc265b245e6b9c918bfdc1834791265151c8ba3
|
4
|
+
data.tar.gz: 0b6c197b73a5c68fa979390206f23dc32d43dc0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ad67248ed757b0c8c4536eafd4a50899b3a4e2d001d56b1793a0481d2ee41c1a4f21be3914fbbd68ea81d6a6e76fca8e8ea46d92aaff9ba759a651032fac15
|
7
|
+
data.tar.gz: 39b32665c9bb1a0442a08b1e03c03c89ddffaaedaa61582e15a1d164880fcc2504fbee61b9d987bcef8a4e8a390c21809b8ecb1ac97f3f3b28638a862bccd7d6
|
data/doc/text/news.md
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
Gem::Specification.new do |spec|
|
19
19
|
spec.name = "fluent-plugin-groonga"
|
20
|
-
spec.version = "1.1.
|
20
|
+
spec.version = "1.1.4"
|
21
21
|
spec.authors = ["Kouhei Sutou"]
|
22
22
|
spec.email = ["kou@clear-code.com"]
|
23
23
|
spec.summary = "Fluentd plugin to store data into Groonga and implement Groonga replication system."
|
@@ -72,7 +72,7 @@ module Fluent
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def on_read(data)
|
75
|
-
@handler.
|
75
|
+
@handler.write_back(data)
|
76
76
|
end
|
77
77
|
|
78
78
|
def on_close
|
@@ -213,6 +213,10 @@ module Fluent
|
|
213
213
|
def on_connect
|
214
214
|
@repeater = @input.create_repeater(self)
|
215
215
|
@repeater.on_connect_failed do
|
216
|
+
$log.error("[input][groonga][error] " +
|
217
|
+
"failed to connect to Groonga:",
|
218
|
+
:real_host => @input.real_host,
|
219
|
+
:real_port => @input.real_port)
|
216
220
|
close
|
217
221
|
end
|
218
222
|
@request_handler = RequestHandler.new(@input, @repeater)
|
@@ -222,18 +226,24 @@ module Fluent
|
|
222
226
|
def on_read(data)
|
223
227
|
begin
|
224
228
|
@request_handler << data
|
225
|
-
rescue HTTP::Parser::Error
|
229
|
+
rescue HTTP::Parser::Error, URI::InvalidURIError
|
226
230
|
$log.error("[input][groonga][error] " +
|
227
231
|
"failed to parse HTTP request:",
|
228
|
-
:error => $!.
|
232
|
+
:error => "#{$!.class}: #{$!}")
|
229
233
|
$log.error_backtrace
|
230
|
-
|
234
|
+
reply_error_response("400 Bad Request")
|
235
|
+
rescue
|
236
|
+
$log.error("[input][groonga][error] " +
|
237
|
+
"failed to handle HTTP request:",
|
238
|
+
:error => "#{$!.class}: #{$!}")
|
239
|
+
$log.error_backtrace
|
240
|
+
reply_error_response("500 Internal Server Error")
|
231
241
|
end
|
232
242
|
end
|
233
243
|
|
234
|
-
def
|
244
|
+
def write_back(data)
|
235
245
|
@response_handler << data
|
236
|
-
|
246
|
+
write(data)
|
237
247
|
end
|
238
248
|
|
239
249
|
def on_response_complete(response)
|
@@ -261,6 +271,19 @@ module Fluent
|
|
261
271
|
false
|
262
272
|
end
|
263
273
|
end
|
274
|
+
|
275
|
+
def reply_error_response(status)
|
276
|
+
write("HTTP1.1 #{status}\r\n")
|
277
|
+
write("Server: fluent-plugin-groonga\r\n")
|
278
|
+
write("Connection: close\r\n")
|
279
|
+
write("Content-Length: 0\r\n")
|
280
|
+
write("\r\n")
|
281
|
+
disable
|
282
|
+
@repeater.close
|
283
|
+
on_write_complete do
|
284
|
+
close
|
285
|
+
end
|
286
|
+
end
|
264
287
|
end
|
265
288
|
|
266
289
|
class RequestHandler
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-groonga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -193,9 +193,8 @@ summary: Fluentd plugin to store data into Groonga and implement Groonga replica
|
|
193
193
|
system.
|
194
194
|
test_files:
|
195
195
|
- test/test_input.rb
|
196
|
-
- test/
|
197
|
-
- test/test_output.rb
|
196
|
+
- test/output/test_table_definition.rb
|
198
197
|
- test/output/test_table_index_definition.rb
|
199
198
|
- test/output/test_type_guesser.rb
|
200
|
-
- test/
|
201
|
-
|
199
|
+
- test/run-test.rb
|
200
|
+
- test/test_output.rb
|