Sha256: 37184937d1176dc2bb3c9ea64d642d4c6fd6b47a72027e3cc68e143a8c49932e

Contents?: true

Size: 1.44 KB

Versions: 11

Compression:

Stored size: 1.44 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-run' => 'Run an entire Map/Reduce workflow with one command',
  '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

11 entries across 11 versions & 1 rubygems

Version Path
mandy-0.4.83 bin/mandy
mandy-0.4.10 bin/mandy
mandy-0.4.81 bin/mandy
mandy-0.4.8 bin/mandy
mandy-0.4.7 bin/mandy
mandy-0.4.6 bin/mandy
mandy-0.4.5 bin/mandy
mandy-0.4.4 bin/mandy
mandy-0.4.3 bin/mandy
mandy-0.4.2 bin/mandy
mandy-0.4.1 bin/mandy