mandy 0.4.6 → 0.4.7

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 (3) hide show
  1. data/bin/mandy-exists +30 -0
  2. data/bin/mandy-mv +27 -0
  3. metadata +4 -2
data/bin/mandy-exists ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ require 'optparse'
3
+ require 'ostruct'
4
+
5
+ exec('mandy-exists -h') unless ARGV.size >= 2
6
+
7
+
8
+ options = OpenStruct.new
9
+
10
+ OptionParser.new do |opts|
11
+ opts.banner = "USAGE: mandy-exists hdfs_file_path [options]"
12
+
13
+ opts.on("-c", "--conf HADOOP_CONF", "Use this cluster xml config file.") do |config|
14
+ options.config = config
15
+ end
16
+
17
+ opts.on_tail("-h", "--help", "Show this message") do
18
+ puts opts
19
+ exit
20
+ end
21
+ end.parse!
22
+
23
+ source = ARGV[0]
24
+ config = options.config || 'cluster.xml'
25
+
26
+ exists = system("$HADOOP_HOME/bin/hadoop fs -conf #{config} -test -e #{source}")
27
+
28
+ puts(exists ? "#{source} exists" : "#{source} not found")
29
+ exit(exists ? 0 : -1)
30
+
data/bin/mandy-mv ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ require 'optparse'
3
+ require 'ostruct'
4
+
5
+ exec('mandy-mv -h') unless ARGV.size >= 2
6
+
7
+
8
+ options = OpenStruct.new
9
+
10
+ OptionParser.new do |opts|
11
+ opts.banner = "USAGE: mandy-mv source destination [options]"
12
+
13
+ opts.on("-c", "--conf HADOOP_CONF", "Use this cluster xml config file.") do |config|
14
+ options.config = config
15
+ end
16
+
17
+ opts.on_tail("-h", "--help", "Show this message") do
18
+ puts opts
19
+ exit
20
+ end
21
+ end.parse!
22
+
23
+ source = ARGV[0]
24
+ destination = ARGV[1]
25
+ config = options.config || 'cluster.xml'
26
+
27
+ `$HADOOP_HOME/bin/hadoop fs -conf #{config} -mv #{source} #{destination}`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Kent
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-10-15 00:00:00 +01:00
13
+ date: 2009-10-16 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -34,6 +34,8 @@ executables:
34
34
  - mandy-get
35
35
  - mandy-reduce
36
36
  - mandy-rm
37
+ - mandy-mv
38
+ - mandy-exists
37
39
  - mandy-install
38
40
  - mandy-run
39
41
  extensions: []