summaryrefslogtreecommitdiffstats
path: root/gearman/controllerWorker/ControllerWorker
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-16 15:18:28 +0200
committerBjörn Geiger2011-08-16 15:18:28 +0200
commit8cb7f08c0a9f2e1c9b971895a89246feba69881f (patch)
tree21e8f4e479d2ac8fdda785b7239830a271d53322 /gearman/controllerWorker/ControllerWorker
parentweiteren Fehler (diff)
downloadpoolctrl-8cb7f08c0a9f2e1c9b971895a89246feba69881f.tar.gz
poolctrl-8cb7f08c0a9f2e1c9b971895a89246feba69881f.tar.xz
poolctrl-8cb7f08c0a9f2e1c9b971895a89246feba69881f.zip
verschiedene Korrekturen
Diffstat (limited to 'gearman/controllerWorker/ControllerWorker')
-rw-r--r--gearman/controllerWorker/ControllerWorker/Boot.java34
-rw-r--r--gearman/controllerWorker/ControllerWorker/Shutdown.java34
2 files changed, 34 insertions, 34 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) {
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) {