bricolage 5.24.3 → 5.24.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bricolage/mysqldatasource.rb +17 -16
- data/lib/bricolage/sqlstatement.rb +3 -3
- data/lib/bricolage/version.rb +1 -1
- metadata +2 -6
- data/test/home/subsys/20170214_1225_0_strload.data.json.gz +0 -0
- data/test/home/subsys/streaming_load.ct +0 -4
- data/test/home/subsys/streaming_load.job +0 -21
- data/test/home/subsys/streaming_load_wk.ct +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 832c3083b42f0c549ed2dbc8441716b16b093d3e
|
4
|
+
data.tar.gz: 50fd92b977334362676bd587bbd02fed46327213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f0ed17c1a0e745cc5b54beb0bc434a5922a2f2767607002d40ba2f3599c31258b8dfb54e5b45a2cbd530cd49302d1a0b35c22d19815e77bb96946a79af7514e
|
7
|
+
data.tar.gz: e3ba6c8d1020d46e96e1e110e759e4022f3d63243f9d621e88278c0067337c574dab9062df3124c667a915ce4496cb6c260d8b741b33c46e199d48c636cd33d7
|
@@ -230,23 +230,16 @@ module Bricolage
|
|
230
230
|
end
|
231
231
|
|
232
232
|
def s3export
|
233
|
-
cmd = build_cmd(
|
234
|
-
ds.logger.info "[CMD] #{
|
235
|
-
Open3.
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
unless thread.value.success?
|
241
|
-
raise JobFailure, "mys3dump failed (status #{thread.value.to_i})"
|
242
|
-
end
|
233
|
+
cmd = build_cmd(command_parameters)
|
234
|
+
ds.logger.info "[CMD] #{cmd}"
|
235
|
+
out, st = Open3.capture2e(environment_variables, cmd)
|
236
|
+
ds.logger.info "[CMDOUT] #{out}"
|
237
|
+
unless st.success?
|
238
|
+
msg = extract_exception_message(out)
|
239
|
+
raise JobFailure, "mys3dump failed (status: #{st.to_i}): #{msg}"
|
243
240
|
end
|
244
241
|
end
|
245
242
|
|
246
|
-
def format_cmd(cmd)
|
247
|
-
cmd[1..-1].join(' ') # do not show env
|
248
|
-
end
|
249
|
-
|
250
243
|
def environment_variables
|
251
244
|
{
|
252
245
|
'AWS_ACCESS_KEY_ID' => @s3ds.access_key,
|
@@ -306,8 +299,16 @@ module Bricolage
|
|
306
299
|
Pathname(__dir__).parent.parent + "libexec/mys3dump.jar"
|
307
300
|
end
|
308
301
|
|
309
|
-
def build_cmd(
|
310
|
-
[
|
302
|
+
def build_cmd(options)
|
303
|
+
(['java'] + options.flat_map {|k, v| v ? ["-#{k}", v.to_s] : ["-#{k}"] }.map {|o| %Q("#{o}") }).join(" ")
|
304
|
+
end
|
305
|
+
|
306
|
+
def extract_exception_message(out)
|
307
|
+
out.lines do |line|
|
308
|
+
if /^.*Exception: (?<msg>.*)$/ =~ line
|
309
|
+
return msg
|
310
|
+
end
|
311
|
+
end
|
311
312
|
end
|
312
313
|
end
|
313
314
|
|
@@ -245,7 +245,7 @@ module Bricolage
|
|
245
245
|
end
|
246
246
|
|
247
247
|
def parse(source)
|
248
|
-
parse_meta(
|
248
|
+
parse_meta(read_meta(source))
|
249
249
|
end
|
250
250
|
|
251
251
|
private
|
@@ -279,7 +279,7 @@ module Bricolage
|
|
279
279
|
|
280
280
|
KEYS_RE = /\A--(?:#{DECLARATIONS.keys.join('|')}):/
|
281
281
|
|
282
|
-
def
|
282
|
+
def read_meta(source)
|
283
283
|
lines = ''
|
284
284
|
source.each_line do |line|
|
285
285
|
case line
|
@@ -287,7 +287,7 @@ module Bricolage
|
|
287
287
|
lines.concat line.sub(/\A--/, '')
|
288
288
|
when /\A--([\w\-]+):/
|
289
289
|
key = $1
|
290
|
-
raise ParameterError, "unknown SQL meta data: #{source
|
290
|
+
raise ParameterError, "unknown SQL meta data: #{source}: #{key}"
|
291
291
|
when /\A--/
|
292
292
|
# skip non-metadata comments
|
293
293
|
lines.concat "\n"
|
data/lib/bricolage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bricolage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.24.
|
4
|
+
version: 5.24.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minero Aoki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -208,7 +208,6 @@ files:
|
|
208
208
|
- test/home/data/20141002-1355_02.txt
|
209
209
|
- test/home/data/test.txt
|
210
210
|
- test/home/jobnet-test.rb
|
211
|
-
- test/home/subsys/20170214_1225_0_strload.data.json.gz
|
212
211
|
- test/home/subsys/d.ct
|
213
212
|
- test/home/subsys/insert.sql.job
|
214
213
|
- test/home/subsys/item_pv_acc.ct
|
@@ -237,9 +236,6 @@ files:
|
|
237
236
|
- test/home/subsys/separated.job
|
238
237
|
- test/home/subsys/separated.sql
|
239
238
|
- test/home/subsys/some_view-cv.sql.job
|
240
|
-
- test/home/subsys/streaming_load.ct
|
241
|
-
- test/home/subsys/streaming_load.job
|
242
|
-
- test/home/subsys/streaming_load_wk.ct
|
243
239
|
- test/home/subsys/unified.jobnet
|
244
240
|
- test/home/subsys/unified.sql.job
|
245
241
|
- test/home/subsys/users.ct
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class: streaming_load
|
2
|
-
|
3
|
-
s3-ds: s3
|
4
|
-
keep-ctl: true
|
5
|
-
ctl-prefix: /strload/ctl/
|
6
|
-
queue-path: /strload/queue/
|
7
|
-
persistent-path: /strload/year=%Y/month=%m/day=%d/
|
8
|
-
file-name: "%Y%m%d_%H%M_%Q_%*.gz"
|
9
|
-
|
10
|
-
redshift-ds: dwh_db
|
11
|
-
dest-table: $test_schema.streaming_load
|
12
|
-
work-table: $test_schema.streaming_load_wk
|
13
|
-
log-table: $test_schema.streaming_load_l
|
14
|
-
load-options:
|
15
|
-
json: "auto"
|
16
|
-
gzip: true
|
17
|
-
maxerror: 0
|
18
|
-
timeformat: "auto"
|
19
|
-
truncatecolumns: true
|
20
|
-
acceptinvchars: " "
|
21
|
-
skip-work: true
|