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