Module: Fluent::Plugin::RedisEnrichmentFilter::Cache

Defined in:
lib/fluent/plugin/filter_redis_enrichment.rb

Defined Under Namespace

Classes: FullCache, LazyCache, NoCache

Class Method Summary collapse

Class Method Details

.new(redis:, type: DEFAULT_CACHE_TYPE, size: DEFAULT_CACHE_SIZE, ttl: DEFAULT_CACHE_TTL, log: nil) ⇒ Object



181
182
183
184
185
186
187
188
189
# File 'lib/fluent/plugin/filter_redis_enrichment.rb', line 181

def self.new(redis:, type: DEFAULT_CACHE_TYPE, size: DEFAULT_CACHE_SIZE, ttl: DEFAULT_CACHE_TTL, log: nil)
  klass = case type
          when :lazy then LazyCache
          when :full then FullCache
          else
            NoCache
          end
  klass.new(redis: redis, size: size, ttl: ttl, log: log)
end