redshift-connector 5.3.2 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redshift-connector/connector.rb +3 -11
- data/lib/redshift-connector/exporter.rb +0 -14
- data/lib/redshift-connector/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58ae198b8bba6ce5c279bd67b1e5e9de6d05c007
|
4
|
+
data.tar.gz: d403857e6f2439ee654e18537d93bb67a333ab04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cb22409f2c133ca2974f4279106615628edd4d12512e7e069a7d140f4d056e7e6470a57a95b85db0065bf763753d6ff3c705d17c7ae475414126d4318389dc2
|
7
|
+
data.tar.gz: '049a4bec56136974dfeadcba78564337927b5420acd03d1fd098ff1314ea80ca217764a9ff6b2f53b01eaf8aa8f91b615ac6883f410d3ce2a7919b91a5d257ab'
|
@@ -116,26 +116,18 @@ module RedshiftConnector
|
|
116
116
|
not ENV['IMPORT_ONLY']
|
117
117
|
end
|
118
118
|
|
119
|
-
def export_forced?
|
120
|
-
!! (ENV['EXPORT_ONLY'] or ENV['FORCE'])
|
121
|
-
end
|
122
|
-
|
123
119
|
def import_enabled?
|
124
120
|
not ENV['EXPORT_ONLY']
|
125
121
|
end
|
126
122
|
|
127
123
|
def execute
|
128
|
-
export
|
124
|
+
export if export_enabled?
|
129
125
|
import if import_enabled?
|
130
126
|
end
|
131
127
|
|
132
|
-
def export
|
128
|
+
def export
|
133
129
|
@logger.info "==== export task =================================================="
|
134
|
-
|
135
|
-
@logger.info "export task is already executed; skip"
|
136
|
-
else
|
137
|
-
@exporter.execute
|
138
|
-
end
|
130
|
+
@exporter.execute
|
139
131
|
end
|
140
132
|
|
141
133
|
def import
|
@@ -74,19 +74,6 @@ module RedshiftConnector
|
|
74
74
|
attr_reader :bundle
|
75
75
|
attr_reader :logger
|
76
76
|
|
77
|
-
def completed?
|
78
|
-
@bundle.bucket.object(flag_object_key).exists?
|
79
|
-
end
|
80
|
-
|
81
|
-
def create_flag_object
|
82
|
-
@logger.info "TOUCH #{flag_object_key}"
|
83
|
-
@bundle.bucket.object(flag_object_key).put(body: "OK")
|
84
|
-
end
|
85
|
-
|
86
|
-
def flag_object_key
|
87
|
-
"#{File.dirname(@bundle.prefix)}/00completed"
|
88
|
-
end
|
89
|
-
|
90
77
|
def execute
|
91
78
|
@bundle.clear
|
92
79
|
@logger.info "EXPORT #{@query.description} -> #{@bundle.url}*"
|
@@ -95,7 +82,6 @@ module RedshiftConnector
|
|
95
82
|
@logger.info "[SQL/Redshift] #{batch_job_label}#{stmt.strip}"
|
96
83
|
conn.execute(batch_job_label + stmt)
|
97
84
|
end
|
98
|
-
create_flag_object
|
99
85
|
end
|
100
86
|
|
101
87
|
def batch_job_label
|