awful 0.0.110 → 0.0.111
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awful/dynamodb.rb +13 -14
- data/lib/awful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05de4d2644881dd896a8f620b8e714406475196f
|
4
|
+
data.tar.gz: 73bf3944a1a82890464ce59a5d314d6d55384e5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abdbece43be134fc09c80656abe98939c6399fbee3d3e5420ace4268d9051b8cf69d150e5486cb1702801015c3a20f171444a20fda1eaadb1f5dad560d838c4c
|
7
|
+
data.tar.gz: 109636c3a86b4644fc5a9bb40ab8c29c97b132ac065e44d2dc598cdaaa29bd9311f58b49f96bbf14535166aad995a23af1cb1eb233169b3c1dc0c74c91ba1ef7
|
data/lib/awful/dynamodb.rb
CHANGED
@@ -184,11 +184,13 @@ module Awful
|
|
184
184
|
## lame progress indicator, pass true for put, false for skip
|
185
185
|
dots = options[:dots] ? ->(x){print x ? '.' : 'x'} : ->(_){}
|
186
186
|
|
187
|
-
##
|
188
|
-
|
189
|
-
|
190
|
-
r = src_client.scan(table_name: src_table, exclusive_start_key:
|
191
|
-
|
187
|
+
## loop on each batch of scanned items
|
188
|
+
exclusive_start_key = nil
|
189
|
+
loop do
|
190
|
+
r = src_client.scan(table_name: src_table, exclusive_start_key: exclusive_start_key, return_consumed_capacity: 'INDEXES')
|
191
|
+
puts "[#{Time.now}] [#{src_table}] scanned:#{r.count} key:#{r.last_evaluated_key || 'nil'}"
|
192
|
+
|
193
|
+
## loop items and put to destination
|
192
194
|
put = skipped = 0
|
193
195
|
r.items.each do |item|
|
194
196
|
begin
|
@@ -200,17 +202,14 @@ module Awful
|
|
200
202
|
dots.call(false)
|
201
203
|
end
|
202
204
|
end
|
203
|
-
print "\n"
|
204
|
-
puts "[#{Time.now}] [#{dst_table}] put:#{put} skipped:#{skipped}"
|
205
205
|
|
206
|
-
|
207
|
-
|
208
|
-
myself.call(myself, r.last_evaluated_key)
|
209
|
-
end
|
210
|
-
}
|
206
|
+
print "\n" if options[:dots]
|
207
|
+
puts "[#{Time.now}] [#{dst_table}] put:#{put} skipped:#{skipped}"
|
211
208
|
|
212
|
-
|
213
|
-
|
209
|
+
## loop if there are more keys to scan
|
210
|
+
exclusive_start_key = r.last_evaluated_key
|
211
|
+
break unless exclusive_start_key
|
212
|
+
end
|
214
213
|
end
|
215
214
|
|
216
215
|
desc 'scan NAME', 'scan table with NAME'
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.111
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|