remoteHadoopGem 0.0.3 → 0.0.4
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.
- data/lib/remoteHadoopGem.rb +10 -3
- metadata +1 -1
data/lib/remoteHadoopGem.rb
CHANGED
@@ -26,9 +26,7 @@ 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
|
-
|
30
|
-
return "yO!"
|
31
|
-
end
|
29
|
+
|
32
30
|
def self.commandToHadoopJobID(username, host, keyPathFile, command)
|
33
31
|
# create a file with a random name to obtained the jobID
|
34
32
|
filename="tempJobID_"+UUIDTools::UUID.random_create.to_s
|
@@ -103,6 +101,15 @@ class RemoteHadoopGem
|
|
103
101
|
return "#{res}"
|
104
102
|
end
|
105
103
|
|
104
|
+
#
|
105
|
+
# ****** cleanTempFiles ******
|
106
|
+
#
|
107
|
+
# function to clean all the temporary files created by commandToHadoopJobID
|
108
|
+
# require:
|
109
|
+
# 1) username (to access the machine via ssh)
|
110
|
+
# 2) host (IP of the hadoop machine)
|
111
|
+
# 3) keyPathFile (path of the private key to access the machine)
|
112
|
+
#
|
106
113
|
|
107
114
|
def self.cleanTempFiles(username, host, keyPathFile)
|
108
115
|
`ssh -i "#{keyPathFile}" -o StrictHostKeyChecking=no "#{username}"@"#{host}" "export PATH=/hadoop/bin/:$PATH; cd /hadoop/; rm ./tempJobID_* "`
|