houdah 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -0
- data/Rakefile +1 -1
- data/lib/houdah.rb +1 -0
- data/lib/houdah/client.rb +19 -6
- data/lib/houdah/job.rb +2 -1
- data/lib/houdah/tracker.rb +20 -0
- data/lib/houdah/version.rb +1 -1
- metadata +5 -4
data/README.rdoc
CHANGED
@@ -33,6 +33,16 @@ Houdah has been tested with Hue 1.1.0. If you have it working with a later vers
|
|
33
33
|
# get percent done for the most recent job
|
34
34
|
client.jobs.first.percent_done
|
35
35
|
|
36
|
+
# print out info about each tracker
|
37
|
+
client.trackers.each { |t| puts "#{t.host}: #{t.failureCount} failures, #{t.tasks.length} active tasks" }
|
38
|
+
|
39
|
+
# get number of active / blacklisted trackers
|
40
|
+
client.status.numActiveTrackers
|
41
|
+
client.status.numBlacklistedTrackers
|
42
|
+
|
43
|
+
# get number of excluded nodes
|
44
|
+
client.status.numExcludedNodes
|
45
|
+
|
36
46
|
# get the mapred.local.dir config variable for the most recent job
|
37
47
|
puts client.jobs.first.config['mapred.local.dir']
|
38
48
|
|
data/Rakefile
CHANGED
data/lib/houdah.rb
CHANGED
data/lib/houdah/client.rb
CHANGED
@@ -19,15 +19,28 @@ module Houdah
|
|
19
19
|
## Get jobs. Type can be :running, :completed, :killed, :failed, or :all
|
20
20
|
def jobs(type=:running)
|
21
21
|
results = case type
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
when :running then call(:getRunningJobs)
|
23
|
+
when :completed then call(:getCompletedJobs)
|
24
|
+
when :failed then call(:getFailedJobs)
|
25
|
+
when :killed then call(:getKilledJobs)
|
26
|
+
else call(:getAllJobs)
|
27
|
+
end
|
28
28
|
results.jobs.map { |j| Job.new(self, j) }
|
29
29
|
end
|
30
30
|
|
31
|
+
def trackers(type=:active)
|
32
|
+
results = case type
|
33
|
+
when :active then call(:getActiveTrackers)
|
34
|
+
when :blacklisted then call(:getBlacklistedTrackers)
|
35
|
+
when :all then call(:getAllTrackers)
|
36
|
+
end
|
37
|
+
results.trackers.map { |t| Tracker.new(self, t) }
|
38
|
+
end
|
39
|
+
|
40
|
+
def status
|
41
|
+
call :getClusterStatus
|
42
|
+
end
|
43
|
+
|
31
44
|
def queues
|
32
45
|
call :getQueues
|
33
46
|
end
|
data/lib/houdah/job.rb
CHANGED
@@ -8,6 +8,7 @@ module Houdah
|
|
8
8
|
def initialize(client, thrift_job)
|
9
9
|
@client = client
|
10
10
|
@thrift_job = thrift_job
|
11
|
+
@parsed_config = nil
|
11
12
|
end
|
12
13
|
|
13
14
|
## Get the job's config XML
|
@@ -17,7 +18,7 @@ module Houdah
|
|
17
18
|
|
18
19
|
## Get the job's config, as a Hash
|
19
20
|
def config
|
20
|
-
Nokogiri::XML(config_xml).xpath("//property").inject({}) { |props, xprop|
|
21
|
+
@parsed_config ||= Nokogiri::XML(config_xml).xpath("//property").inject({}) { |props, xprop|
|
21
22
|
props[xprop.xpath("./name").text] = xprop.xpath("./value").text
|
22
23
|
props
|
23
24
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Houdah
|
2
|
+
|
3
|
+
class Tracker
|
4
|
+
attr_reader :thrift_tracker
|
5
|
+
|
6
|
+
def initialize(client, thrift_tracker)
|
7
|
+
@client = client
|
8
|
+
@thrift_tracker = thrift_tracker
|
9
|
+
end
|
10
|
+
|
11
|
+
def tasks
|
12
|
+
@thrift_tracker.taskReports || []
|
13
|
+
end
|
14
|
+
|
15
|
+
def method_missing(method, *args)
|
16
|
+
@thrift_tracker.send method, *args
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/lib/houdah/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: houdah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Muller
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-12 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- lib/houdah/client.rb
|
63
63
|
- lib/houdah/job.rb
|
64
|
+
- lib/houdah/tracker.rb
|
64
65
|
- lib/houdah/version.rb
|
65
66
|
- lib/houdah.rb
|
66
67
|
- lib/thrift/common_constants.rb
|