bricolage 5.16.1 → 5.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/jobclass/streaming_load.rb +2 -0
  3. data/lib/bricolage/version.rb +1 -1
  4. data/test/home/Gemfile.lock +4 -2
  5. data/test/home/aamine/pv_log.job +9 -0
  6. data/test/home/aamine/variable.yml +3 -0
  7. data/test/home/config/development/database.yml +27 -2
  8. data/test/home/config/development/password.yml +2 -0
  9. data/test/home/config/development/variable.yml +1 -0
  10. data/test/home/config/streamingload.yml +8 -0
  11. data/test/home/sqs/data/20160125_0000_0_20f3aa7a-6b5b-4a19-9c8f-1972e820fbaf.gz +0 -0
  12. data/test/home/sqs/data/20160125_0000_0_25fe3a52-9477-4030-8038-c84636343f56.gz +0 -0
  13. data/test/home/sqs/data/20160125_0000_0_27361985-3142-4f9c-a2fe-6c864ff7e68d.gz +0 -0
  14. data/test/home/sqs/data/20160125_0000_0_2d0b43ad-0db9-4655-bd98-b7464b123763.gz +0 -0
  15. data/test/home/sqs/data/20160125_0000_0_2fe26d66-45b0-4668-b212-668bd44ebd71.gz +0 -0
  16. data/test/home/sqs/data/20160125_0000_0_62546a2e-c9be-46b1-b601-c25de138a377.gz +0 -0
  17. data/test/home/sqs/data/20160125_0000_0_6adcc23f-b073-48b4-a56f-2023866cd8e5.gz +0 -0
  18. data/test/home/sqs/data/20160125_0000_0_7403ecce-d9cc-43e0-b1ea-a35221a5b780.gz +0 -0
  19. data/test/home/sqs/data/20160125_0000_0_8d429746-2b60-48d0-8cac-59e6bc4d557e.gz +0 -0
  20. data/test/home/sqs/data/20160125_0000_0_a1ff5331-dc10-4072-ab95-b9fd8667ff88.gz +0 -0
  21. data/test/home/sqs/data/20160125_0000_0_b02e9cf1-cf0d-4c3c-a9cc-85773bfbcb44.gz +0 -0
  22. data/test/home/sqs/data/20160125_0000_0_de37c5ad-d26a-42cc-a141-475676b65f69.gz +0 -0
  23. data/test/home/sqs/data/20160125_0001_0_254f8131-84dd-43ec-a66f-d9a445194e49.gz +0 -0
  24. data/test/home/sqs/data/20160125_0001_0_2abcee36-4b4e-4758-b331-1ee4775e531e.gz +0 -0
  25. data/test/home/sqs/data/20160125_0001_0_68f856be-03ac-400c-b819-a680a965801b.gz +0 -0
  26. data/test/home/sqs/data/20160125_0001_0_90e7c6fb-f649-4fe8-9875-14734b34df04.gz +0 -0
  27. data/test/home/sqs/data/20160125_0001_0_959223b2-7376-40a8-aa27-b3e95f828099.gz +0 -0
  28. data/test/home/sqs/data/20160125_0001_0_a8f57916-73f5-4d19-8f83-cc1468e06368.gz +0 -0
  29. data/test/home/sqs/data/20160125_0001_0_b6091557-eadd-4239-b653-f9728b0c8b78.gz +0 -0
  30. data/test/home/sqs/data/20160125_0001_0_bd519b56-301e-4f51-8585-c53b1e40ce52.gz +0 -0
  31. data/test/home/sqs/data/20160125_0001_0_e96f1782-0c23-487a-87ec-6d41cd922999.gz +0 -0
  32. data/test/home/sqs/data/20160125_0001_0_ed414ea9-1b0b-4d23-ab37-3ddcd0c5368f.gz +0 -0
  33. data/test/home/sqs/data/20160125_0001_0_ef86d3d5-cf80-4b25-ad77-286b170fe8d8.gz +0 -0
  34. data/test/home/sqs/data/20160125_0001_0_efafcb99-368f-46dc-9c68-0d1d621e835f.gz +0 -0
  35. data/test/home/sqs/data/20160125_0001_0_f7732d73-156d-40a2-bbf6-94a285eda18d.gz +0 -0
  36. data/test/home/sqs/data/20160125_0002_0_012b9865-c7f9-4d37-bc0c-ffbea16be92f.gz +0 -0
  37. data/test/home/sqs/data/20160125_0002_0_0a986c8d-dee7-45fd-8f11-c9327d6d332a.gz +0 -0
  38. data/test/home/sqs/data/20160125_0002_0_147e37cb-b8a1-4e65-b6be-1dd57b33c575.gz +0 -0
  39. data/test/home/sqs/data/20160125_0002_0_533c7aec-d80d-435b-b292-8c5ca25eef44.gz +0 -0
  40. data/test/home/sqs/data/20160125_0002_0_5f44fde9-9760-4a61-8305-01b22aca1b07.gz +0 -0
  41. data/test/home/sqs/data/20160125_0002_0_6f4133b4-acca-4833-aa61-79b03fb22950.gz +0 -0
  42. data/test/home/sqs/data/20160125_0002_0_798c039e-75bc-4cd5-b862-9a062718766e.gz +0 -0
  43. data/test/home/sqs/data/20160125_0002_0_7bb967a0-040a-488f-bd45-ecb43ba17278.gz +0 -0
  44. data/test/home/sqs/data/20160125_0002_0_d7b8df8c-735a-47e0-bcfc-3b24f0de6991.gz +0 -0
  45. data/test/home/sqs/data/20160125_0002_0_e332458d-4cbf-496f-ac4f-7098dafee8da.gz +0 -0
  46. data/test/home/sqs/data/20160125_0002_0_e430e1d8-941b-45ba-b580-1d498ded9e2d.gz +0 -0
  47. data/test/home/sqs/data/20160125_0002_0_fc6a64f1-ba03-48a9-adb8-26c11307f8bb.gz +0 -0
  48. data/test/home/sqs/data/20160125_0003_0_06fdc0ed-73e8-4404-a442-9a2d444b1e82.gz +0 -0
  49. data/test/home/sqs/data/20160125_0003_0_13fbab94-7acb-4f6e-8bde-fd3270e4170b.gz +0 -0
  50. data/test/home/sqs/data/20160125_0003_0_24e13b65-fc76-4450-bc27-f43256e15cfa.gz +0 -0
  51. data/test/home/sqs/data/20160125_0003_0_4daafad3-e8fe-45c4-89c8-45531461650e.gz +0 -0
  52. data/test/home/sqs/data/20160125_0003_0_63db2f4b-5db7-42d0-96e2-202cad9e3ee7.gz +0 -0
  53. data/test/home/sqs/data/20160125_0003_0_7b709b4d-5ef7-4526-b619-44785fa54a0f.gz +0 -0
  54. data/test/home/sqs/data/20160125_0003_0_87d371f5-7e19-4c52-ba07-a0913536e52b.gz +0 -0
  55. data/test/home/sqs/data/20160125_0003_0_9f7c8d47-98a0-4756-8e41-ea4e50b995a5.gz +0 -0
  56. data/test/home/sqs/data/20160125_0003_0_b7e6e1ce-8157-4b84-8e40-463c35fca4d9.gz +0 -0
  57. data/test/home/sqs/data/20160125_0003_0_bb70daee-7616-4ec9-a223-adbbdef5ed02.gz +0 -0
  58. data/test/home/sqs/data/20160125_0003_0_cb761a01-9c07-404e-9780-d130d5a72831.gz +0 -0
  59. data/test/home/sqs/data/20160125_0003_0_db038e65-0d72-439f-9d2a-10de9ec1e253.gz +0 -0
  60. data/test/home/sqs/data/20160125_0004_0_01e9d44e-14f7-4a1b-805b-fb47cdaca50a.gz +0 -0
  61. data/test/home/sqs/data/20160125_0004_0_0e504783-4156-4826-8bf0-88a6b876b5dd.gz +0 -0
  62. data/test/home/sqs/data/20160125_0004_0_2555b915-f1bd-4598-aa9a-664e45848ac2.gz +0 -0
  63. data/test/home/sqs/data/20160125_0004_0_2fcd8e7a-0a2b-4a09-b441-9f8f34fef2ce.gz +0 -0
  64. data/test/home/sqs/data/20160125_0004_0_a36f0369-bfef-4860-8298-873130761575.gz +0 -0
  65. data/test/home/sqs/data/20160125_0004_0_af2a00e1-cdaf-4526-b2a0-40b566887743.gz +0 -0
  66. data/test/home/sqs/data/20160125_0004_0_af7d18f1-94ad-404a-99a1-598cefc6d2c4.gz +0 -0
  67. data/test/home/sqs/data/20160125_0004_0_db118a23-4af7-4589-b384-4c79b993df20.gz +0 -0
  68. data/test/home/sqs/data/20160125_0004_0_dd49a099-a716-46b6-9149-3d0791bce097.gz +0 -0
  69. data/test/home/sqs/data/20160125_0004_0_e0aeb75b-5b16-4875-9b93-abb84fc9ea79.gz +0 -0
  70. data/test/home/sqs/data/20160125_0004_0_e16cd2ca-7fbe-4724-8e41-69c4488f01c6.gz +0 -0
  71. data/test/home/sqs/data/20160125_0004_0_e8fe8417-9f92-4cd9-b83a-333f7990eb7c.gz +0 -0
  72. data/test/home/sqs/data/20160125_0005_0_1ebf35e8-47f6-43f9-a42e-e01fa6e24d9a.gz +0 -0
  73. data/test/home/sqs/delete_all.rb +35 -0
  74. data/test/home/sqs/graceful.rb +15 -0
  75. data/test/home/sqs/messages.txt +50 -0
  76. data/test/home/sqs/put-slow.sh +10 -0
  77. data/test/home/sqs/recv.rb +27 -0
  78. data/test/home/sqs/result.txt +16 -0
  79. data/test/home/sqs/send.rb +16 -0
  80. metadata +74 -3
  81. data/test/home/config.yml +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b49d4cd6667b360a4ef43d6a721718729a191aad
