lib/logstash/codecs/identity_map_codec.rb in logstash-codec-multiline-3.1.0 vs lib/logstash/codecs/identity_map_codec.rb in logstash-codec-multiline-3.1.1
- old
+ new
@@ -288,10 +288,11 @@
# we 'borrow' the codec's logger as we don't have our own
@base_codec.logger
end
def codec_without_usage_update(identity)
+ return base_codec if identity.nil? # mirror optimization in `stream_codec`
find_codec_value(identity).codec
end
def eviction_timestamp_for(identity)
find_codec_value(identity).eviction_timeout
@@ -334,10 +335,10 @@
UpperLimitReached.visit(self)
EightyPercentWarning.visit(self)
end
def codec_builder(hash, k)
- codec = hash.empty? ? @base_codec : @base_codec.clone
+ codec = @base_codec.clone
codec.use_mapper_auto_flush if using_mapped_auto_flush?
compo = CodecValue.new(codec).tap do |o|
now = Time.now
o.eviction_timeout = eviction_timestamp(now)
o.auto_flush_timeout = auto_flush_timestamp(now)