module LogStash::Codecs::IdentityMapCodec::UpperLimitReached

Public Instance Methods

visit(imc) click to toggle source
# 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