4
- data.tar.gz: eaee40ab39ff69582b9fc10d1c2a4a16c028e23a
3
+ metadata.gz: f390623f428534408c149e45da7c23f11ea2f90f
4
+ data.tar.gz: 8857a1d90455b1fcac9f388e5662da69e87886e4
5
5
  SHA512:
6
- metadata.gz: 4743a3a160b1c0cd43a5311df78750a5b37cc200498137e74cceb493a99bab3f0054b932e3daad13e6aa594de8aadb5c839313c45990881ce9c1a4b239bebcda
7
- data.tar.gz: 5b46b650bbc8bd0e11fbbefeefdedf0d619abdc9beb4293fc8511016603bde59cc02ddb0e2adbbb1320eb19309ef1a8391d9c9ecfb1d9699af661e53b644f583
6
+ metadata.gz: 86f56d4df2cfaad3fbe71010c847846ed6d9a93d6b7aa341d01f4e42e24c9796f8ba2cd5b9645e5086d558e71e0675dd636581fc43bc34ec8629671ea14865dc
7
+ data.tar.gz: d41b89b4c9aea470177546a946ee14b00e8d8c1f4bb2e33ceb7ae7c7bba00e84ba8272609ff65ab7ca8a0b1801c5f7f1f9a0e57cf5ca42fa61464bdde3e6ed7a
@@ -222,6 +222,7 @@ class StreamingLoadJobClass < RubyJobClass
222
222
  from '#{manifest_url}'
