summaryrefslogtreecommitdiffstats
path: root/gearman/controllerWorker/ControllerWorker/Boot.java
diff options
context:
space:
mode:
Diffstat (limited to 'gearman/controllerWorker/ControllerWorker/Boot.java')
-rw-r--r--gearman/controllerWorker/ControllerWorker/Boot.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/gearman/controllerWorker/ControllerWorker/Boot.java b/gearman/controllerWorker/ControllerWorker/Boot.java
index 01cf911..54a0ede 100644
--- a/gearman/controllerWorker/ControllerWorker/Boot.java
+++ b/gearman/controllerWorker/ControllerWorker/Boot.java
@@ -38,7 +38,7 @@ public class Boot extends Thread {
private HashMap<Integer, GearmanJob> pingWoLJobs;
private HashMap<Integer, GearmanJob> osJobs;
private HashMap<Integer, GearmanJob> whoJobs;
- private HashMap<Integer, GearmanJob> topJobs;
+ private HashMap<Integer, GearmanJob> psJobs;
private HashMap<Integer, GearmanJob> restartJobs;
private HashMap<Integer, GearmanJob> pingRestartJobs;
private HashMap<Integer, Integer> status;
@@ -59,7 +59,7 @@ public class Boot extends Thread {
this.wolJobs = new HashMap<Integer, GearmanJob>();
this.osJobs = new HashMap<Integer, GearmanJob>();
this.whoJobs = new HashMap<Integer, GearmanJob>();
- this.topJobs = new HashMap<Integer, GearmanJob>();
+ this.psJobs = new HashMap<Integer, GearmanJob>();
this.restartJobs = new HashMap<Integer, GearmanJob>();
this.pingRestartJobs = new HashMap<Integer, GearmanJob>();
this.status = new HashMap<Integer, Integer>();
@@ -415,19 +415,19 @@ public class Boot extends Thread {
break;
case 11:
- top(client);
+ ps(client);
break;
case 12:
- GearmanJob checkStatusJob = topJobs.get(clientID);
+ GearmanJob psJob = psJobs.get(clientID);
- if (checkStatusJob != null) {
+ if (psJob != null) {
GearmanJobStatus jobStatus = gearmanClient
- .getJobStatus(checkStatusJob);
+ .getJobStatus(psJob);
- if (!jobStatus.isKnown() && checkStatusJob.isDone()) {
- GearmanJobResult whoJobRes = checkStatusJob.get();
+ if (!jobStatus.isKnown() && psJob.isDone()) {
+ GearmanJobResult whoJobRes = psJob.get();
String result = ByteUtils.fromUTF8Bytes(whoJobRes
.getResults());
@@ -442,12 +442,12 @@ public class Boot extends Thread {
System.out.println(ipAddress
+ " is working");
status.put(clientID, 18); // is working
- topJobs.remove(clientID);
+ psJobs.remove(clientID);
} else {
System.out.println(ipAddress
+ " is not working");
status.put(clientID, 13); // is not working
- topJobs.remove(clientID);
+ psJobs.remove(clientID);
}
} else {
System.out.println(ipAddress
@@ -458,7 +458,7 @@ public class Boot extends Thread {
// cannot check if user is working, go in
// errorState
status.put(clientID, 19);
- topJobs.remove(clientID);
+ psJobs.remove(clientID);
}
}
}
@@ -701,18 +701,18 @@ public class Boot extends Thread {
System.out.println("who " + ipAddress);
}
- private void top(HashMap<String, String> client) {
+ private void ps(HashMap<String, String> client) {
String ipAddress = client.get("ip");
int clientID = Integer.parseInt(client.get("id"));
- GearmanJob job = GearmanJobImpl.createJob("top", ipAddress.getBytes(),
- "top" + clientID);
+ GearmanJob job = GearmanJobImpl.createJob("ps", ipAddress.getBytes(),
+ "ps" + clientID);
gearmanClient.submit(job);
- status.put(clientID, 12); // top started
- topJobs.put(clientID, job);
+ status.put(clientID, 12); // ps started
+ psJobs.put(clientID, job);
- System.out.println("top " + ipAddress);
+ System.out.println("ps " + ipAddress);
}
private void restart(HashMap<String, String> client) {