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 07:59:03 UTC

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

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

 ##########
 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:
   @lei-xia Yes 3 commits are for one issue. I will combine them into one commit and create another pull request. Other one is just for deleting the logs. I can create a separate issue for that. I already confirmed this log removal part with Junkai. @dasahcc can you please have a look and confirm it again.
   
   Thanks.

----------------------------------------------------------------
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