td 0.10.96 → 0.10.97

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ == 2013-12-18 version 0.10.97
2
+
3
+ * import:commit accepts --wait option.
4
+ * import:jar_update command to download correct jar file
5
+ * Fix no error message when impala query failed immediately
6
+
7
+
1
8
  == 2013-12-04 version 0.10.96
2
9
 
3
10
  * Add --format option to some subcommands to specify render format. json, csv and tsv.
@@ -19,7 +19,7 @@ if [ -n "$chrev" ];then
19
19
  fi
20
20
 
21
21
  revname="$(git show --pretty=format:'%H %ad' | head -n 1)"
22
- vername="0.4.2-SNAPSHOT"
22
+ vername="0.4.1-SNAPSHOT"
23
23
 
24
24
  mvn package -Dmaven.test.skip=true || exit 1
25
25
  echo "copy td-import-${vername}.jar"
@@ -1 +1 @@
1
- 0.4.2-SNAPSHOT
1
+ 0.4.1-SNAPSHOT
@@ -269,6 +269,12 @@ module Command
269
269
  end
270
270
 
271
271
  def bulk_import_commit(op)
272
+ wait = false
273
+
274
+ op.on('-w', '--wait', 'wait for finishing the commit', TrueClass) {|b|
275
+ wait = b
276
+ }
277
+
272
278
  name = op.cmd_parse
273
279
 
274
280
  client = get_client
@@ -276,6 +282,44 @@ module Command
276
282
  job = client.commit_bulk_import(name)
277
283
 
278
284
  $stderr.puts "Bulk import session '#{name}' started to commit."
285
+
286
+ if wait
287
+ wait_commit(name) # wait the commit
288
+ end
289
+ end
290
+
291
+ private
292
+ def wait_commit(name)
293
+ first_call = true
294
+ finished = false
295
+ max_error_counts = 10
296
+
297
+ while first_call || !finished
298
+ first_call = false
299
+ begin
300
+ sleep 5
301
+
302
+ # extract buik_import session
303
+ client = get_client
304
+ bis = client.bulk_imports
305
+ bi = bis.find {|bi| name == bi.name }
306
+ unless bi
307
+ $stderr.puts "Bulk import session '#{name}' does not exist."
308
+ exit 1
309
+ end
310
+
311
+ # check status of the bulk_import session
312
+ if bi.status == 'committed' || bi.status == 'ready'
313
+ finished = true
314
+ end
315
+ rescue Timeout::Error, SystemCallError, EOFError, SocketError
316
+ if max_error_counts <= 0
317
+ raise
318
+ end
319
+ max_error_counts -= 1
320
+ retry
321
+ end
322
+ end
279
323
  end
280
324
 
281
325
  def bulk_import_error_records(op)
@@ -50,7 +50,7 @@ module Command
50
50
  File.open(File.join(UPDATED_PATH, 'VERSION'), 'w') { |f| f.print "#{version} via import:jar_update" }
51
51
  File.open(File.join(UPDATED_PATH, 'td-import-java.version'), 'w') { |f| f.print "#{version} #{updated}" }
52
52
  File.open(File.join(UPDATED_PATH, 'td-import.jar'), 'wb') { |f|
53
- f.print Updater.fetch("http://maven.treasure-data.com/com/treasure_data/td-import/#{version}/td-import-#{version}.jar")
53
+ f.print Updater.fetch("http://maven.treasure-data.com/com/treasure_data/td-import/#{version}/td-import-#{version}-jar-with-dependencies.jar")
54
54
  }
55
55
  puts "Installed td-import.jar #{version} into #{UPDATED_PATH}"
56
56
  else
@@ -196,14 +196,15 @@ module Command
196
196
  end
197
197
 
198
198
  private
199
- def wait_job(job)
199
+ def wait_job(job, first_call = false)
200
200
  $stderr.puts "queued..."
201
201
 
202
202
  cmdout_lines = 0
203
203
  stderr_lines = 0
204
204
  max_error_counts = JOB_WAIT_MAX_RETRY_COUNT_ON_NETWORK_ERROR
205
205
 
206
- until job.finished?
206
+ while first_call || !job.finished?
207
+ first_call = false
207
208
  begin
208
209
  sleep 2
209
210
  job.update_status!
@@ -111,8 +111,8 @@ module Command
111
111
  $stderr.puts "Use '#{$prog} " + Config.cl_apikey_string + "job:show #{job.job_id}' to show the status."
112
112
  #$stderr.puts "See #{job.url} to see the progress."
113
113
 
114
- if wait && !job.finished?
115
- wait_job(job)
114
+ if wait
115
+ wait_job(job, true)
116
116
  puts "Status : #{job.status}"
117
117
  if job.success? && !exclude
