remoteHadoopGem 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/remoteHadoopGem.rb +5 -2
- metadata +3 -3
data/lib/remoteHadoopGem.rb
CHANGED
@@ -26,11 +26,14 @@ class RemoteHadoopGem
|
|
26
26
|
# 2) host (IP of the hadoop machine)
|
27
27
|
# 3) keyPathFile (path of the private key to access the machine)
|
28
28
|
# 4) command to execute
|
29
|
-
|
29
|
+
def self.tryOne()
|
30
|
+
return "yO!"
|
31
|
+
end
|
30
32
|
def self.commandToHadoopJobID(username, host, keyPathFile, command)
|
31
33
|
# create a file with a random name to obtained the jobID
|
32
34
|
filename="tempJobID_"+UUIDTools::UUID.random_create.to_s
|
33
|
-
|
35
|
+
#`ssh -n -f -i "#{keyPathFile}" "#{username}"@"#{host}" 'sh -c "export PATH=/hadoop/bin/:$PATH; cd /hadoop/; nohup #{command} >/dev/null 2>#{filename}.txt & " '`
|
36
|
+
`ssh -i "#{keyPathFile}" "#{username}"@"#{host}" 'sh -c "export PATH=/hadoop/bin/:$PATH; cd /hadoop/; nohup #{command} >/dev/null 2>#{filename}.txt & " '`
|
34
37
|
res=`sleep 10; ssh -i "#{keyPathFile}" "#{username}"@"#{host}" "cat /hadoop/#{filename}.txt | grep 'Running job' " `
|
35
38
|
`ssh -i "#{keyPathFile}" "#{username}"@"#{host}" "rm /hadoop/#{filename}.txt"`
|
36
39
|
jobid=res.split[6]
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remoteHadoopGem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
-
|
8
|
+
- Sfraternale
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
@@ -42,5 +42,5 @@ rubyforge_project:
|
|
42
42
|
rubygems_version: 1.8.25
|
43
43
|
signing_key:
|
44
44
|
specification_version: 3
|
45
|
-
summary:
|
45
|
+
summary: Connect!
|
46
46
|
test_files: []
|