223
223
  credentials '#{@src.credential_string}'
224
224
  manifest
225
+ compupdate false
225
226
  statupdate false
226
227
  #{@load_options}
227
228
  ;).gsub(/\s+/, ' ').strip
@@ -277,6 +278,7 @@ class StreamingLoadJobClass < RubyJobClass
277
278
  credentials '#{credential_string}'
278
279
  delimiter ','
279
280
  removequotes
281
+ compupdate false
280
282
  ;).gsub(/\s+/, ' ').strip
281
283
  end
282
284
 
@@ -1,4 +1,4 @@
1
1
  module Bricolage
2
2
  APPLICATION_NAME = 'Bricolage'
3
- VERSION = '5.16.1'
3
+ VERSION = '5.16.2'
4
4
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- bricolage (5.16.1)
4
+ bricolage (5.16.2)
5
5
  aws-sdk (~> 2)
6
6
  mysql2
7
7
  pg
@@ -22,8 +22,10 @@ GEM
22
22
  msgpack (>= 0.4.4, < 0.6.0, != 0.5.3, != 0.5.2, != 0.5.1, != 0.5.0)
23
23
  hirb (0.7.3)
24
24
  httpclient (2.7.1)
25
- jmespath (1.1.3)
25
+ jmespath (1.2.3)
26
+ json_pure (>= 1.8.1)
26
27
  json (1.8.3)
28
+ json_pure (1.8.3)
27
29
  method_source (0.8.2)
28
30
  msgpack (0.5.12)
29
31
  mysql2 (0.4.3)
@@ -0,0 +1,9 @@
1
+ class: streaming_load_v3
2
+ work-table: $activity_schema.pv_log_wk
3
+ load-options:
4
+ json: "auto"
5
+ gzip: true
6
+ maxerror: 10
7
+ timeformat: "auto"
8
+ truncatecolumns: true
9
+ acceptinvchars: " "
@@ -0,0 +1,3 @@
1
+ defaults:
2
+ redshift-ds: sql
3
+ ctl-ds: s3_strload
@@ -49,8 +49,8 @@ s3:
49
49
  bucket: tabemiru-data.ap-northeast-1
50
50
  prefix: "/dev"
51
51
  s3cfg: <%= user_home_relative_path '.s3cfg' %>
52
- access_key_id: "AKIAI5R5BL2W73PR3FXQ"
53
- secret_access_key: "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"
52
+ access_key_id: "<%= password 'aws_access_key_id' %>"
53
+ secret_access_key: "<%= password 'aws_secret_access_key' %>"
54
54
  #master_symmetric_key: "12345678901234567890123456789012"
