Class: LogStash::PluginMixins::Jdbc::ValueTracking
- Inherits:
-
Object
- Object
- LogStash::PluginMixins::Jdbc::ValueTracking
show all
- Defined in:
- lib/logstash/plugin_mixins/jdbc/value_tracking.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ValueTracking.
32
33
34
35
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 32
def initialize(handler)
@file_handler = handler
set_initial
end
|
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
30
31
32
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 30
def value
@value
end
|
Class Method Details
.build_last_value_tracker(plugin) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 7
def self.build_last_value_tracker(plugin)
handler = plugin.record_last_run ? FileHandler.new(plugin.last_run_metadata_path) : 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
if plugin.use_column_value && plugin.tracking_column_type == "numeric"
NumericValueTracker.new(handler)
else
if plugin.jdbc_default_timezone.nil? || plugin.jdbc_default_timezone.empty?
TimeValueTracker.new(handler)
else
DateTimeValueTracker.new(handler)
end
end
end
|
Instance Method Details
#set_initial ⇒ Object
37
38
39
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 37
def set_initial
end
|
#set_value(value) ⇒ Object
41
42
43
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 41
def set_value(value)
end
|
#write ⇒ Object
45
46
47
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 45
def write
@file_handler.write(@value)
end
|