Class: LogStash::PluginMixins::JdbcStreaming::RowCache

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/plugin_mixins/jdbc_streaming.rb

Instance Method Summary collapse

Constructor Details

#initialize(size, ttl) ⇒ RowCache

Returns a new instance of RowCache.



8
9
10
# File 'lib/logstash/plugin_mixins/jdbc_streaming.rb', line 8

def initialize(size, ttl)
  @cache = ::LruRedux::TTL::ThreadSafeCache.new(size, ttl)
end

Instance Method Details

#get(parameters) ⇒ Object



12
13
14
# File 'lib/logstash/plugin_mixins/jdbc_streaming.rb', line 12

def get(parameters)
  @cache.getset(parameters) { yield }
end