55
55
 
56
56
  mysql:
@@ -62,3 +62,28 @@ mysql:
62
62
  username: work_readonly
63
63
  password: <%= password 'mysql_shared_work_readonly' %>
64
64
  encoding: utf8
65
+
66
+ s3_strload:
67
+ type: s3
68
+ region: "ap-northeast-1"
69
+ endpoint: "s3-ap-northeast-1.amazonaws.com"
70
+ bucket: tabemiru-data.ap-northeast-1
71
+ prefix: tmp/strload
72
+ access_key_id: "<%= password 'aws_access_key_id' %>"
73
+ secret_access_key: "<%= password 'aws_secret_access_key' %>"
74
+
75
+ sqs_strload_event:
76
+ type: sqs
77
+ url: "https://sqs.ap-northeast-1.amazonaws.com/789035092620/log-stream-dev"
78
+ max_number_of_messages: 10
79
+ visibility_timeout: 60
80
+ access_key_id: "<%= password 'aws_access_key_id' %>"
81
+ secret_access_key: "<%= password 'aws_secret_access_key' %>"
82
+
83
+ sqs_strload_task:
84
+ type: sqs
85
+ url: "https://sqs.ap-northeast-1.amazonaws.com/789035092620/bricolage-load-tasks-dev"
86
+ max_number_of_messages: 1
87
+ visibility_timeout: 180
88
+ access_key_id: "<%= password 'aws_access_key_id' %>"
89
+ secret_access_key: "<%= password 'aws_secret_access_key' %>"
@@ -2,3 +2,5 @@ td_tabemiru: "121/c1376bb5e3972fc4a4efc942c1df100f7bc156e0"
2
2
  mysql_shared_work_readonly: "s0uL/M@9r1"
3
3
  mysql_shared_ckpd_readonly: "no3lnar;"
4
4
  mysql_local_work_readonly: "ckpdtest"
5
+ aws_access_key_id: "AKIAI5R5BL2W73PR3FXQ"
6
+ aws_secret_access_key: "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"
@@ -1,3 +1,4 @@
1
1
  data_dir: /tmp/bricolagedev
2
2
  test_schema: aamine
3
3
  test_group: aamine
