Sha256: df4ec9d1d2f5926582f4d4ace1f6d2cf428309be6a182a5af5b6c487c688f241
Contents?: true
Size: 727 Bytes
Versions: 40
Compression:
Stored size: 727 Bytes
Contents
#!/usr/bin/env ruby require 'optparse' require 'ostruct' exec('mandy-get -h') unless ARGV.size >= 2 options = OpenStruct.new OptionParser.new do |opts| opts.banner = "USAGE: mandy-get hdfs_file_location local_file_destination [options]" opts.on("-c", "--conf HADOOP_CONF", "Use this cluster xml config file.") do |config| options.config = config end opts.on_tail("-h", "--help", "Show this message") do puts opts exit end end.parse! def absolute_path(path) path =~ /^\// ? path : File.join(Dir.pwd, path) end remote_file = ARGV[0] local_file = ARGV[1] config = absolute_path(options.config || 'cluster.xml') `$HADOOP_HOME/bin/hadoop fs -conf #{config} -getmerge #{remote_file} #{local_file}`
Version data entries
40 entries across 40 versions & 1 rubygems