Module: LogStash::Codecs::IdentityMapCodec::UpperLimitReached

Extended by:
UpperLimitReached
Included in:
UpperLimitReached
Defined in:
lib/logstash/codecs/identity_map_codec.rb

Instance Method Summary collapse

Instance Method Details

#visit(imc) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/logstash/codecs/identity_map_codec.rb', line 27

def visit(imc)
  current_size, limit = imc.current_size_and_limit
  return if current_size < limit
  # we hit the limit
  # try to clean out stale streams
  current_size, limit = imc.map_cleanup
  return if current_size < limit
  # we are still at the limit and all streams are in use
  imc.logger.error("IdentityMapCodec has reached 100% capacity",
      :current_size => current_size, :upper_limit => limit)
  raise IdentityMapUpperLimitException.new
end