4
+ activity_schema: aamine
@@ -0,0 +1,8 @@
1
+ redshift-ds: sql
2
+ event-queue-ds: sqs_strload_event
3
+ task-queue-ds: sqs_strload_task
4
+ url_patterns:
5
+ -
6
+ url: "s3://redshift-copy-buffer/development/log_stream/\\d{8}_\\d{4}_\\d+.*\\.gz"
7
+ schema: "aamine"
8
+ table: "pv_log"
@@ -0,0 +1,35 @@
1
+ ENV['AWS_REGION'] = 'ap-northeast-1'
2
+
3
+ require 'aws-sdk'
4
+ require 'json'
5
+ require 'pp'
6
+ require 'pry'
7
+
8
+ queue_id = ARGV[0] || "log-stream-dev"
9
+ queue_url = "https://sqs.ap-northeast-1.amazonaws.com/789035092620/#{queue_id}"
10
+ $stderr.puts queue_url
11
+
12
+ sqs = Aws::SQS::Client.new
13
+
14
+ deleted = true
15
+ while deleted
16
+ deleted = false
17
+
18
+ result = sqs.receive_message(
19
+ queue_url: queue_url,
20
+ max_number_of_messages: 10,
21
+ visibility_timeout: 300,
22
+ wait_time_seconds: 10
23
+ )
24
+ unless result.successful?
25
+ $stderr.puts "receive_message failed: #{result.error.inspect}"
26
+ exit 1
27
+ end
28
+ result.messages.each do |msg|
29
+ body = JSON.parse(msg.body)
30
+ $stderr.puts body['Records'].inspect
31
+ res = sqs.delete_message(queue_url: queue_url, receipt_handle: msg.receipt_handle)
32
+ $stderr.puts "deleted: #{res.successful?}"
33
+ deleted = true if res.successful?
34
+ end
35
+ end
@@ -0,0 +1,15 @@
1
+ ENV['AWS_REGION'] = 'ap-northeast-1'
2
+
3
+ require 'aws-sdk'
4
+ require 'json'
5
+ require 'pp'
6
+ require 'pry'
7
+
8
+ sqs = Aws::SQS::Client.new
9
+ message_body = {'Records' => [{'eventName' => 'shutdown'}]}.to_json
10
+ result = sqs.send_message(
11
+ queue_url: "https://sqs.ap-northeast-1.amazonaws.com/789035092620/log-stream-dev",
12
+ message_body: message_body,
13
+ delay_seconds: 0
14
+ )
15
+ pp result
@@ -0,0 +1,50 @@
1
+ {"Records"=>
2
+ [{"eventVersion"=>"2.0",
3
+ "eventSource"=>"aws:s3",
4
+ "awsRegion"=>"ap-northeast-1",
5
+ "eventTime"=>"2016-02-13T11:40:08.001Z",
6
+ "eventName"=>"ObjectCreated:Put",
7
+ "userIdentity"=>{"principalId"=>"AWS:AIDAJKS3A4VEF45XC2N6A"},
8
+ "requestParameters"=>{"sourceIPAddress"=>"122.220.193.90"},
9
+ "responseElements"=>
10
+ {"x-amz-request-id"=>"9F82D41D69E958B5",
11
+ "x-amz-id-2"=>
12
+ "6p9IZG+R+dsHCAySGkg42ajt/ZdheE5RLChABqiUl1wL47DCqdu2xrweGQtkG7KR1zFyXiNMMB4="},
13
+ "s3"=>
14
+ {"s3SchemaVersion"=>"1.0",
15
+ "configurationId"=>"LogStreamDev",
16
+ "bucket"=>
17
+ {"name"=>"redshift-copy-buffer",
18
+ "ownerIdentity"=>{"principalId"=>"A391FIDWR49810"},
19
+ "arn"=>"arn:aws:s3:::redshift-copy-buffer"},
20
+ "object"=>
21
+ {"key"=>
22
+ "development/log_stream/20160125_0000_0_de37c5ad-d26a-42cc-a141-475676b65f69.gz",
23
+ "size"=>1302957,
24
+ "eTag"=>"d704db7f9cb77b3ecb981c534526b542",
25
+ "sequencer"=>"0056BF161746DA8807"}}}]}
26
+ {"Records"=>
27
+ [{"eventVersion"=>"2.0",
28
+ "eventSource"=>"aws:s3",
29
+ "awsRegion"=>"ap-northeast-1",
30
+ "eventTime"=>"2016-02-13T11:40:08.319Z",
31
+ "eventName"=>"ObjectCreated:Put",
32
+ "userIdentity"=>{"principalId"=>"AWS:AIDAJKS3A4VEF45XC2N6A"},
33
+ "requestParameters"=>{"sourceIPAddress"=>"122.220.193.90"},
34
+ "responseElements"=>
35
+ {"x-amz-request-id"=>"9D3CAB675D7C2FFF",
36
+ "x-amz-id-2"=>
37
+ "wn1pP79+bv8811aTz3f0L682VhAo6YHInNzNSDrBo9kvlSsK0X31JcINHMiVH5kUEt4y4Gh5Y8M="},
38
+ "s3"=>
39
+ {"s3SchemaVersion"=>"1.0",
40
+ "configurationId"=>"LogStreamDev",
41
+ "bucket"=>
42
+ {"name"=>"redshift-copy-buffer",
43
+ "ownerIdentity"=>{"principalId"=>"A391FIDWR49810"},
44
+ "arn"=>"arn:aws:s3:::redshift-copy-buffer"},
45
+ "object"=>
46
+ {"key"=>
47
+ "development/log_stream/20160125_0001_0_bd519b56-301e-4f51-8585-c53b1e40ce52.gz",
48
+ "size"=>1228210,
49
+ "eTag"=>"bfa868a9f00376f6804f41d6a9e0da20",
50
+ "sequencer"=>"0056BF1617DEB23219"}}}]}
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+
3
+ srcdir=$1; shift
4
+ desturl=$1; shift
5
+
6
+ for rel in $(ls $srcdir/*.gz)
7
+ do
8
+ aws s3 cp $rel $desturl
9
+ sleep 3
10
+ done
@@ -0,0 +1,27 @@
1
+ ENV['AWS_REGION'] = 'ap-northeast-1'
2
+
3
+ require 'aws-sdk'
4
+ require 'json'
5
+ require 'pp'
6
+ require 'pry'
7
+
8
+ queue_id = ARGV[0] || "log-stream-dev"
9
+ queue_url = "https://sqs.ap-northeast-1.amazonaws.com/789035092620/#{queue_id}"
10
+
11
+ sqs = Aws::SQS::Client.new
12
+ result = sqs.receive_message(
13
+ queue_url: queue_url,
14
+ attribute_names: ["All"],
15
+ message_attribute_names: ["All"],
16
+ max_number_of_messages: 10,
17
+ visibility_timeout: 21,
18
+ wait_time_seconds: 20
19
+ )
20
+ if result.messages.empty?
21
+ $stderr.puts 'empty'
22
+ else
23
+ binding.pry
24
+ end
25
+ #result.messages.each do |msg|
26
+ # pp JSON.parse(msg.body)
27
+ #end
@@ -0,0 +1,16 @@
1
+ #<struct Aws::SQS::Types::ReceiveMessageResult
2
+ messages=
3
+ [#<struct Aws::SQS::Types::Message
4
+ message_id="2339fc04-b37f-4283-aee2-696408c482be",
5
+ receipt_handle=
6
+ "AQEBErp4Vv059Hvx5oXSioWu7Ov1Jj1ht493LwTTUlgLohmKh02gAMAZ7kN1J4+aLzM54BRuMatnifWPH3cBh6rtdSWlllysBVmXDRKj83VCaseKPpq+Vdw/bLZrPEYRSGPuhKsHa2DFjo67KeND4AqasZO7lOCJX+YcsbqsqAtcODlDWlVbfedPkKIGM3Scra3uY9ysGjNx/zWuJ88fCtvRpu9tgk0nG7srHAm84Mxj5ArakJnKnJMbtkD/+lvm0Vqi2YCkXonS8+BP8gK4kSTbl1uv/Gp7ZfxkjKQJBB8xQiYo7e7qKLwhbImMZtO5tqDKzIKFVfMi1G2ODF+tEj4Ce+ryMRGA50GhON2ETCyofsl1T7Wdr61IEOV0NFlonGTWFf4q/1r3OPhFAchp+tYnyA==",
7
+ md5_of_body="3da46bf43abdff078ca0ffa9620534cb",
8
+ body=
9
+ "{\"Records\":[{\"eventVersion\":\"2.0\",\"eventSource\":\"aws:s3\",\"awsRegion\":\"ap-northeast-1\",\"eventTime\":\"2016-02-13T11:40:07.268Z\",\"eventName\":\"ObjectCreated:Put\",\"userIdentity\":{\"principalId\":\"AWS:AIDAJKS3A4VEF45XC2N6A\"},\"requestParameters\":{\"sourceIPAddress\":\"122.220.193.90\"},\"responseElements\":{\"x-amz-request-id\":\"60A61031A1ED5C31\",\"x-amz-id-2\":\"YT+U/PKVDOH6Abnd1o4KzOZaoXCdVRJs/ORAxn5EPrgjQqF2AwUQf9SAoEw5HKNzfFGPjqP5AQg=\"},\"s3\":{\"s3SchemaVersion\":\"1.0\",\"configurationId\":\"LogStreamDev\",\"bucket\":{\"name\":\"redshift-copy-buffer\",\"ownerIdentity\":{\"principalId\":\"A391FIDWR49810\"},\"arn\":\"arn:aws:s3:::redshift-copy-buffer\"},\"object\":{\"key\":\"development/log_stream/20160125_0000_0_2d0b43ad-0db9-4655-bd98-b7464b123763.gz\",\"size\":1238953,\"eTag\":\"37bb696c3935f4957c7bb645f97801d0\",\"sequencer\":\"0056BF161697C1AA6C\"}}}]}",
10
+ attributes=
11
+ {"SenderId"=>"AIDAJVEO32BJMF27H2JKW",
12
+ "ApproximateFirstReceiveTimestamp"=>"1455364193429",
13
+ "ApproximateReceiveCount"=>"1",
14
+ "SentTimestamp"=>"1455363607341"},
15
+ md5_of_message_attributes=nil,
16
+ message_attributes={}>]>
@@ -0,0 +1,16 @@
1
+ ENV['AWS_REGION'] = 'ap-northeast-1'
2
+
3
+ require 'aws-sdk'
4
+ require 'json'
5
+ require 'pp'
6
+ require 'pry'
7
+
8
+ queue_name = ARGV[0] || 'log-stream-dev'
9
+ queue_url = "https://sqs.ap-northeast-1.amazonaws.com/789035092620/#{queue_name}"
10
+
11
+ message_body = { 'Records' => [ { 'eventName' => 'shutdown' } ] }.to_json
12
+ args = { queue_url: queue_url, message_body: message_body, delay_seconds: 0 }
13
+ pp(**args)
14
+
15
+ sqs = Aws::SQS::Client.new
16
+ pp sqs.send_message(**args)
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.16.1
4
+ version: 5.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minero Aoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -181,10 +181,12 @@ files:
181
181
  - test/all.rb
182
182
  - test/home/Gemfile
183
183
  - test/home/Gemfile.lock
184
- - test/home/config.yml
184
+ - test/home/aamine/pv_log.job
185
+ - test/home/aamine/variable.yml
185
186
  - test/home/config/development/database.yml
186
187
  - test/home/config/development/password.yml
187
188
  - test/home/config/development/variable.yml
189
+ - test/home/config/streamingload.yml
188
190
  - test/home/data/20141002-1355_00.txt
189
191
  - test/home/data/20141002-1355_01.txt
190
192
  - test/home/data/20141002-1355_02.txt
@@ -192,6 +194,75 @@ files:
192
194
  - test/home/jobnet-test.rb
193
195
  - test/home/put.sh
194
196
  - test/home/revert.sh
197
+ - test/home/sqs/data/20160125_0000_0_20f3aa7a-6b5b-4a19-9c8f-1972e820fbaf.gz
198
+ - test/home/sqs/data/20160125_0000_0_25fe3a52-9477-4030-8038-c84636343f56.gz
199
+ - test/home/sqs/data/20160125_0000_0_27361985-3142-4f9c-a2fe-6c864ff7e68d.gz
200
+ - test/home/sqs/data/20160125_0000_0_2d0b43ad-0db9-4655-bd98-b7464b123763.gz
201
+ - test/home/sqs/data/20160125_0000_0_2fe26d66-45b0-4668-b212-668bd44ebd71.gz
202
+ - test/home/sqs/data/20160125_0000_0_62546a2e-c9be-46b1-b601-c25de138a377.gz
203
+ - test/home/sqs/data/20160125_0000_0_6adcc23f-b073-48b4-a56f-2023866cd8e5.gz
204
+ - test/home/sqs/data/20160125_0000_0_7403ecce-d9cc-43e0-b1ea-a35221a5b780.gz
205
+ - test/home/sqs/data/20160125_0000_0_8d429746-2b60-48d0-8cac-59e6bc4d557e.gz
206
+ - test/home/sqs/data/20160125_0000_0_a1ff5331-dc10-4072-ab95-b9fd8667ff88.gz
207
+ - test/home/sqs/data/20160125_0000_0_b02e9cf1-cf0d-4c3c-a9cc-85773bfbcb44.gz
208
+ - test/home/sqs/data/20160125_0000_0_de37c5ad-d26a-42cc-a141-475676b65f69.gz
209
+ - test/home/sqs/data/20160125_0001_0_254f8131-84dd-43ec-a66f-d9a445194e49.gz
210
+ - test/home/sqs/data/20160125_0001_0_2abcee36-4b4e-4758-b331-1ee4775e531e.gz
211
+ - test/home/sqs/data/20160125_0001_0_68f856be-03ac-400c-b819-a680a965801b.gz
212
+ - test/home/sqs/data/20160125_0001_0_90e7c6fb-f649-4fe8-9875-14734b34df04.gz
213
+ - test/home/sqs/data/20160125_0001_0_959223b2-7376-40a8-aa27-b3e95f828099.gz
214
+ - test/home/sqs/data/20160125_0001_0_a8f57916-73f5-4d19-8f83-cc1468e06368.gz
215
+ - test/home/sqs/data/20160125_0001_0_b6091557-eadd-4239-b653-f9728b0c8b78.gz
216
+ - test/home/sqs/data/20160125_0001_0_bd519b56-301e-4f51-8585-c53b1e40ce52.gz
217
+ - test/home/sqs/data/20160125_0001_0_e96f1782-0c23-487a-87ec-6d41cd922999.gz
218
+ - test/home/sqs/data/20160125_0001_0_ed414ea9-1b0b-4d23-ab37-3ddcd0c5368f.gz
219
+ - test/home/sqs/data/20160125_0001_0_ef86d3d5-cf80-4b25-ad77-286b170fe8d8.gz
220
+ - test/home/sqs/data/20160125_0001_0_efafcb99-368f-46dc-9c68-0d1d621e835f.gz
221
+ - test/home/sqs/data/20160125_0001_0_f7732d73-156d-40a2-bbf6-94a285eda18d.gz
222
+ - test/home/sqs/data/20160125_0002_0_012b9865-c7f9-4d37-bc0c-ffbea16be92f.gz
223
+ - test/home/sqs/data/20160125_0002_0_0a986c8d-dee7-45fd-8f11-c9327d6d332a.gz
224
+ - test/home/sqs/data/20160125_0002_0_147e37cb-b8a1-4e65-b6be-1dd57b33c575.gz
225
+ - test/home/sqs/data/20160125_0002_0_533c7aec-d80d-435b-b292-8c5ca25eef44.gz
226
+ - test/home/sqs/data/20160125_0002_0_5f44fde9-9760-4a61-8305-01b22aca1b07.gz
227
+ - test/home/sqs/data/20160125_0002_0_6f4133b4-acca-4833-aa61-79b03fb22950.gz
228
+ - test/home/sqs/data/20160125_0002_0_798c039e-75bc-4cd5-b862-9a062718766e.gz
229
+ - test/home/sqs/data/20160125_0002_0_7bb967a0-040a-488f-bd45-ecb43ba17278.gz
230
+ - test/home/sqs/data/20160125_0002_0_d7b8df8c-735a-47e0-bcfc-3b24f0de6991.gz
231
+ - test/home/sqs/data/20160125_0002_0_e332458d-4cbf-496f-ac4f-7098dafee8da.gz
232
+ - test/home/sqs/data/20160125_0002_0_e430e1d8-941b-45ba-b580-1d498ded9e2d.gz
233
+ - test/home/sqs/data/20160125_0002_0_fc6a64f1-ba03-48a9-adb8-26c11307f8bb.gz
234
+ - test/home/sqs/data/20160125_0003_0_06fdc0ed-73e8-4404-a442-9a2d444b1e82.gz
235
+ - test/home/sqs/data/20160125_0003_0_13fbab94-7acb-4f6e-8bde-fd3270e4170b.gz
236
+ - test/home/sqs/data/20160125_0003_0_24e13b65-fc76-4450-bc27-f43256e15cfa.gz
237
+ - test/home/sqs/data/20160125_0003_0_4daafad3-e8fe-45c4-89c8-45531461650e.gz
238
+ - test/home/sqs/data/20160125_0003_0_63db2f4b-5db7-42d0-96e2-202cad9e3ee7.gz
239
+ - test/home/sqs/data/20160125_0003_0_7b709b4d-5ef7-4526-b619-44785fa54a0f.gz
240
+ - test/home/sqs/data/20160125_0003_0_87d371f5-7e19-4c52-ba07-a0913536e52b.gz
241
+ - test/home/sqs/data/20160125_0003_0_9f7c8d47-98a0-4756-8e41-ea4e50b995a5.gz
242
+ - test/home/sqs/data/20160125_0003_0_b7e6e1ce-8157-4b84-8e40-463c35fca4d9.gz
243
+ - test/home/sqs/data/20160125_0003_0_bb70daee-7616-4ec9-a223-adbbdef5ed02.gz
244
+ - test/home/sqs/data/20160125_0003_0_cb761a01-9c07-404e-9780-d130d5a72831.gz
245
+ - test/home/sqs/data/20160125_0003_0_db038e65-0d72-439f-9d2a-10de9ec1e253.gz
246
+ - test/home/sqs/data/20160125_0004_0_01e9d44e-14f7-4a1b-805b-fb47cdaca50a.gz
247
+ - test/home/sqs/data/20160125_0004_0_0e504783-4156-4826-8bf0-88a6b876b5dd.gz
248
+ - test/home/sqs/data/20160125_0004_0_2555b915-f1bd-4598-aa9a-664e45848ac2.gz
249
+ - test/home/sqs/data/20160125_0004_0_2fcd8e7a-0a2b-4a09-b441-9f8f34fef2ce.gz
250
+ - test/home/sqs/data/20160125_0004_0_a36f0369-bfef-4860-8298-873130761575.gz
251
+ - test/home/sqs/data/20160125_0004_0_af2a00e1-cdaf-4526-b2a0-40b566887743.gz
252
+ - test/home/sqs/data/20160125_0004_0_af7d18f1-94ad-404a-99a1-598cefc6d2c4.gz
253
+ - test/home/sqs/data/20160125_0004_0_db118a23-4af7-4589-b384-4c79b993df20.gz
254
+ - test/home/sqs/data/20160125_0004_0_dd49a099-a716-46b6-9149-3d0791bce097.gz
255
+ - test/home/sqs/data/20160125_0004_0_e0aeb75b-5b16-4875-9b93-abb84fc9ea79.gz
256
+ - test/home/sqs/data/20160125_0004_0_e16cd2ca-7fbe-4724-8e41-69c4488f01c6.gz
257
+ - test/home/sqs/data/20160125_0004_0_e8fe8417-9f92-4cd9-b83a-333f7990eb7c.gz
258
+ - test/home/sqs/data/20160125_0005_0_1ebf35e8-47f6-43f9-a42e-e01fa6e24d9a.gz
259
+ - test/home/sqs/delete_all.rb
260
+ - test/home/sqs/graceful.rb
261
+ - test/home/sqs/messages.txt
262
+ - test/home/sqs/put-slow.sh
263
+ - test/home/sqs/recv.rb
264
+ - test/home/sqs/result.txt
265
+ - test/home/sqs/send.rb
195
266
  - test/home/subsys/d.ct
196
267
  - test/home/subsys/insert.sql.job
197
268
  - test/home/subsys/job1.job
data/test/home/config.yml DELETED
@@ -1,13 +0,0 @@
1
- event_queue:
2
- sqs_url: "https://sqs.ap-northeast-1.amazonaws.com/789035092620/log-stream-dev"
3
- visibility_timeout: 60
4
-
5
- load_queue:
6
- sqs_url: "https://sqs.ap-northeast-1.amazonaws.com/789035092620/XXXXXXXXXXXXXX"
7
- visibility_timeout: 60
8
-
9
- url_patterns:
10
- -
11
- url: "s3://redshift-copy-buffer/development/log_stream/\\d{8}_\\d{4}_\\d+.*\\.gz"
12
- schema: "aamine"
13
- table: "pv_log"