bricolage-streamingload 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 523da5342b4a48ba2c46e2a2565bf1561570e7a7
4
- data.tar.gz: '02229582ac7ee8ca27a86eaef69a4c4824735e8e'
3
+ metadata.gz: ba544bbf6c3a133aeb0882e5193296dc734a25ec
4
+ data.tar.gz: 8706c5cd050e1083075d2890e422e3834680c2ea
5
5
  SHA512:
6
- metadata.gz: 17e440e8400bf237cc4d19bd01c6f16641e6e49a595a757e2e2925de9ae5645796f29acda03904230e0bf591311b44267f2cd77ecec03245c8a553bba94e4b93
7
- data.tar.gz: 0ffbc7699e531268e471d769024b64281111fa44c5fb4d3e94245202e0ee6504996db814a29eb497d339f2c20f38af63ec37de5731bc23e272191d04dc296a4c
6
+ metadata.gz: d03f41030b3c7bc7175c1abf7b2f6e8e5c3a40c3cff5754e678c76338190b9c0293792dc4a8cc34fbf262419ac054467503c823ceafc2a55a6e59d9a2762f937
7
+ data.tar.gz: 8bd7c0cc4b826383d552ed196581b00a8d33010e24ada2cb9f3eb76ed381178b35e706585a2da449d019bf8bd4e43233afc84902695382df152925261d3fb848
@@ -97,6 +97,12 @@ module Bricolage
97
97
  tasks
98
98
  end
99
99
 
100
+ def load_tasks_by_id(ids)
101
+ @ctl_ds.open {|conn|
102
+ return load_tasks(conn, ids)
103
+ }
104
+ end
105
+
100
106
  private
101
107
 
102
108
  def insert_object(conn, obj)
@@ -63,6 +63,11 @@ module Bricolage
63
63
  logger: logger
64
64
  )
65
65
 
66
+ if opts.task_id
67
+ dispatcher.dispatch_tasks chunk_buffer.load_tasks_by_id([opts.task_id])
68
+ exit 0
69
+ end
70
+
66
71
  Process.daemon(true) if opts.daemon?
67
72
  create_pid_file opts.pid_file_path if opts.pid_file_path
68
73
  Dir.chdir '/'
@@ -219,6 +224,7 @@ module Bricolage
219
224
  @daemon = false
220
225
  @log_file_path = nil
221
226
  @pid_file_path = nil
227
+ @task_id = nil
222
228
  @rest_arguments = nil
223
229
 
224
230
  @opts = opts = OptionParser.new("Usage: #{$0} CONFIG_PATH")
@@ -234,6 +240,9 @@ module Bricolage
234
240
  opts.on('--pid-file=PATH', 'Creates PID file.') {|path|
235
241
  @pid_file_path = path
236
242
  }
243
+ opts.on('--task-id=ID', 'Dispatches this task and quit.') {|id|
244
+ @task_id = id.to_i
245
+ }
237
246
  opts.on('--help', 'Prints this message and quit.') {
238
247
  puts opts.help
239
248
  exit 0
@@ -263,6 +272,8 @@ module Bricolage
263
272
 
264
273
  attr_reader :pid_file_path
265
274
 
275
+ attr_reader :task_id
276
+
266
277
  end
267
278
 
268
279
  end # module StreamingLoad
@@ -8,6 +8,7 @@ module Bricolage
8
8
 
9
9
  def initialize(s3ds)
10
10
  @s3ds = s3ds
11
+ @logger = @s3ds.logger
11
12
  end
12
13
 
13
14
  def log(task)
@@ -24,7 +25,7 @@ module Bricolage
24
25
 
25
26
  def content(task)
26
27
  buf = StringIO.new
27
- tasks.chunks.each do |chunk|
28
+ task.chunks.each do |chunk|
28
29
  buf.puts %Q("#{task.id}","#{chunk.id}","#{chunk.url}")
29
30
  end
30
31
  buf.string
@@ -1,5 +1,5 @@
1
1
  module Bricolage
2
2
  module StreamingLoad
3
- VERSION = '0.14.0'
3
+ VERSION = '0.14.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bricolage-streamingload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minero Aoki