srdo commented on a change in pull request #3050: STORM-3434: server: fix all 
checkstyle warnings
URL: https://github.com/apache/storm/pull/3050#discussion_r303235072
 
 

 ##########
 File path: 
storm-server/src/main/java/org/apache/storm/daemon/supervisor/BasicContainer.java
 ##########
 @@ -819,146 +816,148 @@ private long calculateMemoryLimit(final 
WorkerResources resources, final int mem
 
     @Override
     public void launch() throws IOException {
-        _type.assertFull();
-        LOG.info("Launching worker with assignment {} for this supervisor {} 
on port {} with id {}", _assignment,
-                 _supervisorId, _port, _workerId);
-        String logPrefix = "Worker Process " + _workerId;
-        ProcessExitCallback processExitCallback = new 
ProcessExitCallback(logPrefix);
-        _exitedEarly = false;
+        type.assertFull();
+        LOG.info("Launching worker with assignment {} for this supervisor {} 
on port {} with id {}", assignment,
+                supervisorId, port, workerId);
+        exitedEarly = false;
 
-        final WorkerResources resources = _assignment.get_resources();
+        final WorkerResources resources = assignment.get_resources();
         final int memOnHeap = getMemOnHeap(resources);
-        memoryLimitMB = calculateMemoryLimit(resources, memOnHeap);
-        final String stormRoot = ConfigUtils.supervisorStormDistRoot(_conf, 
_topologyId);
-        String jlp = javaLibraryPath(stormRoot, _conf);
+        memoryLimitMb = calculateMemoryLimit(resources, memOnHeap);
+        final String stormRoot = ConfigUtils.supervisorStormDistRoot(conf, 
topologyId);
+        String jlp = javaLibraryPath(stormRoot, conf);
 
         Map<String, String> topEnvironment = new HashMap<String, String>();
         @SuppressWarnings("unchecked")
-        Map<String, String> environment = (Map<String, String>) 
_topoConf.get(Config.TOPOLOGY_ENVIRONMENT);
+        Map<String, String> environment = (Map<String, String>) 
topoConf.get(Config.TOPOLOGY_ENVIRONMENT);
         if (environment != null) {
             topEnvironment.putAll(environment);
         }
 
-        String ld_library_path = topEnvironment.get("LD_LIBRARY_PATH");
-        if (ld_library_path != null) {
-            jlp = jlp + System.getProperty("path.separator") + ld_library_path;
+        String ldLibraryPath = topEnvironment.get("LD_LIBRARY_PATH");
+        if (ldLibraryPath != null) {
+            jlp = jlp + System.getProperty("path.separator") + ldLibraryPath;
         }
 
         topEnvironment.put("LD_LIBRARY_PATH", jlp);
 
-        if (_resourceIsolationManager != null) {
+        if (resourceIsolationManager != null) {
             final int cpu = (int) Math.ceil(resources.get_cpu());
             //Save the memory limit so we can enforce it less strictly
-            _resourceIsolationManager.reserveResourcesForWorker(_workerId, 
(int) memoryLimitMB, cpu);
+            resourceIsolationManager.reserveResourcesForWorker(workerId, (int) 
memoryLimitMb, cpu);
         }
 
         List<String> commandList = mkLaunchCommand(memOnHeap, stormRoot, jlp);
 
         LOG.info("Launching worker with command: {}. ", 
ServerUtils.shellCmd(commandList));
 
-        String workerDir = ConfigUtils.workerRoot(_conf, _workerId);
+        String workerDir = ConfigUtils.workerRoot(conf, workerId);
 
+        String logPrefix = "Worker Process " + workerId;
+        ProcessExitCallback processExitCallback = new 
ProcessExitCallback(logPrefix);
         launchWorkerProcess(commandList, topEnvironment, logPrefix, 
processExitCallback, new File(workerDir));
     }
 
     private static class TopologyMetaData {
-        private final Map<String, Object> _conf;
-        private final String _topologyId;
-        private final AdvancedFSOps _ops;
-        private final String _stormRoot;
-        private boolean _dataCached = false;
-        private List<String> _depLocs = null;
-        private String _stormVersion = null;
+        private final Map<String, Object> conf;
+        private final String topologyId;
+        private final AdvancedFSOps ops;
+        private final String stormRoot;
+        private boolean dataCached = false;
+        private List<String> depLocs = null;
+        private String stormVersion = null;
 
         public TopologyMetaData(final Map<String, Object> conf, final String 
topologyId, final AdvancedFSOps ops, final String stormRoot) {
-            _conf = conf;
-            _topologyId = topologyId;
-            _ops = ops;
-            _stormRoot = stormRoot;
+            this.conf = conf;
+            this.topologyId = topologyId;
+            this.ops = ops;
+            this.stormRoot = stormRoot;
         }
 
+        @Override
         public String toString() {
             List<String> data;
             String stormVersion;
             synchronized (this) {
-                data = _depLocs;
-                stormVersion = _stormVersion;
+                data = depLocs;
+                stormVersion = this.stormVersion;
             }
-            return "META for " + _topologyId + " DEP_LOCS => " + data + " 
STORM_VERSION => " + stormVersion;
+            return "META for " + topologyId + " DEP_LOCS => " + data + " 
STORM_VERSION => " + stormVersion;
         }
 
         private synchronized void readData() throws IOException {
-            final StormTopology stormTopology = 
ConfigUtils.readSupervisorTopology(_conf, _topologyId, _ops);
+            final StormTopology stormTopology = 
ConfigUtils.readSupervisorTopology(conf, topologyId, ops);
             final List<String> dependencyLocations = new ArrayList<>();
             if (stormTopology.get_dependency_jars() != null) {
                 for (String dependency : stormTopology.get_dependency_jars()) {
-                    dependencyLocations.add(new File(_stormRoot, 
dependency).getAbsolutePath());
+                    dependencyLocations.add(new File(stormRoot, 
dependency).getAbsolutePath());
                 }
             }
 
             if (stormTopology.get_dependency_artifacts() != null) {
                 for (String dependency : 
stormTopology.get_dependency_artifacts()) {
-                    dependencyLocations.add(new File(_stormRoot, 
dependency).getAbsolutePath());
+                    dependencyLocations.add(new File(stormRoot, 
dependency).getAbsolutePath());
                 }
             }
-            _depLocs = dependencyLocations;
-            _stormVersion = stormTopology.get_storm_version();
-            _dataCached = true;
+            depLocs = dependencyLocations;
+            stormVersion = stormTopology.get_storm_version();
+            dataCached = true;
         }
 
         public synchronized List<String> getDepLocs() throws IOException {
-            if (!_dataCached) {
+            if (!dataCached) {
                 readData();
             }
-            return _depLocs;
+            return depLocs;
         }
 
         public synchronized String getStormVersion() throws IOException {
-            if (!_dataCached) {
+            if (!dataCached) {
                 readData();
             }
-            return _stormVersion;
+            return stormVersion;
         }
     }
 
+    @SuppressWarnings("checkstyle:AbbreviationAsWordInName")
     static class TopoMetaLRUCache {
 
 Review comment:
   Feel free to rename

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to