118
118
  puts "Result :"
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.10.96'
3
+ VERSION = '0.10.97'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,32 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.96
4
+ version: 0.10.97
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Treasure Data, Inc.
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-12-04 00:00:00.000000000 Z
12
+ date: 2013-12-18 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: msgpack
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: 0.4.4
20
- - - '!='
22
+ - - ! '!='
21
23
  - !ruby/object:Gem::Version
22
24
  version: 0.5.0
23
- - - '!='
25
+ - - ! '!='
24
26
  - !ruby/object:Gem::Version
25
27
  version: 0.5.1
26
- - - '!='
28
+ - - ! '!='
27
29
  - !ruby/object:Gem::Version
28
30
  version: 0.5.2
29
- - - '!='
31
+ - - ! '!='
30
32
  - !ruby/object:Gem::Version
31
33
  version: 0.5.3
32
34
  - - <
@@ -35,20 +37,21 @@ dependencies:
35
37
  type: :runtime
36
38
  prerelease: false
37
39
  version_requirements: !ruby/object:Gem::Requirement
40
+ none: false
38
41
  requirements:
39
- - - '>='
42
+ - - ! '>='
40
43
  - !ruby/object:Gem::Version
41
44
  version: 0.4.4
42
- - - '!='
45
+ - - ! '!='
43
46
  - !ruby/object:Gem::Version
44
47
  version: 0.5.0
45
- - - '!='
48
+ - - ! '!='
46
49
  - !ruby/object:Gem::Version
47
50
  version: 0.5.1
48
- - - '!='
51
+ - - ! '!='
49
52
  - !ruby/object:Gem::Version
50
53
  version: 0.5.2
51
- - - '!='
54
+ - - ! '!='
52
55
  - !ruby/object:Gem::Version
53
56
  version: 0.5.3
54
57
  - - <
@@ -57,6 +60,7 @@ dependencies:
57
60
  - !ruby/object:Gem::Dependency
58
61
  name: yajl-ruby
59
62
  requirement: !ruby/object:Gem::Requirement
63
+ none: false
60
64
  requirements:
61
65
  - - ~>
62
66
  - !ruby/object:Gem::Version
@@ -64,6 +68,7 @@ dependencies:
64
68
  type: :runtime
65
69
  prerelease: false
66
70
  version_requirements: !ruby/object:Gem::Requirement
71
+ none: false
67
72
  requirements:
68
73
  - - ~>
69
74
  - !ruby/object:Gem::Version
@@ -71,20 +76,23 @@ dependencies:
71
76
  - !ruby/object:Gem::Dependency
72
77
  name: hirb
73
78
  requirement: !ruby/object:Gem::Requirement
79
+ none: false
74
80
  requirements:
75
- - - '>='
81
+ - - ! '>='
76
82
  - !ruby/object:Gem::Version
77
83
  version: 0.4.5
78
84
  type: :runtime
79
85
  prerelease: false
80
86
  version_requirements: !ruby/object:Gem::Requirement
87
+ none: false
81
88
  requirements:
82
- - - '>='
89
+ - - ! '>='
83
90
  - !ruby/object:Gem::Version
84
91
  version: 0.4.5
85
92
  - !ruby/object:Gem::Dependency
86
93
  name: parallel
87
94
  requirement: !ruby/object:Gem::Requirement
95
+ none: false
88
96
  requirements:
89
97
  - - ~>
90
98
  - !ruby/object:Gem::Version
@@ -92,6 +100,7 @@ dependencies:
92
100
  type: :runtime
93
101
  prerelease: false
94
102
  version_requirements: !ruby/object:Gem::Requirement
103
+ none: false
95
104
  requirements:
96
105
  - - ~>
97
106
  - !ruby/object:Gem::Version
@@ -99,6 +108,7 @@ dependencies:
99
108
  - !ruby/object:Gem::Dependency
100
109
  name: td-client
101
110
  requirement: !ruby/object:Gem::Requirement
111
+ none: false
102
112
  requirements:
103
113
  - - ~>
104
114
  - !ruby/object:Gem::Version
@@ -106,6 +116,7 @@ dependencies:
106
116
  type: :runtime
107
117
  prerelease: false
108
118
  version_requirements: !ruby/object:Gem::Requirement
119
+ none: false
109
120
  requirements:
110
121
  - - ~>
111
122
  - !ruby/object:Gem::Version
@@ -113,6 +124,7 @@ dependencies:
113
124
  - !ruby/object:Gem::Dependency
114
125
  name: td-logger
115
126
  requirement: !ruby/object:Gem::Requirement
127
+ none: false
116
128
  requirements:
117
129
  - - ~>
118
130
  - !ruby/object:Gem::Version
@@ -120,6 +132,7 @@ dependencies:
120
132
  type: :runtime
