trafficbroker-mandy 0.2.6 → 0.2.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 (4) hide show
  1. data/bin/mandy-hadoop +6 -0
  2. data/lib/task.rb +4 -1
  3. data/readme.md +3 -1
  4. metadata +2 -2
data/bin/mandy-hadoop CHANGED
@@ -17,6 +17,10 @@ OptionParser.new do |opts|
17
17
  options.config = config
18
18
  end
19
19
 
20
+ opts.on("-v", '--variables name=value', "Pass additional parameters to jobs") do |config|
21
+ options.cmdenv = config
22
+ end
23
+
20
24
  opts.on_tail("-h", "--help", "Show this message") do
21
25
  puts opts
22
26
  exit
@@ -33,6 +37,7 @@ input = ARGV[1]
33
37
  output_folder = ARGV[2]
34
38
  config = options.config || 'cluster.xml'
35
39
  payload = options.payload ? Mandy::Packer.pack(options.payload) : ARGV[0]
40
+ cmdenv = options.cmdenv
36
41
 
37
42
  at_exit { Mandy::Packer.cleanup!(payload) }
38
43
 
@@ -51,6 +56,7 @@ Mandy::Job.jobs.each_with_index do |job, i|
51
56
  -mapper "mandy-map #{filename} '#{job.name}' #{File.basename(payload)}" \
52
57
  -reducer "mandy-reduce #{filename} '#{job.name}' #{File.basename(payload)}" \
53
58
  -file "#{payload}" \
59
+ -cmdenv #{cmdenv} \
54
60
  -output "#{output}")
55
61
 
56
62
  `#{command}`
data/lib/task.rb CHANGED
@@ -20,7 +20,10 @@ module Mandy
20
20
  end
21
21
 
22
22
  private
23
-
23
+
24
+ def parameter(name)
25
+ ENV[name.to_s]
26
+ end
24
27
 
25
28
  def serialize(value)
26
29
  value = ArraySerializer.new(value) if value.is_a?(Array)
data/readme.md CHANGED
@@ -6,4 +6,6 @@ Mandy hides the differences and complexities between running map/reduce tasks lo
6
6
  It provides a simple DSL to define new jobs for distribution. See examples/word_count.rb for a demo of some functionality.
7
7
  Run the word count example locally with...
8
8
 
9
- mandy-local examples/word_count.rb examples/alice.txt examples/output
9
+ mandy-local examples/word_count.rb examples/alice.txt examples/output
10
+
11
+ Mandy is licensed under the MIT Licence, please see LICENCE for further information.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trafficbroker-mandy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Kent
@@ -63,7 +63,7 @@ files:
63
63
  - lib/ruby-hbase/xml_decoder.rb
64
64
  - lib/test_runner.rb
65
65
  has_rdoc: false
66
- homepage:
66
+ homepage: http://github.com/trafficbroker/mandy
67
67
  licenses:
68
68
  post_install_message:
69
69
  rdoc_options: []