td 0.10.88 → 0.10.89

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 859dbebbeac28faff62bccd70bfcdf7b801938a4
4
+ data.tar.gz: 93d6608077e158f2c1c045a1c1b4c1ad0c700b11
5
+ SHA512:
6
+ metadata.gz: 648b54aa7f4c6a972af1bcd2973d05b43ce741f139b1ec23b6b77653c0b3c862bde7184a65ee9e8eaa15e44965abd3eed27a246fb39c5085bd8f0287ae7bab80
7
+ data.tar.gz: 4b1a51013e2e0db30aedf7e9b0859d729ba9999c35c50bbd5d8a604908c7f949398ce6b175231edc7b2436b5fb7b796c4b54c6b138794c70af1b821f9a97628e
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ == 2013-09-25 version 0.10.89
2
+
3
+ * Update td-bulk-import.jar to 0.2.5
4
+ * import command now support nested json format,
5
+
6
+
1
7
  == 2013-09-13 version 0.10.88
2
8
 
3
9
  * Update td-client-ruby to 0.8.55
@@ -40,5 +40,5 @@ echo "$revname" > java/td-bulk-import-java.version
40
40
 
41
41
  echo ""
42
42
  echo "git commit ./java -m \"updated td-bulk-import-java $revname\""
43
- git commit ./java/td-bulk-import-${vername}.jar ./java/td-bulk-import-java.version -m "updated td-bulk-import-java $revname" || exit 1
43
+ git commit ./java/td-bulk-import.jar ./java/td-bulk-import-java.version -m "updated td-bulk-import-java $revname" || exit 1
44
44
 
@@ -1 +1 @@
1
- 7946ca2a469530c5fcadad412f6de21e495d0fbb Fri Sep 13 18:36:18 2013 +0900
1
+ 2c1688a7ea6c9185ac593832122c1b851c91ce63 Tue Sep 24 19:52:22 2013 +0900
Binary file
@@ -5,9 +5,9 @@ module Command
5
5
  BASE_PATH = File.expand_path('../../..', File.dirname(__FILE__))
6
6
 
7
7
  JAVA_COMMAND = "java"
8
- JAVA_COMMAND_CHECK = "#{JAVA_COMMAND} -version"
8
+ JAVA_COMMAND_CHECK = "#{JAVA_COMMAND} -version >/dev/null 2>&1"
9
9
  JAVA_MAIN_CLASS = "com.treasure_data.bulk_import.BulkImportMain"
10
- JAVA_HEAP_MAX_SIZE = "-Xmx1024m" # TODO
10
+ JVM_OPTS = ["-Xmx1024m"] # TODO
11
11
 
12
12
  def import_list(op)
13
13
  require 'td/command/bulk_import'
@@ -73,71 +73,52 @@ module Command
73
73
 
74
74
  private
75
75
  def import_by_java(subcmd)
76
- # has java runtime
76
+ # check java runtime exists or not
77
77
  check_java
78
78
 
79
- # show help
79
+ # show help?
80
80
  show_help = ARGV.size == 0 || (ARGV.size == 1 || ARGV[0] =~ /^import:/)
81
81
 
82
- # configure jvm options
83
- jvm_opts = [ JAVA_HEAP_MAX_SIZE ]
84
-
85
- # configure java options
86
- java_opts = [ "-cp \"#{find_td_bulk_import_jar()}\"" ]
87
-
88
- # configure system properties
89
- sysprops = set_sysprops()
90
-
91
82
  # configure java command-line arguments
92
83
  java_args = []
84
+ java_args.concat build_sysprops
85
+ java_args.concat ["-cp", find_td_bulk_import_jar]
93
86
  java_args << JAVA_MAIN_CLASS
94
87
  java_args << subcmd
95
88
  if show_help
96
89
  java_args << "--help"
97
90
  else
98
- java_args << ARGV
91
+ java_args.concat ARGV
99
92
  end
100
93
 
