bricolage 5.15.1 → 5.15.2

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: 26898f98eb266df22a4940e128b1ae4cf44afd83
4
- data.tar.gz: fd57e7f63e899b6f9f560a2694a4e1466efcb655
3
+ metadata.gz: 5acaeef75f7cfc4d74814c7f036d7e7a187f728f
4
+ data.tar.gz: 4ef05fb1c2b2e292a51f2c6331ceaa9a12d445e9
5
5
  SHA512:
6
- metadata.gz: 46996f94e09c5e9c2efd6814492ebaff39fbdfc1b765a906dbd71dc387b6fecc6bd446a6cd9d916be2479bc0f83588380c3f91afb985ee9ad29f0275c63ed779
7
- data.tar.gz: fad034727fa9b0781eeb642bda3da779ff8183ea94e7f7eef9d5d5e049a41075c309c8585fcdc37784730fed6713eac26e7979b74f0a2532ce01da83fc96b989
6
+ metadata.gz: 4569b393900821b004f84b341e9e5ce87298c6e83d8fb49719960448bac8ad6d8d59cb29ce49acc7e5e5047a0a05324170e76957928ed7ea102944835a733c09
7
+ data.tar.gz: c17dddd3e8a46e246250e746a02e9f8eaa8f335a3cbfe245ab709aa35c8e59caf1629f0636b0928bfc285f60a84968456ae7556132386a71854634e546b09054
@@ -43,9 +43,9 @@ module Bricolage
43
43
  @logger.info "[#{@ds.name}] #{declare_cursor}"
44
44
  @connection.exec(declare_cursor)
45
45
  elsif !@cursor.nil? && cursor.nil?
46
- raise "Cursor in use"
46
+ raise "Cannot declare new cursor. Cursor in use: #{@cursor}"
47
47
  elsif @cursor != cursor
48
- raise "Invalid cursor"
48
+ raise "Specified cursor not exists. Specified: #{cursor}, Current: #{@cursor}"
49
49
  end
50
50
  fetch = "fetch #{fetch_size} in #{@cursor}"
51
51
  @logger.info "[#{@ds.name}] #{fetch}" if cursor.nil?
@@ -8,15 +8,15 @@ module Bricolage
8
8
  class RedisDataSource < DataSource
9
9
  declare_type 'redis'
10
10
 
11
- def initialize(host: 'localhost', port: 6380, **opts)
11
+ def initialize(host: 'localhost', port: 6380, **options)
12
12
  @host = host
13
13
  @port = port
14
- @options = opts
14
+ @options = options
15
15
  end
16
16
 
17
17
  attr_reader :host
18
18
  attr_reader :port
19
- attr_reader :opts
19
+ attr_reader :options
20
20
 
21
21
  def new_task
22
22
  RedisTask.new(self)
@@ -58,22 +58,18 @@ module Bricolage
58
58
  end
59
59
 
60
60
  def import
61
- results = []
62
61
  @src.cursor_transaction {
63
62
  read_count = 0
64
63
  loop do
65
- futures = []
66
64
  ds.client.pipelined do
67
65
  read_count = read_row do |row|
68
- futures.push write_row row
66
+ write_row row
69
67
  end
70
68
  end
71
- results.push futures.flatten.map {|f| f.value}.all?
72
69
  break if read_count == 0
73
70
  end
74
71
  }
75
72
  @cursor = nil
76
- results.all?
77
73
  end
78
74
 
79
75
  def read_row
@@ -127,7 +123,7 @@ module Bricolage
127
123
  ds.logger.info "Key Pattern: #{prefix}<#{@key_columns.join('_')}>"
128
124
  ds.logger.info "Encode: #{@encode}"
129
125
  ds.logger.info "Expire: #{@expire}"
130
- raise "Unexpected error. Please check data." unless import
126
+ import
131
127
  rescue => ex
132
128
  ds.logger.error ex.backtrace.join("\n")
133
129
  raise JobFailure, ex.message
@@ -1,4 +1,4 @@
1
1
  module Bricolage
2
2
  APPLICATION_NAME = 'Bricolage'
3
- VERSION = '5.15.1'
3
+ VERSION = '5.15.2'
4
4
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- bricolage (5.15.1)
4
+ bricolage (5.15.2)
5
5
  aws-sdk (~> 2)
6
6
  mysql2
7
7
  pg
@@ -0,0 +1,8 @@
1
+ class: redis-export
2
+ src-ds: sql
3
+ src-tables:
4
+ user_cook_recipes: $test_schema.user_cook_recipes
5
+ dest-ds: redis
6
+ key-column: user_id
7
+ encode: json
8
+ expire: 60
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.15.1
4
+ version: 5.15.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-16 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -209,6 +209,7 @@ files:
209
209
  - test/home/subsys/raw-vacuum.sql.job
210
210
  - test/home/subsys/rebuild.sql.job
211
211
  - test/home/subsys/redis_export.job
212
+ - test/home/subsys/redis_export2.job
212
213
  - test/home/subsys/search_backends.ct
213
214
  - test/home/subsys/separated.job
214
215
  - test/home/subsys/separated.sql