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.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/gearman/controllerWorker/ControllerWorker/Shutdown.java b/gearman/controllerWorker/ControllerWorker/Shutdown.java
index 3c0dca9..70582e6 100644
--- a/gearman/controllerWorker/ControllerWorker/Shutdown.java
+++ b/gearman/controllerWorker/ControllerWorker/Shutdown.java
@@ -34,7 +34,7 @@ public class Shutdown extends Thread {
private HashMap<Integer, GearmanJob> pingJobs;
private HashMap<Integer, GearmanJob> whoJobs;
- private HashMap<Integer, GearmanJob> shutdownJobs;
+ private HashMap<Integer, GearmanJob> doShutdownJobs;
private HashMap<Integer, GearmanJob> pingShutdownJobs;
private HashMap<Integer, GearmanJob> psJobs;
private HashMap<Integer, Integer> status;
@@ -51,7 +51,7 @@ public class Shutdown extends Thread {
long waitTime) {
this.pingJobs = new HashMap<Integer, GearmanJob>();
this.whoJobs = new HashMap<Integer, GearmanJob>();
- this.shutdownJobs = new HashMap<Integer, GearmanJob>();
+ this.doShutdownJobs = new HashMap<Integer, GearmanJob>();
this.pingShutdownJobs = new HashMap<Integer, GearmanJob>();
this.psJobs = new HashMap<Integer, GearmanJob>();
this.status = new HashMap<Integer, Integer>();
@@ -224,18 +224,18 @@ public class Shutdown extends Thread {
break;
case 4:
- shutdown(client);
+ doShutdown(client);
break;
case 5:
- GearmanJob shutdownJob = shutdownJobs.get(clientID);
- if (shutdownJob != null) {
+ GearmanJob doShutdownJob = doShutdownJobs.get(clientID);
+ if (doShutdownJob != null) {
GearmanJobStatus jobStatus = gearmanClient
- .getJobStatus(shutdownJob);
+ .getJobStatus(doShutdownJob);
- if (!jobStatus.isKnown() && shutdownJob.isDone()) {
- GearmanJobResult wolJobRes = shutdownJob.get();
+ if (!jobStatus.isKnown() && doShutdownJob.isDone()) {
+ GearmanJobResult wolJobRes = doShutdownJob.get();
String result = ByteUtils.fromUTF8Bytes(wolJobRes
.getResults());
if (!result.isEmpty()) {
@@ -246,7 +246,7 @@ public class Shutdown extends Thread {
+ " Shutdown command send");
status.put(clientID, 6); // shutdown command
// send
- shutdownJobs.remove(clientID);
+ doShutdownJobs.remove(clientID);
} else {
System.out.println(ipAddress
+ " Cannot send shutdown command");
@@ -256,7 +256,7 @@ public class Shutdown extends Thread {
// cannot send shutdown command, go in
// errorState
status.put(clientID, 12);
- shutdownJobs.remove(clientID);
+ doShutdownJobs.remove(clientID);
}
}
}
@@ -453,18 +453,18 @@ public class Shutdown extends Thread {
System.out.println("who " + ipAddress);
}
- private void shutdown(HashMap<String, String> client) {
+ private void doShutdown(HashMap<String, String> client) {
String ipAddress = client.get("ip");
int clientID = Integer.parseInt(client.get("id"));
- GearmanJob job = GearmanJobImpl.createJob("shutdown", ipAddress
- .getBytes(), "shutdown" + clientID);
+ GearmanJob job = GearmanJobImpl.createJob("doShutdown", ipAddress
+ .getBytes(), "doShutdown" + clientID);
gearmanClient.submit(job);
status.put(clientID, 5); // shutdown started
- shutdownJobs.put(clientID, job);
+ doShutdownJobs.put(clientID, job);
- System.out.println("shutdown " + ipAddress);
+ System.out.println("doShutdown " + ipAddress);
}
private void pingShutdown(HashMap<String, String> client) {