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 +8 -8
- data/VERSION +1 -1
- data/bin/mandy +1 -1
- data/bin/mandy-cp +2 -1
- data/bin/mandy-get +15 -1
- data/bin/mandy-mkdir +2 -1
- data/bin/mandy-mv +2 -1
- data/bin/mandy-put +2 -1
- data/bin/mandy-rm +2 -1
- metadata +6 -6
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
`
|
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.
|
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
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
data/bin/mandy-mv
CHANGED
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
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:
|
4
|
+
hash: 39
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
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-
|
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/
|
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.
|
142
|
+
rubygems_version: 1.6.2
|
143
143
|
signing_key:
|
144
144
|
specification_version: 2
|
145
145
|
summary: Map/Reduce Framework
|