101
- # TODO consider parameters including spaces; don't use join(' ')
102
- cmd = "#{JAVA_COMMAND} #{jvm_opts.join(' ')} #{java_opts.join(' ')} #{sysprops.join(' ')} #{java_args.join(' ')}"
103
- exec cmd
94
+ cmd = [JAVA_COMMAND] + JVM_OPTS + java_args
95
+ system(*cmd)
104
96
  end
105
97
 
106
98
  private
107
99
  def check_java
108
- pid = do_fork(JAVA_COMMAND_CHECK)
109
- pid, stat = Process.waitpid2(pid)
100
+ system(JAVA_COMMAND_CHECK)
110
101
 
111
- if stat.exitstatus != 0
112
- $stderr.puts "Java is not installed. 'td import' command requires Java (version 1.6 or later). If Java is not installed yet, please use 'bulk_import' commands instead of this command."
102
+ unless $?.success?
103
+ $stderr.puts "Java is not installed. 'td import' command requires Java (version 1.6 or later)."
104
+ $stderr.puts "Alternatively, you can use 'bulk_import' commands instead which is much slower."
113
105
  exit 1
114
106
  end
115
107
  end
116
108
 
117
- def do_fork(cmd)
118
- Process.fork do
119
- begin
120
- Process.exec(*cmd)
121
- ensure
122
- exit! 127
123
- end
124
- end
125
- end
126
-
127
109
  private
128
110
  def find_td_bulk_import_jar
129
111
  libjars = Dir.glob("#{BASE_PATH}/java/**/*.jar")
130
112
  found = libjars.find { |path| File.basename(path) =~ /^td-bulk-import/ }
131
113
  if found.nil?
132
114
  $stderr.puts "td-bulk-import.jar is not found."
133
- exit
115
+ exit 1
134
116
  end
135
- td_bulk_import_jar = libjars.delete(found)
136
- td_bulk_import_jar
117
+ found
137
118
  end
138
119
 
139
120
  private
140
- def set_sysprops
121
+ def build_sysprops
141
122
  sysprops = []
142
123
 
143
124
  # set apiserver
@@ -147,7 +128,7 @@ module Command
147
128
  set_sysprops_http_proxy(sysprops)
148
129
 
149
130
  # set configuration file for logging
150
- conf_file = find_logging_conf_file
131
+ conf_file = try_find_logging_conf_file
151
132
  if conf_file
152
133
  sysprops << "-Djava.util.logging.config.file=#{conf_file}"
153
134
  end
@@ -208,12 +189,9 @@ module Command
208
189
  end
209
190
 
210
191
  private
211
- def find_logging_conf_file
192
+ def try_find_logging_conf_file
212
193
  libjars = Dir.glob("#{BASE_PATH}/java/**/*.properties")
213
- found = libjars.find { |path| File.basename(path) =~ /^logging.properties/ }
214
- return nil if found.nil?
215
- logging_conf_file = libjars.delete(found)
216
- logging_conf_file
194
+ libjars.find { |path| File.basename(path) =~ /^logging.properties/ }
217
195
  end
218
196
 
219
197
  private
@@ -371,6 +371,9 @@ module List
371
371
  add_alias 'scheds', 'sched:list'
372
372
  add_alias 'schedules', 'sched:list'
373
373
 
374
+ add_alias 'import', 'import:show'
375
+ add_alias 'imports', 'import:list'
376
+
374
377
  add_alias 'bulk_import', 'bulk_import:show'
375
378
  add_alias 'bulk_imports', 'bulk_import:list'
376
379
 
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.10.88'
3
+ VERSION = '0.10.89'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,34 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.88
5
- prerelease:
4
+ version: 0.10.89
6
5
  platform: ruby
7
6
  authors:
8
7
  - Treasure Data, Inc.
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-13 00:00:00.000000000 Z
11
+ date: 2013-09-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: msgpack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.4.4
22
- - - ! '!='
20
+ - - '!='
23
21
  - !ruby/object:Gem::Version
24
22
  version: 0.5.0
25
- - - ! '!='
23
+ - - '!='
26
24
  - !ruby/object:Gem::Version
27
25
  version: 0.5.1
28
- - - ! '!='
26
+ - - '!='
29
27
  - !ruby/object:Gem::Version
