mandy 0.5.21 → 0.5.22

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,14 +1,14 @@
1
1
  require 'rubygems'
2
2
  require "rake"
3
3
  require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'mandy'))
4
- require 'spec/rake/spectask'
4
+ # require 'spec/rake/spectask'
5
+ #
6
+ # task :default => :spec
5
7
 
6
- task :default => :spec
7
-
8
- Spec::Rake::SpecTask.new(:spec) do |t|
9
- t.spec_files = FileList['spec/lib/**/*_spec.rb']
10
- t.spec_opts = %w{-f s -c -L mtime}
11
- end
8
+ # Spec::Rake::SpecTask.new(:spec) do |t|
9
+ # t.spec_files = FileList['spec/lib/**/*_spec.rb']
10
+ # t.spec_opts = %w{-f s -c -L mtime}
11
+ # end
12
12
 
13
13
  namespace :gem do
14
14
  task :build do
@@ -17,7 +17,7 @@ namespace :gem do
17
17
  end
18
18
 
19
19
  task :install => :build do
20
- `sudo gem install pkg/mandy-*.gem --no-rdoc --no-ri`
20
+ `gem install pkg/mandy-*.gem --no-rdoc --no-ri`
21
21
  end
22
22
 
23
23
  task :push => :build do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.21
1
+ 0.5.22
data/bin/mandy CHANGED
@@ -18,7 +18,7 @@ puts '------------------------'
18
18
  'mandy-cat' => 'Concatenate and print files from HDFS',
19
19
  'mandy-cp' => 'Copy file from HDFS',
20
20
  'mandy-exists' => 'Check to see if a file exists in HDFS',
21
- 'mandy-get' => 'Copy and merge files to the local file system. The allowed formats are zip and TextRecordInputStream',
21
+ 'mandy-get' => 'Copy and merge files to the local file system. The allowed formats are zip and TextRecordInputStream, use --raw for others',
22
22
  'mandy-hadoop' => 'Run a Map/Reduce task on hadoop using the provided cluster config',
23
23
  'mandy-hdfs' => 'Execute generic Hadoop FS command on HDFS',
24
24
  'mandy-install' => 'Installs the Mandy Rubygem on several hosts via ssh.',
data/bin/mandy-cp CHANGED
@@ -29,4 +29,5 @@ source = ARGV[0]
29
29
  destination = ARGV[1]
30
30
  config = options.config || 'cluster.xml'
31
31
 
32
- `$HADOOP_HOME/bin/hadoop fs -conf #{config} -cp #{source} #{destination}`
32
+ `$HADOOP_HOME/bin/hadoop fs -conf #{config} -cp #{source} #{destination}`
33
+ exit($?.exitstatus)
data/bin/mandy-get CHANGED
@@ -10,7 +10,7 @@ HadoopConfiguration.check_home_and_version
10
10
 
11
11
  exec('mandy-get -h') unless ARGV.size >= 2
12
12
 
13
- options = OpenStruct.new
13
+ options = OpenStruct.new(:raw => false, :merge => false)
14
14
 
15
15
  OptionParser.new do |opts|
16
16
  opts.banner = "USAGE: mandy-get hdfs_file_location local_file_destination [options]"
@@ -19,6 +19,14 @@ OptionParser.new do |opts|
19
19
  options.config = config
20
20
  end
21
21
 
22
+ opts.on('-r', "--raw", "Get the raw file without decompression.") do |config|
23
+ options.raw = true
24
+ end
25
+
26
+ opts.on('-m', "--merge", "Get a whole folder and merge results.") do |config|
27
+ options.merge = true
28
+ end
29
+
22
30
  opts.on_tail("-h", "--help", "Show this message") do
23
31
  puts opts
24
32
  exit
@@ -41,6 +49,12 @@ end
41
49
  def is_a_valid(path)
42
50
  path =~ /\/(\S+)/
43
51
  end
52
+
53
+ if options.raw
54
+ puts "$HADOOP_HOME/bin/hadoop fs -conf #{config} -get#{options.merge ? 'merge' : ''} #{remote_file} #{local_file}"
55
+ exit($?.exitstatus)
56
+ end
57
+
44
58
  FileUtils.mkdir_p(File.split(local_file)[0])
45
59
  File.open("#{local_file}", "a") do |target|
46
60
  IO.popen("$HADOOP_HOME/bin/hadoop fs -conf #{config} -ls #{remote_file}").each_line do |line|
data/bin/mandy-mkdir CHANGED
@@ -28,4 +28,5 @@ end.parse!
28
28
  dir = ARGV[0]
29
29
  config = options.config || 'cluster.xml'
30
30
 
31
- `$HADOOP_HOME/bin/hadoop fs -conf #{config} -mkdir #{dir}`
31
+ `$HADOOP_HOME/bin/hadoop fs -conf #{config} -mkdir #{dir}`
32
+ exit($?.exitstatus)
data/bin/mandy-mv CHANGED
@@ -29,4 +29,5 @@ source = ARGV[0]
29
29
  destination = ARGV[1]
30
30
  config = options.config || 'cluster.xml'
31
31
 
32
- `$HADOOP_HOME/bin/hadoop fs -conf #{config} -mv #{source} #{destination}`
32
+ `$HADOOP_HOME/bin/hadoop fs -conf #{config} -mv #{source} #{destination}`
33
+ exit($?.exitstatus)
data/bin/mandy-put CHANGED
@@ -33,4 +33,5 @@ source = absolute_path(ARGV[0])
33
33
  dest = ARGV[1]
34
34
  config = options.config || 'cluster.xml'
35
35
 
36
- `$HADOOP_HOME/bin/hadoop fs -conf #{config} -copyFromLocal #{source} #{dest}`
36
+ `$HADOOP_HOME/bin/hadoop fs -conf #{config} -copyFromLocal #{source} #{dest}`
37
+ exit($?.exitstatus)
data/bin/mandy-rm CHANGED
@@ -42,4 +42,5 @@ if !options.force and File.expand_path(file).split("/").size <= 2
42
42
  exit
43
43
  end
44
44
 
45
- `$HADOOP_HOME/bin/hadoop fs -conf #{config} -rmr #{file}`
45
+ `$HADOOP_HOME/bin/hadoop fs -conf #{config} -rmr #{file}`
46
+ exit($?.exitstatus)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 33
4
+ hash: 39
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 21
10
- version: 0.5.21
9
+ - 22
10
+ version: 0.5.22
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Kent
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-25 00:00:00 +01:00
19
+ date: 2011-06-02 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -110,7 +110,7 @@ files:
110
110
  - lib/mandy/test_runner.rb
111
111
  - bin/mandy-hdfs
112
112
  has_rdoc: true
113
- homepage: http://github.com/trafficbroker/mandy
113
+ homepage: http://github.com/forward/mandy
114
114
  licenses: []
115
115
 
116
116
  post_install_message:
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  requirements: []
140
140
 
141
141
  rubyforge_project:
142
- rubygems_version: 1.4.2
142
+ rubygems_version: 1.6.2
143
143
  signing_key:
144
144
  specification_version: 2
145
145
  summary: Map/Reduce Framework