You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@helix.apache.org by GitBox <gi...@apache.org> on 2019/07/20 09:25:42 UTC

[GitHub] [helix] dasahcc commented on a change in pull request #346: Unwanted logs have been removed.

dasahcc commented on a change in pull request #346: Unwanted logs have been removed.
URL: https://github.com/apache/helix/pull/346#discussion_r305574112
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
 ##########
 @@ -241,38 +241,28 @@ private boolean computeResourceBestPossibleState(ClusterEvent event, ResourceCon
       try {
         HelixManager manager = event.getAttribute(AttributeName.helixmanager.name());
         rebalancer.init(manager);
-        idealState =
-            rebalancer.computeNewIdealState(resourceName, idealState, currentStateOutput, cache);
+        idealState = rebalancer.computeNewIdealState(resourceName, idealState, currentStateOutput, cache);
 
         output.setPreferenceLists(resourceName, idealState.getPreferenceLists());
 
         // Use the internal MappingCalculator interface to compute the final assignment
         // The next release will support rebalancers that compute the mapping from start to finish
-        partitionStateAssignment = mappingCalculator
-            .computeBestPossiblePartitionState(cache, idealState, resource, currentStateOutput);
+        partitionStateAssignment =
+            mappingCalculator.computeBestPossiblePartitionState(cache, idealState, resource, currentStateOutput);
         for (Partition partition : resource.getPartitions()) {
           Map<String, String> newStateMap = partitionStateAssignment.getReplicaMap(partition);
           output.setState(resourceName, partition, newStateMap);
         }
 
         // Check if calculation is done successfully
         return checkBestPossibleStateCalculation(idealState);
+      } catch (HelixException e){
+        // No eligible instance is found.
+        LogUtil
+            .logError(logger, _eventId, e.getMessage());
       } catch (Exception e) {
         LogUtil
             .logError(logger, _eventId, "Error computing assignment for resource " + resourceName + ". Skipping.", e);
-        // TODO : remove this part after debugging NPE
-        StringBuilder sb = new StringBuilder();
 
 Review comment:
   Yes. They can be removed since the NPE happened by assignment is NULL. If we check that part, we should fine with the logs.
   
   But you have too many commits. I would suggest to merge some of them into to commits: CRUSHED log fixing and removing the todo log. Put them into two separated PRs.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services