MINOR+PERFORMANCE: Cleanup constructor of WrappedSynchronousQueue::ReadBatch

Fixes #8433
This commit is contained in:
Armin 2017-10-04 19:36:07 +02:00 committed by Armin Braun
parent b651f30f99
commit cdbcbe0472

View file

@ -156,17 +156,12 @@ module LogStash; module Util
class ReadBatch
def initialize(queue, size, wait)
@queue = queue.queue
@size = size
@wait = wait
# TODO: disabled for https://github.com/elastic/logstash/issues/6055 - will have to properly refactor
# @cancelled = Hash.new
#Sizing HashSet to size/load_factor to ensure no rehashing
@is_iterating = false # Atomic Boolean maybe? Although batches are not shared across threads
@acked_batch = nil
@originals = LsQueueUtils.drain(@queue, @size, @wait)
@originals = LsQueueUtils.drain(queue.queue, size, wait)
end
def merge(event)