summaryrefslogtreecommitdiffstats
path: root/gearman/controllerWorker/ControllerWorker/Shutdown.java
diff options
context:
space:
mode:
Diffstat (limited to 'gearman/controllerWorker/ControllerWorker/Shutdown.java')
-rw-r--r--gearman/controllerWorker/ControllerWorker/Shutdown.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/gearman/controllerWorker/ControllerWorker/Shutdown.java b/gearman/controllerWorker/ControllerWorker/Shutdown.java
index 35779ea..2558d64 100644
--- a/gearman/controllerWorker/ControllerWorker/Shutdown.java
+++ b/gearman/controllerWorker/ControllerWorker/Shutdown.java
@@ -36,7 +36,7 @@ public class Shutdown extends Thread {
private HashMap<Integer, GearmanJob> whoJobs;
private HashMap<Integer, GearmanJob> shutdownJobs;
private HashMap<Integer, GearmanJob> pingShutdownJobs;
- private HashMap<Integer, GearmanJob> topJobs;
+ private HashMap<Integer, GearmanJob> psJobs;
private HashMap<Integer, Integer> status;
private HashMap<Integer, String> errors;
private HashMap<Integer, Long> pingShutdownTime;
@@ -53,7 +53,7 @@ public class Shutdown extends Thread {
this.whoJobs = new HashMap<Integer, GearmanJob>();
this.shutdownJobs = new HashMap<Integer, GearmanJob>();
this.pingShutdownJobs = new HashMap<Integer, GearmanJob>();
- this.topJobs = new HashMap<Integer, GearmanJob>();
+ this.psJobs = new HashMap<Integer, GearmanJob>();
this.status = new HashMap<Integer, Integer>();
this.errors = new HashMap<Integer, String>();
this.updateRate = updateRate; // updates per second
@@ -339,19 +339,19 @@ public class Shutdown extends Thread {
break;
case 9:
- top(client);
+ ps(client);
break;
case 10:
- 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());
@@ -366,12 +366,12 @@ public class Shutdown extends Thread {
System.out.println(ipAddress
+ " is working");
status.put(clientID, 11); // is working
- topJobs.remove(clientID);
+ psJobs.remove(clientID);
} else {
System.out.println(ipAddress
+ " is not working");
status.put(clientID, 4); // is not working
- topJobs.remove(clientID);
+ psJobs.remove(clientID);
}
} else {
System.out.println(ipAddress
@@ -382,7 +382,7 @@ public class Shutdown extends Thread {
// cannot check if user is working, go in
// errorState
status.put(clientID, 12);
- topJobs.remove(clientID);
+ psJobs.remove(clientID);
}
}
}
@@ -479,18 +479,18 @@ public class Shutdown extends Thread {
System.out.println("ping " + 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, 9); // top started
- topJobs.put(clientID, job);
+ status.put(clientID, 9); // ps started
+ psJobs.put(clientID, job);
- System.out.println("top " + ipAddress);
+ System.out.println("ps " + ipAddress);
}
public String getStatusText(HashMap<String, String> client) {