Class: LogStash::PluginMixins::Jdbc::ValueTracking
- Inherits:
-
Object
- Object
- LogStash::PluginMixins::Jdbc::ValueTracking
show all
- Defined in:
- lib/logstash/plugin_mixins/jdbc/value_tracking.rb
Constant Summary
collapse
- YAML_PERMITTED_CLASSES =
[::DateTime, ::Time, ::BigDecimal].freeze
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ValueTracking.
31
32
33
34
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 31
def initialize(handler)
@file_handler = handler
set_initial
end
|
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
29
30
31
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 29
def value
@value
end
|
Class Method Details
.build_last_value_tracker(plugin) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 9
def self.build_last_value_tracker(plugin)
handler = plugin.record_last_run ? FileHandler.new(plugin.last_run_metadata_file_path) : NullFileHandler.new(plugin.last_run_metadata_file_path)
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?
TimeValueTracker.new(handler)
else
DateTimeValueTracker.new(handler)
end
end
end
|
.load_yaml(source) ⇒ Object
38
39
40
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 38
def self.load_yaml(source)
Psych::safe_load(source, permitted_classes: YAML_PERMITTED_CLASSES)
end
|
Instance Method Details
#set_initial ⇒ Object
47
48
49
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 47
def set_initial
end
|
#set_value(value) ⇒ Object
51
52
53
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 51
def set_value(value)
end
|
#write ⇒ Object
55
56
57
|
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 55
def write
@file_handler.write(@value)
end
|