Sha256: 9c4800bbd21f02c1c2f048d90f552cc3fa3a46a8b27e3956d1a41222acd13bde

Contents?: true

Size: 1.37 KB

Versions: 22

Compression:

Stored size: 1.37 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

22 entries across 22 versions & 1 rubygems

Version Path
mandy-0.5.9 bin/mandy
mandy-0.5.8 bin/mandy
mandy-0.5.7 bin/mandy
mandy-0.5.6 bin/mandy
mandy-0.5.5 bin/mandy
mandy-0.5.3 bin/mandy
mandy-0.5.2 bin/mandy
mandy-0.5.1 bin/mandy
mandy-0.5 bin/mandy
mandy-0.4.996 bin/mandy
mandy-0.4.995 bin/mandy
mandy-0.4.994 bin/mandy
mandy-0.4.993 bin/mandy
mandy-0.4.992 bin/mandy
mandy-0.4.991 bin/mandy
mandy-0.4.99 bin/mandy
mandy-0.4.98 bin/mandy
mandy-0.4.97 bin/mandy
mandy-0.4.96 bin/mandy
mandy-0.4.95 bin/mandy