class ValueTracking

Attributes

value[R]

Public Class Methods

build_last_value_tracker(plugin) click to toggle source
# File lib/logstash/inputs/value_tracking.rb, line 4
def self.build_last_value_tracker(plugin)
  handler = NullFileHandler.new(plugin.last_run_metadata_path)
  if plugin.record_last_run
    handler = FileHandler.new(plugin.last_run_metadata_path)
  end
  if plugin.clean_run
    handler.clean
  end
  instance = DateTimeValueTracker.new(handler)
end
new(handler) click to toggle source
# File lib/logstash/inputs/value_tracking.rb, line 17
def initialize(handler)
  @file_handler = handler
  set_value(get_initial)
end

Public Instance Methods

get_initial() click to toggle source
# File lib/logstash/inputs/value_tracking.rb, line 22
def get_initial
  # override in subclass
end
set_value(value) click to toggle source
# File lib/logstash/inputs/value_tracking.rb, line 26
def set_value(value)
  # override in subclass
end
write() click to toggle source
# File lib/logstash/inputs/value_tracking.rb, line 30
def write
  @file_handler.write(@value.to_s)
end