Class: LogStash::Filters::FetchStrategy::File::Exact

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filters/fetch_strategy/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(dictionary, rw_lock) ⇒ Exact

Returns a new instance of Exact.



5
6
7
8
# File 'lib/logstash/filters/fetch_strategy/file.rb', line 5

def initialize(dictionary, rw_lock)
  @dictionary = dictionary
  @read_lock = rw_lock.readLock
end

Instance Method Details

#dictionary_updatedObject



10
11
# File 'lib/logstash/filters/fetch_strategy/file.rb', line 10

def dictionary_updated
end

#fetch(source, results) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/logstash/filters/fetch_strategy/file.rb', line 13

def fetch(source, results)
  @read_lock.lock
  begin
    if @dictionary.include?(source)
      results[1] = LogStash::Util.deep_clone(@dictionary[source])
    else
      results[0] = false
    end
  ensure
    @read_lock.unlock
  end
end