fluent-plugin-mysql-appender 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c019cd62a986d24066118816d73c07bc47d767d2
|
4
|
+
data.tar.gz: 2bd589f13b322685e6b4b29a1c7fcea50ad6be3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d118c38a6a772f5968af1ab3e98e122ad3997847d02762e506d864c695448569903c031ba4c200df37eb5ca75dc9cc1b40de57dd5a7098445f54d7e54ac7c974
|
7
|
+
data.tar.gz: 497d35ab4ebcd2d5fd866cba96a378cd1508ef15e02eaffe284e4b26945a4f7d4803efe3f943ba8444ffdf6be153f818fdec5bf4f97f0b22342bd2dad471653b
|
@@ -65,21 +65,19 @@ module Fluent
|
|
65
65
|
configs.each do |config|
|
66
66
|
rows_count = 0
|
67
67
|
db.query(get_query(config)).each do |row|
|
68
|
-
|
69
|
-
|
70
|
-
if
|
71
|
-
|
68
|
+
entry_time = get_time(row[config['entry_time']])
|
69
|
+
if (start_time - config['delay']) > entry_time then
|
70
|
+
if config['time_column'].nil? then
|
71
|
+
td_time = Engine.now
|
72
|
+
else
|
73
|
+
td_time = get_time(row[config['time_column']]).to_i
|
72
74
|
end
|
75
|
+
row.each {|k, v| row[k] = v.to_s if v.is_a?(Time) || v.is_a?(Date) || v.is_a?(BigDecimal)}
|
76
|
+
# puts row
|
77
|
+
router.emit(config['tag'], td_time, row)
|
78
|
+
rows_count += 1
|
79
|
+
config['last_id'] = row[config['primary_key']]
|
73
80
|
end
|
74
|
-
if config['time_column'].nil? then
|
75
|
-
td_time = Engine.now
|
76
|
-
else
|
77
|
-
td_time = get_time(row[config['time_column']]).to_i
|
78
|
-
end
|
79
|
-
row.each {|k, v| row[k] = v.to_s if v.is_a?(Time) || v.is_a?(Date) || v.is_a?(BigDecimal)}
|
80
|
-
router.emit(config['tag'], td_time, row)
|
81
|
-
rows_count += 1
|
82
|
-
config['last_id'] = row[config['primary_key']]
|
83
81
|
end
|
84
82
|
$log.info "mysql_appender_multi: finished execution :tag=>#{config['tag']} :rows_count=>#{rows_count} :last_id=>#{config['last_id']}"
|
85
83
|
end
|
@@ -38,7 +38,7 @@ class MysqlAppenderMultiInputTest < Test::Unit::TestCase
|
|
38
38
|
- created_at
|
39
39
|
last_id: -1
|
40
40
|
entry_time: created_at
|
41
|
-
delay:
|
41
|
+
delay: 5m
|
42
42
|
td_database: sample_datasets
|
43
43
|
- table_name: test_tbl2
|
44
44
|
primary_key: id
|
@@ -51,7 +51,7 @@ class MysqlAppenderMultiInputTest < Test::Unit::TestCase
|
|
51
51
|
- created_at
|
52
52
|
last_id: -1
|
53
53
|
entry_time: created_at
|
54
|
-
delay:
|
54
|
+
delay: 5m
|
55
55
|
td_database: sample_datasets
|
56
56
|
EOS
|
57
57
|
conf = YAML.load(str)
|