Class: Hadupils::Extensions::FlatArchivePath
- Inherits:
-
Flat
- Object
- Base
- Flat
- Hadupils::Extensions::FlatArchivePath
show all
- Defined in:
- lib/hadupils/extensions.rb
Instance Attribute Summary
Attributes inherited from Base
#assets, #path
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Flat
#assemble_hiverc, #hivercs
Methods inherited from Base
gather_assets, #hadoop_confs, #hivercs, #initialize, #merge_assets
Class Method Details
.assemble_path_env(archives) ⇒ Object
321
322
323
324
|
# File 'lib/hadupils/extensions.rb', line 321
def self.assemble_path_env(archives)
paths = archives.collect {|a| "$(pwd)/#{ a.name }/bin" }
"SET mapred.child.env = PATH=#{ paths.join(':') }:$PATH;"
end
|
Instance Method Details
#archives_for_path_env ⇒ Object
298
299
300
301
302
303
304
305
306
307
308
309
310
|
# File 'lib/hadupils/extensions.rb', line 298
def archives_for_path_env
@assets.find_all do |a|
if a.kind_of? Hadupils::Assets::Archive
begin
Hadupils::Util.archive_has_directory?(a.path, 'bin')
rescue
false
end
else
false
end
end
end
|
#default_hiverc_items ⇒ Object
312
313
314
315
316
317
318
319
|
# File 'lib/hadupils/extensions.rb', line 312
def default_hiverc_items
items = super
archs = archives_for_path_env
if archs.length > 0
items << self.class.assemble_path_env(archs)
end
items
end
|