121
133
  prerelease: false
122
134
  version_requirements: !ruby/object:Gem::Requirement
135
+ none: false
123
136
  requirements:
124
137
  - - ~>
125
138
  - !ruby/object:Gem::Version
@@ -127,6 +140,7 @@ dependencies:
127
140
  - !ruby/object:Gem::Dependency
128
141
  name: rubyzip
129
142
  requirement: !ruby/object:Gem::Requirement
143
+ none: false
130
144
  requirements:
131
145
  - - ~>
132
146
  - !ruby/object:Gem::Version
@@ -134,6 +148,7 @@ dependencies:
134
148
  type: :runtime
135
149
  prerelease: false
136
150
  version_requirements: !ruby/object:Gem::Requirement
151
+ none: false
137
152
  requirements:
138
153
  - - ~>
139
154
  - !ruby/object:Gem::Version
@@ -141,6 +156,7 @@ dependencies:
141
156
  - !ruby/object:Gem::Dependency
142
157
  name: rake
143
158
  requirement: !ruby/object:Gem::Requirement
159
+ none: false
144
160
  requirements:
145
161
  - - ~>
146
162
  - !ruby/object:Gem::Version
@@ -148,6 +164,7 @@ dependencies:
148
164
  type: :development
149
165
  prerelease: false
150
166
  version_requirements: !ruby/object:Gem::Requirement
167
+ none: false
151
168
  requirements:
152
169
  - - ~>
153
170
  - !ruby/object:Gem::Version
@@ -155,6 +172,7 @@ dependencies:
155
172
  - !ruby/object:Gem::Dependency
156
173
  name: rspec
157
174
  requirement: !ruby/object:Gem::Requirement
175
+ none: false
158
176
  requirements:
159
177
  - - ~>
160
178
  - !ruby/object:Gem::Version
@@ -162,6 +180,7 @@ dependencies:
162
180
  type: :development
163
181
  prerelease: false
164
182
  version_requirements: !ruby/object:Gem::Requirement
183
+ none: false
165
184
  requirements:
166
185
  - - ~>
167
186
  - !ruby/object:Gem::Version
@@ -169,6 +188,7 @@ dependencies:
169
188
  - !ruby/object:Gem::Dependency
170
189
  name: simplecov
171
190
  requirement: !ruby/object:Gem::Requirement
191
+ none: false
172
192
  requirements:
173
193
  - - ~>
174
194
  - !ruby/object:Gem::Version
@@ -176,6 +196,7 @@ dependencies:
176
196
  type: :development
177
197
  prerelease: false
178
198
  version_requirements: !ruby/object:Gem::Requirement
199
+ none: false
179
200
  requirements:
180
201
  - - ~>
181
202
  - !ruby/object:Gem::Version
@@ -258,26 +279,33 @@ files:
258
279
  - td.gemspec
259
280
  homepage: http://treasure-data.com/
260
281
  licenses: []
261
- metadata: {}
262
282
  post_install_message:
263
283
  rdoc_options: []
264
284
  require_paths:
265
285
  - lib
266
286
  required_ruby_version: !ruby/object:Gem::Requirement
287
+ none: false
267
288
  requirements:
268
- - - '>='
289
+ - - ! '>='
269
290
  - !ruby/object:Gem::Version
270
291
  version: '0'
292
+ segments:
293
+ - 0
294
+ hash: -1410145252245092295
271
295
  required_rubygems_version: !ruby/object:Gem::Requirement
296
+ none: false
272
297
  requirements:
273
- - - '>='
298
+ - - ! '>='
274
299
  - !ruby/object:Gem::Version
275
300
  version: '0'
301
+ segments:
302
+ - 0
303
+ hash: -1410145252245092295
276
304
  requirements: []
277
305
  rubyforge_project:
278
- rubygems_version: 2.0.3
306
+ rubygems_version: 1.8.23
279
307
  signing_key:
280
- specification_version: 4
308
+ specification_version: 3
281
309
  summary: CLI to manage data on Treasure Data, the Hadoop-based cloud data warehousing
282
310
  test_files:
283
311
  - spec/file_reader/filter_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 4be1e9e6df99daff7484f415d97c0e07b1f8323b
4
- data.tar.gz: e5a02f18e5ddc92ce3853064982dac0276c78b51
5
- SHA512:
6
- metadata.gz: 84a6b09a04a928bc8cd07230fc21e041d451bb43d42614821623507d3bfcd55ffaa4d93bdc8372178d11937a5830df5cabef97a82bd53cd6992032b036e9331e
7
- data.tar.gz: 6aa3f40c432bc25e2a8430595f071e92388f58ffb47f4e472d113100e58dc440ed49ebd1b3d9886ba36950979456791cf5e248d918e6e7fefffe29d3d4c689e9