Sha256: cf086ae05d9f392240469d7896e5cd1f7e1b459f68c323505b872ff6267cc6c9

Contents?: true

Size: 1.38 KB

Versions: 7

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby

require "rubygems"
require "mandy"

# Hadoop Home Detection
hadoop_home = `echo $HADOOP_HOME`.chomp

if hadoop_home== ''
  puts "You need to set the HADOOP_HOME environment variable to point to your hadoop install    :("
  puts "Try setting 'export HADOOP_HOME=/my/hadoop/path' in your ~/.profile maybe?"
  exit(1)
end

# Hadoop Version Detection
hadoop_version = `$HADOOP_HOME/bin/hadoop version 2>&1`

if hadoop_version =~ /No such file or directory/
  puts("Mandy failed to find Hadoop in #{hadoop_home}     :(")
  puts
  puts hadoop_version
  exit(1)
end

# Status & Help Message
puts "\nYou are running Mandy!"
puts "========================"
puts
puts "Using #{hadoop_version.split("\n").first} located at #{`echo $HADOOP_HOME`}"
puts
puts "Available Mandy Commands"
puts '------------------------'

{
  'mandy-install' => 'Installs the Mandy Rubygem on several hosts via ssh.',
  'mandy-local' => 'Run a Map/Reduce task locally without requiring hadoop',
  'mandy-hadoop' => 'Run a Map/Reduce task on hadoop using the provided cluster config',
  'mandy-rm' => 'remove a file or directory from HDFS',
  'mandy-put' => 'upload a file into HDFS',
  'mandy-map' => 'Run a map task reading on STDIN and writing to STDOUT',
  'mandy-reduce' => 'Run a reduce task reading on STDIN and writing to STDOUT'
}.each do |command, description|

  puts "#{command.ljust(15)} #{description}"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mandy-0.4.92 bin/mandy
mandy-0.4.91 bin/mandy
mandy-0.4.90 bin/mandy
mandy-0.4.89 bin/mandy
mandy-0.4.88 bin/mandy
mandy-0.4.87 bin/mandy
mandy-0.4.86 bin/mandy