Address comment.

Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/02349acc
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/02349acc
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/02349acc

Branch: refs/heads/master
Commit: 02349acca45ea45574d28ac1790193e9bc6ba9f0
Parents: 314d58d
Author: zhuol <[email protected]>
Authored: Fri Feb 12 13:59:46 2016 -0600
Committer: zhuol <[email protected]>
Committed: Fri Feb 19 13:04:35 2016 -0600

----------------------------------------------------------------------
 .../jvm/org/apache/storm/ProcessSimulator.java   | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/02349acc/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java 
b/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
index 7734221..bcc46b8 100644
--- a/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
+++ b/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
 
 public class ProcessSimulator {
     private static Logger LOG = 
LoggerFactory.getLogger(ProcessSimulator.class);
-    protected static Object lock = new Object();
+    private static Object lock = new Object();
     protected static ConcurrentHashMap<String, Shutdownable> processMap = new 
ConcurrentHashMap<String, Shutdownable>();
 
     /**
@@ -41,16 +41,6 @@ public class ProcessSimulator {
     }
 
     /**
-     * Get a process' handle
-     * 
-     * @param pid
-     * @return
-     */
-    protected static Shutdownable getProcessHandle(String pid) {
-        return processMap.get(pid);
-    }
-
-    /**
      * Get all process handles
      * 
      * @return
@@ -67,12 +57,12 @@ public class ProcessSimulator {
     public static void killProcess(String pid) {
         synchronized (lock) {
             LOG.info("Begin killing process " + pid);
-            Shutdownable shutdownHandle = getProcessHandle(pid);
+            Shutdownable shutdownHandle = processMap.get(pid);
             if (shutdownHandle != null) {
                 shutdownHandle.shutdown();
             }
             processMap.remove(pid);
-            LOG.info("Successfully killing process " + pid);
+            LOG.info("Successfully killed process " + pid);
         }
     }
 
@@ -80,10 +70,11 @@ public class ProcessSimulator {
      * kill all processes
      */
     public static void killAllProcesses() {
+        LOG.info("Begin killing all processes");
         Set<String> pids = processMap.keySet();
         for (String pid : pids) {
             killProcess(pid);
         }
-        LOG.info("Successfully kill all processes");
+        LOG.info("Successfully killed all processes");
     }
 }

Reply via email to