mandy 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/mandy +3 -1
  3. data/bin/mandy-lsr +33 -0
  4. metadata +4 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.10
1
+ 0.5.11
data/bin/mandy CHANGED
@@ -21,7 +21,9 @@ puts '------------------------'
21
21
  'mandy-rm' => 'remove a file or directory from HDFS',
22
22
  'mandy-put' => 'upload a file into HDFS',
23
23
  'mandy-map' => 'Run a map task reading on STDIN and writing to STDOUT',
24
- 'mandy-reduce' => 'Run a reduce task reading on STDIN and writing to STDOUT'
24
+ 'mandy-reduce' => 'Run a reduce task reading on STDIN and writing to STDOUT',
25
+ 'mandy-lsr' => 'Recursively list files or directorys on HDFS'
26
+
25
27
  }.each do |command, description|
26
28
 
27
29
  puts "#{command.ljust(15)} #{description}"
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ require 'optparse'
3
+ require 'ostruct'
4
+
5
+ require "rubygems"
6
+ require "mandy"
7
+
8
+
9
+ HadoopConfiguration.check_home_and_version
10
+
11
+ exec('mandy-lsr -h') unless ARGV.size == 1
12
+
13
+ options = OpenStruct.new
14
+
15
+ OptionParser.new do |opts|
16
+ opts.banner = "USAGE: mandy-lsr file_or_directory"
17
+
18
+ opts.on("-c", "--conf HADOOP_CONF", "Use this cluster xml config file.") do |config|
19
+ options.config = config
20
+ end
21
+
22
+ opts.on_tail("-h", "--help", "Show this message") do
23
+ puts opts
24
+ exit
25
+ end
26
+ end.parse!
27
+
28
+ file = ARGV[0]
29
+ config = options.config || 'cluster.xml'
30
+
31
+
32
+ list = system("$HADOOP_HOME/bin/hadoop fs -conf #{config} -lsr #{file}")
33
+ puts list
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 10
9
- version: 0.5.10
8
+ - 11
9
+ version: 0.5.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Kent
@@ -49,6 +49,7 @@ executables:
49
49
  - mandy-mkdir
50
50
  - mandy-exists
51
51
  - mandy-install
52
+ - mandy-lsr
52
53
  extensions: []
53
54
 
54
55
  extra_rdoc_files: []
@@ -69,6 +70,7 @@ files:
69
70
  - bin/mandy-mkdir
70
71
  - bin/mandy-exists
71
72
  - bin/mandy-install
73
+ - bin/mandy-lsr
72
74
  - VERSION
73
75
  - readme.md
74
76
  - Rakefile