Sha256: e390489e0e42af10c9a00f414d0611b0b127bea6dc2f444fe579787e5ddcf4e4

Contents?: true

Size: 669 Bytes

Versions: 24

Compression:

Stored size: 669 Bytes

Contents

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

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

24 entries across 24 versions & 2 rubygems

Version Path
mandy-0.3.2 bin/mandy-put
mandy-0.3.1 bin/mandy-put
mandy-0.2.15 bin/mandy-put
mandy-0.2.14 bin/mandy-put