30
28
  version: 0.5.2
31
- - - ! '!='
29
+ - - '!='
32
30
  - !ruby/object:Gem::Version
33
31
  version: 0.5.3
34
32
  - - <
@@ -37,21 +35,20 @@ dependencies:
37
35
  type: :runtime
38
36
  prerelease: false
39
37
  version_requirements: !ruby/object:Gem::Requirement
40
- none: false
41
38
  requirements:
42
- - - ! '>='
39
+ - - '>='
43
40
  - !ruby/object:Gem::Version
44
41
  version: 0.4.4
45
- - - ! '!='
42
+ - - '!='
46
43
  - !ruby/object:Gem::Version
47
44
  version: 0.5.0
48
- - - ! '!='
45
+ - - '!='
49
46
  - !ruby/object:Gem::Version
50
47
  version: 0.5.1
51
- - - ! '!='
48
+ - - '!='
52
49
  - !ruby/object:Gem::Version
53
50
  version: 0.5.2
54
- - - ! '!='
51
+ - - '!='
55
52
  - !ruby/object:Gem::Version
56
53
  version: 0.5.3
57
54
  - - <
@@ -60,7 +57,6 @@ dependencies:
60
57
  - !ruby/object:Gem::Dependency
61
58
  name: yajl-ruby
62
59
  requirement: !ruby/object:Gem::Requirement
63
- none: false
64
60
  requirements:
65
61
  - - ~>
66
62
  - !ruby/object:Gem::Version
@@ -68,7 +64,6 @@ dependencies:
68
64
  type: :runtime
69
65
  prerelease: false
70
66
  version_requirements: !ruby/object:Gem::Requirement
71
- none: false
72
67
  requirements:
73
68
  - - ~>
74
69
  - !ruby/object:Gem::Version
@@ -76,23 +71,20 @@ dependencies:
76
71
  - !ruby/object:Gem::Dependency
77
72
  name: hirb
78
73
  requirement: !ruby/object:Gem::Requirement
79
- none: false
80
74
  requirements:
81
- - - ! '>='
75
+ - - '>='
82
76
  - !ruby/object:Gem::Version
83
77
  version: 0.4.5
84
78
  type: :runtime
85
79
  prerelease: false
86
80
  version_requirements: !ruby/object:Gem::Requirement
87
- none: false
88
81
  requirements:
89
- - - ! '>='
82
+ - - '>='
90
83
  - !ruby/object:Gem::Version
91
84
  version: 0.4.5
92
85
  - !ruby/object:Gem::Dependency
93
86
  name: parallel
94
87
  requirement: !ruby/object:Gem::Requirement
95
- none: false
96
88
  requirements:
97
89
  - - ~>
98
90
  - !ruby/object:Gem::Version
@@ -100,7 +92,6 @@ dependencies:
100
92
  type: :runtime
101
93
  prerelease: false
102
94
  version_requirements: !ruby/object:Gem::Requirement
103
- none: false
104
95
  requirements:
105
96
  - - ~>
106
97
  - !ruby/object:Gem::Version
@@ -108,7 +99,6 @@ dependencies:
108
99
  - !ruby/object:Gem::Dependency
109
100
  name: td-client
110
101
  requirement: !ruby/object:Gem::Requirement
111
- none: false
112
102
  requirements:
113
103
  - - ~>
114
104
  - !ruby/object:Gem::Version
@@ -116,7 +106,6 @@ dependencies:
116
106
  type: :runtime
117
107
  prerelease: false
118
108
  version_requirements: !ruby/object:Gem::Requirement
119
- none: false
120
109
  requirements:
121
110
  - - ~>
122
111
  - !ruby/object:Gem::Version
@@ -124,7 +113,6 @@ dependencies:
124
113
  - !ruby/object:Gem::Dependency
125
114
  name: td-logger
126
115
  requirement: !ruby/object:Gem::Requirement
127
- none: false
128
116
  requirements:
129
117
  - - ~>
130
118
  - !ruby/object:Gem::Version
@@ -132,7 +120,6 @@ dependencies:
132
120
  type: :runtime
