mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
96ff365997
commit
dfb423a60f
1 changed files with 2 additions and 7 deletions
|
@ -6,7 +6,7 @@ module LogStash; module Util
|
||||||
java_import java.util.concurrent.TimeUnit
|
java_import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@queue = java.util.concurrent.SynchronousQueue.new
|
@queue = SynchronousQueue.new
|
||||||
end
|
end
|
||||||
|
|
||||||
# Push an object to the queue if the queue is full
|
# Push an object to the queue if the queue is full
|
||||||
|
@ -103,12 +103,7 @@ module LogStash; module Util
|
||||||
|
|
||||||
def read_batch
|
def read_batch
|
||||||
batch = new_batch
|
batch = new_batch
|
||||||
@mutex.lock
|
batch.read_next
|
||||||
begin
|
|
||||||
batch.read_next
|
|
||||||
ensure
|
|
||||||
@mutex.unlock
|
|
||||||
end
|
|
||||||
start_metrics(batch)
|
start_metrics(batch)
|
||||||
batch
|
batch
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue