Sha256: c45dcaea3d35c64f98728813ea641d1f7e144bee939ea960abc59cac0d8dae36

Contents?: true

Size: 714 Bytes

Versions: 40

Compression:

Stored size: 714 Bytes

Contents

#!/usr/bin/env ruby
require 'optparse'
require 'ostruct'

exec('mandy-put -h') unless ARGV.size >= 2


options = OpenStruct.new

OptionParser.new do |opts|
  opts.banner = "USAGE: mandy-put local_file_or_folder hdfs_destination_location [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

source = absolute_path(ARGV[0])
dest = ARGV[1]
config = options.config || 'cluster.xml'

`$HADOOP_HOME/bin/hadoop fs -conf #{config} -copyFromLocal #{source} #{dest}`

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
mandy-0.4.94 bin/mandy-put
mandy-0.4.93 bin/mandy-put
mandy-0.4.92 bin/mandy-put
mandy-0.4.91 bin/mandy-put
mandy-0.4.90 bin/mandy-put
mandy-0.4.89 bin/mandy-put
mandy-0.4.88 bin/mandy-put
mandy-0.4.87 bin/mandy-put
mandy-0.4.86 bin/mandy-put
mandy-0.4.83 bin/mandy-put
mandy-0.4.10 bin/mandy-put
mandy-0.4.81 bin/mandy-put
mandy-0.4.8 bin/mandy-put
mandy-0.4.7 bin/mandy-put
mandy-0.4.6 bin/mandy-put
mandy-0.4.5 bin/mandy-put
mandy-0.4.4 bin/mandy-put
mandy-0.4.3 bin/mandy-put
mandy-0.4.2 bin/mandy-put
mandy-0.4.1 bin/mandy-put