Sha256: f6c182bc8a5951cd2e01f9ad6f9a9ba44f91935f785b675d8b4c5406f81c58f9

Contents?: true

Size: 738 Bytes

Versions: 15

Compression:

Stored size: 738 Bytes

Contents

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

require "rubygems"
require "mandy"

HadoopConfiguration.check_home_and_version


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

options = OpenStruct.new

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

hdfs_path = ARGV[0]
config = absolute_path(options.config || 'cluster.xml')

exec("$HADOOP_HOME/bin/hadoop fs -conf #{config} -cat #{hdfs_path}")

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mandy-0.5.28 bin/mandy-cat
mandy-0.5.27 bin/mandy-cat
mandy-0.5.26 bin/mandy-cat
mandy-0.5.25 bin/mandy-cat
mandy-0.5.24 bin/mandy-cat
mandy-0.5.23 bin/mandy-cat
mandy-0.5.22 bin/mandy-cat
mandy-0.5.21 bin/mandy-cat
mandy-0.5.20 bin/mandy-cat
mandy-0.5.19 bin/mandy-cat
mandy-0.5.17 bin/mandy-cat
mandy-0.5.14 bin/mandy-cat
mandy-0.5.13 bin/mandy-cat
mandy-0.5.11 bin/mandy-cat
mandy-0.5.10 bin/mandy-cat