133
121
  prerelease: false
134
122
  version_requirements: !ruby/object:Gem::Requirement
135
- none: false
136
123
  requirements:
137
124
  - - ~>
138
125
  - !ruby/object:Gem::Version
@@ -140,7 +127,6 @@ dependencies:
140
127
  - !ruby/object:Gem::Dependency
141
128
  name: rubyzip
142
129
  requirement: !ruby/object:Gem::Requirement
143
- none: false
144
130
  requirements:
145
131
  - - ~>
146
132
  - !ruby/object:Gem::Version
@@ -148,7 +134,6 @@ dependencies:
148
134
  type: :runtime
149
135
  prerelease: false
150
136
  version_requirements: !ruby/object:Gem::Requirement
151
- none: false
152
137
  requirements:
153
138
  - - ~>
154
139
  - !ruby/object:Gem::Version
@@ -156,7 +141,6 @@ dependencies:
156
141
  - !ruby/object:Gem::Dependency
157
142
  name: rake
158
143
  requirement: !ruby/object:Gem::Requirement
159
- none: false
160
144
  requirements:
161
145
  - - ~>
162
146
  - !ruby/object:Gem::Version
@@ -164,7 +148,6 @@ dependencies:
164
148
  type: :development
165
149
  prerelease: false
166
150
  version_requirements: !ruby/object:Gem::Requirement
167
- none: false
168
151
  requirements:
169
152
  - - ~>
170
153
  - !ruby/object:Gem::Version
@@ -172,7 +155,6 @@ dependencies:
172
155
  - !ruby/object:Gem::Dependency
173
156
  name: rspec
174
157
  requirement: !ruby/object:Gem::Requirement
175
- none: false
176
158
  requirements:
177
159
  - - ~>
178
160
  - !ruby/object:Gem::Version
@@ -180,7 +162,6 @@ dependencies:
180
162
  type: :development
181
163
  prerelease: false
182
164
  version_requirements: !ruby/object:Gem::Requirement
183
- none: false
184
165
  requirements:
185
166
  - - ~>
186
167
  - !ruby/object:Gem::Version
@@ -188,7 +169,6 @@ dependencies:
188
169
  - !ruby/object:Gem::Dependency
189
170
  name: simplecov
190
171
  requirement: !ruby/object:Gem::Requirement
191
- none: false
192
172
  requirements:
193
173
  - - ~>
194
174
  - !ruby/object:Gem::Version
@@ -196,7 +176,6 @@ dependencies:
196
176
  type: :development
197
177
  prerelease: false
198
178
  version_requirements: !ruby/object:Gem::Requirement
199
- none: false
200
179
  requirements:
201
180
  - - ~>
202
181
  - !ruby/object:Gem::Version
@@ -282,33 +261,26 @@ files:
282
261
  - td.gemspec
283
262
  homepage: http://treasure-data.com/
284
263
  licenses: []
264
+ metadata: {}
285
265
  post_install_message:
286
266
  rdoc_options: []
287
267
  require_paths:
288
268
  - lib
289
269
  required_ruby_version: !ruby/object:Gem::Requirement
290
- none: false
291
270
  requirements:
292
- - - ! '>='
271
+ - - '>='
293
272
  - !ruby/object:Gem::Version
294
273
  version: '0'
295
- segments:
296
- - 0
297
- hash: 3857310954122118624
298
274
  required_rubygems_version: !ruby/object:Gem::Requirement
299
- none: false
300
275
  requirements:
301
- - - ! '>='
276
+ - - '>='
302
277
  - !ruby/object:Gem::Version
303
278
  version: '0'
304
- segments:
305
- - 0
306
- hash: 3857310954122118624
307
279
  requirements: []
308
280
  rubyforge_project:
309
- rubygems_version: 1.8.23
281
+ rubygems_version: 2.0.3
310
282
  signing_key:
311
- specification_version: 3
283
+ specification_version: 4
312
284
  summary: CLI to manage data on Treasure Data, the Hadoop-based cloud data warehousing
313
285
  test_files:
314
286
  - spec/file_reader/filter_spec.rb