fluentd-hubspot 0.14.14.1 → 0.14.14.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fluent/plugin/buf_file.rb +2 -6
- data/lib/fluent/plugin/buffer.rb +11 -11
- data/lib/fluent/version.rb +1 -1
- metadata +2 -2
@@ -170,14 +170,10 @@ module Fluent
|
|
170
170
|
def generate_chunk(metadata)
|
171
171
|
# FileChunk generates real path with unique_id
|
172
172
|
if @file_permission
|
173
|
-
|
173
|
+
Fluent::Plugin::Buffer::FileChunk.new(metadata, @path, :create, perm: @file_permission, compress: @compress)
|
174
174
|
else
|
175
|
-
|
175
|
+
Fluent::Plugin::Buffer::FileChunk.new(metadata, @path, :create, compress: @compress)
|
176
176
|
end
|
177
|
-
|
178
|
-
log.debug "Created new chunk", chunk_id: dump_unique_id_hex(chunk.unique_id), metadata: metadata
|
179
|
-
|
180
|
-
return chunk
|
181
177
|
end
|
182
178
|
end
|
183
179
|
end
|
data/lib/fluent/plugin/buffer.rb
CHANGED
@@ -312,7 +312,7 @@ module Fluent
|
|
312
312
|
end
|
313
313
|
|
314
314
|
def enqueue_chunk(metadata)
|
315
|
-
log.
|
315
|
+
log.debug "enqueueing chunk", instance: self.object_id, metadata: metadata
|
316
316
|
synchronize do
|
317
317
|
chunk = @stage.delete(metadata)
|
318
318
|
return nil unless chunk
|
@@ -334,7 +334,7 @@ module Fluent
|
|
334
334
|
end
|
335
335
|
|
336
336
|
def enqueue_unstaged_chunk(chunk)
|
337
|
-
log.
|
337
|
+
log.debug "enqueueing unstaged chunk", instance: self.object_id, metadata: chunk.metadata
|
338
338
|
synchronize do
|
339
339
|
chunk.synchronize do
|
340
340
|
metadata = chunk.metadata
|
@@ -347,7 +347,7 @@ module Fluent
|
|
347
347
|
end
|
348
348
|
|
349
349
|
def enqueue_all
|
350
|
-
log.
|
350
|
+
log.debug "enqueueing all chunks in buffer", instance: self.object_id
|
351
351
|
synchronize do
|
352
352
|
if block_given?
|
353
353
|
@stage.keys.each do |metadata|
|
@@ -365,7 +365,7 @@ module Fluent
|
|
365
365
|
|
366
366
|
def dequeue_chunk
|
367
367
|
return nil if @queue.empty?
|
368
|
-
log.
|
368
|
+
log.debug "dequeueing a chunk", instance: self.object_id
|
369
369
|
synchronize do
|
370
370
|
chunk = @queue.shift
|
371
371
|
|
@@ -374,18 +374,18 @@ module Fluent
|
|
374
374
|
|
375
375
|
@dequeued[chunk.unique_id] = chunk
|
376
376
|
@queued_num[chunk.metadata] -= 1 # BUG if nil, 0 or subzero
|
377
|
-
log.
|
377
|
+
log.debug "chunk dequeued", instance: self.object_id, metadata: chunk.metadata
|
378
378
|
chunk
|
379
379
|
end
|
380
380
|
end
|
381
381
|
|
382
382
|
def takeback_chunk(chunk_id)
|
383
|
-
log.
|
383
|
+
log.debug "taking back a chunk", instance: self.object_id, chunk_id: dump_unique_id_hex(chunk_id)
|
384
384
|
synchronize do
|
385
385
|
chunk = @dequeued.delete(chunk_id)
|
386
386
|
return false unless chunk # already purged by other thread
|
387
387
|
@queue.unshift(chunk)
|
388
|
-
log.
|
388
|
+
log.debug "chunk taken back", instance: self.object_id, chunk_id: dump_unique_id_hex(chunk_id), metadata: chunk.metadata
|
389
389
|
@queued_num[chunk.metadata] += 1 # BUG if nil
|
390
390
|
end
|
391
391
|
true
|
@@ -397,7 +397,7 @@ module Fluent
|
|
397
397
|
return nil unless chunk # purged by other threads
|
398
398
|
|
399
399
|
metadata = chunk.metadata
|
400
|
-
log.
|
400
|
+
log.debug "purging a chunk", instance: self.object_id, chunk_id: dump_unique_id_hex(chunk_id), metadata: metadata
|
401
401
|
begin
|
402
402
|
bytesize = chunk.bytesize
|
403
403
|
chunk.purge
|
@@ -410,18 +410,18 @@ module Fluent
|
|
410
410
|
if metadata && !@stage[metadata] && (!@queued_num[metadata] || @queued_num[metadata] < 1)
|
411
411
|
@metadata_list.delete(metadata)
|
412
412
|
end
|
413
|
-
log.
|
413
|
+
log.debug "chunk purged", instance: self.object_id, chunk_id: dump_unique_id_hex(chunk_id), metadata: metadata
|
414
414
|
end
|
415
415
|
nil
|
416
416
|
end
|
417
417
|
|
418
418
|
def clear_queue!
|
419
|
-
log.
|
419
|
+
log.debug "clearing queue", instance: self.object_id
|
420
420
|
synchronize do
|
421
421
|
until @queue.empty?
|
422
422
|
begin
|
423
423
|
q = @queue.shift
|
424
|
-
log.
|
424
|
+
log.debug("purging a chunk in queue"){ {id: dump_unique_id_hex(chunk.unique_id), bytesize: chunk.bytesize, size: chunk.size} }
|
425
425
|
q.purge
|
426
426
|
rescue => e
|
427
427
|
log.error "unexpected error while clearing buffer queue", error_class: e.class, error: e
|
data/lib/fluent/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd-hubspot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.14.
|
4
|
+
version: 0.14.14.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-10-
|
12
|
+
date: 2017-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: msgpack
|