redshift-connector 4.3.2 → 4.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: 5fad88bacc8b957a0998671cf67e42f78875885a
|
4
|
+
data.tar.gz: 6400dca6b09e108a07e55dee70ace8837f0c835b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d497cb031811c9f8b97ddfc021ab87dd77fceae0b27de3bb3e3453bb4c0e79cdb478f467ccf0a7b1edfa02aa3a010bcead744f55b5dfa28d98c9b24f4c96ea96
|
7
|
+
data.tar.gz: 48287e7d2aca4294d4b940388f4545bb9b3dc010b1ff4a014acfe01b8d220208b53a54e25a0d5e311b769d7254d985fe6f07fa02ae9f06f3a50776ddeb97828a
|
@@ -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
|